From cf22a500173cced8f8351f1aa8a6689f8422583c Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 14 Aug 2023 10:56:53 +0200 Subject: [PATCH] sstuff: Document that Socket::readWithTimeout() does not handle partial reads (cherry picked from commit 9c3ff201bc70cc426170e23a7b99a14a4405c896) --- pdns/sstuff.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/sstuff.hh b/pdns/sstuff.hh index adecbe5ec9..208697cc2b 100644 --- a/pdns/sstuff.hh +++ b/pdns/sstuff.hh @@ -351,6 +351,11 @@ public: return static_cast(res); } + /** Read a bock of data from the socket to a block of memory, + * waiting at most 'timeout' seconds for the data to become + * available. Be aware that this does _NOT_ handle partial reads + * for you. + */ ssize_t readWithTimeout(char* buffer, size_t n, int timeout) { int err = waitForRWData(d_socket, true, timeout, 0); -- 2.47.2