aboutsummaryrefslogtreecommitdiff
path: root/src/lib/net
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-11-22 17:38:40 +0100
committerNick Mathewson <nickm@torproject.org>2018-12-17 16:39:28 -0500
commite982fb1dae6ff0888ae419246578048470dd65b8 (patch)
tree224f558f5359912a741765ec0e740d14225836a5 /src/lib/net
parent89393a77e5db804784d4f08ef67fd2831799d65b (diff)
downloadtor-e982fb1dae6ff0888ae419246578048470dd65b8.tar.gz
tor-e982fb1dae6ff0888ae419246578048470dd65b8.zip
Add documentation for the is_socket and error argument of read_to_chunk().
See: https://bugs.torproject.org/28179
Diffstat (limited to 'src/lib/net')
-rw-r--r--src/lib/net/buffers_net.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/net/buffers_net.c b/src/lib/net/buffers_net.c
index 1b65819dbb..da7043d5cb 100644
--- a/src/lib/net/buffers_net.c
+++ b/src/lib/net/buffers_net.c
@@ -33,8 +33,10 @@
/** 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)