From: Remi Gacogne Date: Mon, 14 Aug 2023 08:56:53 +0000 (+0200) Subject: sstuff: Document that Socket::readWithTimeout() does not handle partial reads X-Git-Tag: rec-5.0.0-alpha1~65^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c3ff201bc70cc426170e23a7b99a14a4405c896;p=thirdparty%2Fpdns.git sstuff: Document that Socket::readWithTimeout() does not handle partial reads --- 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);