[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r13753: Backport: Add better warnings for the error that produced bu (in tor/branches/tor-0_2_0-patches: . src/or)
Author: nickm
Date: 2008-02-27 14:19:38 -0500 (Wed, 27 Feb 2008)
New Revision: 13753
Modified:
tor/branches/tor-0_2_0-patches/
tor/branches/tor-0_2_0-patches/ChangeLog
tor/branches/tor-0_2_0-patches/src/or/connection.c
Log:
r18463@catbus: nickm | 2008-02-27 14:19:21 -0500
Backport: Add better warnings for the error that produced bug 614, and downgrade from a tor_assert() to a tor_fragile_assert().
Property changes on: tor/branches/tor-0_2_0-patches
___________________________________________________________________
svk:merge ticket from /tor/trunk [r13743] on 55e972cd-5a19-0410-ae62-a4d7a52db4cd
svk:merge ticket from /tor/020 [r18463] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog 2008-02-27 19:19:34 UTC (rev 13752)
+++ tor/branches/tor-0_2_0-patches/ChangeLog 2008-02-27 19:19:38 UTC (rev 13753)
@@ -1,6 +1,9 @@
Changes in version 0.2.0.21-rc - 2008-0?-??
+ o Minor bugfixes:
+ - Downgrade assert in connection_buckets_decrement() to a log message.
+ This may help us solve bug 614, and in any case will make its symptoms
+ less severe. Bugfix on 0.2.0.20-rc.
-
Changes in version 0.2.0.20-rc - 2008-02-24
Tor 0.2.0.20-rc is the first release candidate for the 0.2.0 series. It
makes more progress towards normalizing Tor's TLS handshake, makes
Modified: tor/branches/tor-0_2_0-patches/src/or/connection.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/connection.c 2008-02-27 19:19:34 UTC (rev 13752)
+++ tor/branches/tor-0_2_0-patches/src/or/connection.c 2008-02-27 19:19:38 UTC (rev 13753)
@@ -1576,8 +1576,16 @@
{
if (!connection_is_rate_limited(conn))
return; /* local IPs are free */
- tor_assert(num_read < INT_MAX);
- tor_assert(num_written < INT_MAX);
+ if (num_written >= INT_MAX || num_read >= INT_MAX) {
+ log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, "
+ "connection type=%s, state=%s",
+ (unsigned long)num_read, (unsigned long)num_written,
+ conn_type_to_string(conn->type),
+ conn_state_to_string(conn->type, conn->state));
+ if (num_written >= INT_MAX) num_written = 1;
+ if (num_read >= INT_MAX) num_read = 1;
+ tor_fragile_assert();
+ }
if (num_read > 0)
rep_hist_note_bytes_read(num_read, now);