[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r9306: Fix an assert error introduced in 0.1.2.5-alpha: if a single (in tor/trunk: . src/common)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r9306: Fix an assert error introduced in 0.1.2.5-alpha: if a single (in tor/trunk: . src/common)
- From: arma@xxxxxxxx
- Date: Mon, 8 Jan 2007 19:50:52 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 08 Jan 2007 19:51:01 -0500
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: arma
Date: 2007-01-08 19:50:50 -0500 (Mon, 08 Jan 2007)
New Revision: 9306
Modified:
tor/trunk/ChangeLog
tor/trunk/src/common/tortls.c
Log:
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.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-01-09 00:37:13 UTC (rev 9305)
+++ tor/trunk/ChangeLog 2007-01-09 00:50:50 UTC (rev 9306)
@@ -31,6 +31,8 @@
excess load to the exit nodes.
o Major bugfixes:
+ - 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.
- Fix an assert error introduced in 0.1.2.5-alpha: if you're an
advertised exit node, somebody might try to exit from you when
you're bootstrapping and before you've built your descriptor yet.
Modified: tor/trunk/src/common/tortls.c
===================================================================
--- tor/trunk/src/common/tortls.c 2007-01-09 00:37:13 UTC (rev 9305)
+++ tor/trunk/src/common/tortls.c 2007-01-09 00:50:50 UTC (rev 9306)
@@ -871,12 +871,11 @@
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;