diff options
author | Roger Dingledine <arma@torproject.org> | 2007-01-09 00:50:50 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-01-09 00:50:50 +0000 |
commit | 1d8a4cb9892d582b3bb6f090476c2490633709d4 (patch) | |
tree | 7eb04521da09eb2919a6a3d5af6ea0d60aa52b2c /src | |
parent | c85ff4d6abe4a1790e8248ca92abf811c7c9803e (diff) | |
download | tor-1d8a4cb9892d582b3bb6f090476c2490633709d4.tar tor-1d8a4cb9892d582b3bb6f090476c2490633709d4.tar.gz |
Fix an assert error introduced in 0.1.2.5-alpha: if a single TLS
connection handles more than 4 gigs in either direction, we assert.
svn:r9306
Diffstat (limited to 'src')
-rw-r--r-- | src/common/tortls.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index c20fec648..18554068d 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -871,12 +871,11 @@ 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)); - /* If we wrapped around, this should still give us the right answer, unless + /* 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. */ - tor_assert(r >= tls->last_read_count); - tor_assert(w >= tls->last_write_count); *n_read = (size_t)(r - tls->last_read_count); *n_written = (size_t)(w - tls->last_write_count); tls->last_read_count = r; |