summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-02-28 05:22:07 +0000
committerRoger Dingledine <arma@torproject.org>2004-02-28 05:22:07 +0000
commita24b6e6d4fd9d65e9f0eef45f46720cd5007e175 (patch)
tree9be3b48e6c978b8ac2c16ed30909aecedcba5b7b
parent82f224ca6d1010d640f425bf132a8b9f51896787 (diff)
downloadtor-a24b6e6d4fd9d65e9f0eef45f46720cd5007e175.tar.gz
tor-a24b6e6d4fd9d65e9f0eef45f46720cd5007e175.zip
make flush_buf have a sane return convention
svn:r1157
-rw-r--r--src/or/buffers.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 48a073c2b2..a87f807030 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -155,9 +155,11 @@ void buf_free(buf_t *buf) {
}
/* read from socket s, writing onto end of buf.
- * read at most 'at_most' bytes, and in any case don't read more than will fit based on buflen.
- * If read() returns 0, set *reached_eof to 1 and return 0. If you want to tear
- * down the connection return -1, else return the number of bytes read.
+ * read at most 'at_most' bytes, and in any case don't read more than
+ * will fit based on buflen.
+ * If read() returns 0, set *reached_eof to 1 and return 0. If you want
+ * to tear down the connection return -1, else return the number of
+ * bytes read.
*/
int read_to_buf(int s, int at_most, buf_t *buf, int *reached_eof) {
@@ -228,7 +230,7 @@ int flush_buf(int s, buf_t *buf, int *buf_flushlen)
/* push from buf onto s
* then memmove to front of buf
- * return -1 or how many bytes remain to be flushed */
+ * return -1 or how many bytes you just flushed */
int write_result;
#ifdef MS_WINDOWS
@@ -259,8 +261,7 @@ int flush_buf(int s, buf_t *buf, int *buf_flushlen)
log_fn(LOG_DEBUG,"%d: flushed %d bytes, %d ready to flush, %d remain.",
s,write_result,*buf_flushlen,(int)buf->datalen);
- return *buf_flushlen;
- /* XXX USE_TLS should change to return write_result like any sane function would */
+ return write_result;
}
}