]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add documentation for the is_socket and error argument of read_to_chunk().
authorAlexander Færøy <ahf@torproject.org>
Thu, 22 Nov 2018 16:38:40 +0000 (17:38 +0100)
committerNick Mathewson <nickm@torproject.org>
Mon, 17 Dec 2018 21:39:28 +0000 (16:39 -0500)
See: https://bugs.torproject.org/28179

src/lib/net/buffers_net.c

index 1b65819dbbddce29808fcd5ad48851e06ea16b5c..da7043d5cba6679975a55798021123986b971870 100644 (file)
 
 /** Read up to <b>at_most</b> bytes from the file descriptor <b>fd</b> into
  * <b>chunk</b> (which must be on <b>buf</b>). If we get an EOF, set
- * *<b>reached_eof</b> to 1.  Return -1 on error, 0 on eof or blocking,
- * and the number of bytes read otherwise. */
+ * *<b>reached_eof</b> to 1. Uses <b>tor_socket_recv()</b> iff <b>is_socket</b>
+ * is true, otherwise it uses <b>read()</b>.  Return -1 on error (and sets
+ * *<b>error</b> to errno), 0 on eof or blocking, and the number of bytes read
+ * otherwise. */
 static inline int
 read_to_chunk(buf_t *buf, chunk_t *chunk, tor_socket_t fd, size_t at_most,
               int *reached_eof, int *error, bool is_socket)