]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
sstuff: Document that Socket::readWithTimeout() does not handle partial reads
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Aug 2023 08:56:53 +0000 (10:56 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Aug 2023 08:56:53 +0000 (10:56 +0200)
pdns/sstuff.hh

index adecbe5ec917c252e69608744cca3407baba7817..208697cc2bb8e6dd501fba855082cec2414598ab 100644 (file)
@@ -351,6 +351,11 @@ public:
     return static_cast<size_t>(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);