From e982fb1dae6ff0888ae419246578048470dd65b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Thu, 22 Nov 2018 17:38:40 +0100 Subject: [PATCH] Add documentation for the is_socket and error argument of read_to_chunk(). See: https://bugs.torproject.org/28179 --- src/lib/net/buffers_net.c | 6 ++++-- 1 file 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 at_most bytes from the file descriptor fd into * chunk (which must be on buf). If we get an EOF, set - * *reached_eof to 1. Return -1 on error, 0 on eof or blocking, - * and the number of bytes read otherwise. */ + * *reached_eof to 1. Uses tor_socket_recv() iff is_socket + * is true, otherwise it uses read(). Return -1 on error (and sets + * *error 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)