diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-27 19:19:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-27 19:19:38 +0000 |
commit | b229154fa8d9493d547c9394f9bd25e71c0a91cb (patch) | |
tree | 383d307f6a54f5b1bc2f2c25b40e4fe2ea08e571 | |
parent | 28f353a684cf7a76f772d1559a1039774e2a4885 (diff) | |
download | tor-b229154fa8d9493d547c9394f9bd25e71c0a91cb.tar.gz tor-b229154fa8d9493d547c9394f9bd25e71c0a91cb.zip |
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().
svn:r13753
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/or/connection.c | 12 |
2 files changed, 14 insertions, 3 deletions
@@ -1,5 +1,8 @@ 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 diff --git a/src/or/connection.c b/src/or/connection.c index 27c15c7b7d..9e559530da 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1576,8 +1576,16 @@ connection_buckets_decrement(connection_t *conn, time_t now, { 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); |