aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-01-09 00:57:36 +0000
committerRoger Dingledine <arma@torproject.org>2007-01-09 00:57:36 +0000
commit254005fc1b17fd23dc75f031addcfa31e1c8bf57 (patch)
tree2c4fe21ec1f62d17d59f9f373506c2957392320f
parent1d8a4cb9892d582b3bb6f090476c2490633709d4 (diff)
downloadtor-254005fc1b17fd23dc75f031addcfa31e1c8bf57.tar.gz
tor-254005fc1b17fd23dc75f031addcfa31e1c8bf57.zip
apparently i think of comments with no whitespace around them as
"read this if you don't understand the code and want some help." which is not the same as "hey, you think you understand this code, but you don't." svn:r9307
-rw-r--r--src/common/tortls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 18554068db..308c981559 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -871,11 +871,13 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, size_t *n_written)
unsigned long r, w;
r = BIO_number_read(SSL_get_rbio(tls->ssl));
w = BIO_number_written(SSL_get_wbio(tls->ssl));
+
/* We are ok with letting these unsigned ints go "negative" here:
* If we wrapped around, this should still give us the right answer, unless
* we wrapped around by more than ULONG_MAX since the last time we called
* this function.
*/
+
*n_read = (size_t)(r - tls->last_read_count);
*n_written = (size_t)(w - tls->last_write_count);
tls->last_read_count = r;