From: Alexander Færøy Date: Thu, 22 Nov 2018 16:38:40 +0000 (+0100) Subject: Add documentation for the is_socket and error argument of read_to_chunk(). X-Git-Tag: tor-0.4.0.1-alpha~70^2~4^2~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e982fb1dae6ff0888ae419246578048470dd65b8;p=thirdparty%2Ftor.git Add documentation for the is_socket and error argument of read_to_chunk(). See: https://bugs.torproject.org/28179 --- 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)