]> sjero.net Git - wget/commitdiff
[svn] Doc fix to fd_peek.
authorhniksic <devnull@localhost>
Wed, 16 Mar 2005 21:44:22 +0000 (13:44 -0800)
committerhniksic <devnull@localhost>
Wed, 16 Mar 2005 21:44:22 +0000 (13:44 -0800)
src/connect.c

index 40efc3630517bbaa55642ad6f9587898a22c1108..722f6a7a874af0acaf6c7894e9462c68f748980e 100644 (file)
@@ -873,8 +873,17 @@ fd_read (int fd, char *buf, int bufsize, double timeout)
     return sock_read (fd, buf, bufsize);
 }
 
-/* The same as fd_read, but don't actually read the data, just find out
-   what's the number of bytes available for reading.  */
+/* Like fd_read, except it provides a "preview" of the data that will
+   be read by subsequent calls to fd_read.  Specifically, it copies no
+   more than BUFSIZE bytes of the currently available data to BUF and
+   returns the number of bytes copied.  Return values and timeout
+   semantics are the same as those of fd_read.
+
+   CAVEAT: Do not assume that the first subsequent call to fd_read
+   will retrieve the same amount of data.  Reading can return more or
+   less data, depending on the TCP implementation and other
+   circumstances.  However, barring an error, it can be expected that
+   all the peeked data will eventually be read by fd_read.  */
 
 int
 fd_peek (int fd, char *buf, int bufsize, double timeout)