diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-22 06:11:49 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-22 06:11:49 +0000 |
commit | 6097e46420e8125c1495d63a430c956ddbff6410 (patch) | |
tree | 953c6195a7442cec3aaa67cc4bc4d9772b3db834 /src/or/circuitbuild.c | |
parent | a03aa2ef6ebd2c537bc69b05c71483cd09f72b1c (diff) | |
download | tor-6097e46420e8125c1495d63a430c956ddbff6410.tar.gz tor-6097e46420e8125c1495d63a430c956ddbff6410.zip |
Fix a crash when we load a bridge descriptor from disk but we don't
currently have a Bridge line for it in our torrc. Bugfix on
0.2.0.12-alpha.
svn:r12921
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 424d2e1950..6ca23b9d51 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2908,6 +2908,7 @@ bridge_fetch_status_increment(bridge_info_t *bridge, time_t now) static void bridge_fetch_status_arrived(bridge_info_t *bridge, time_t now) { + tor_assert(bridge); bridge->fetch_status.next_attempt_at = now+60*60; bridge->fetch_status.n_download_failures = 0; } @@ -3038,13 +3039,15 @@ learned_bridge_descriptor(routerinfo_t *ri) time_t now = time(NULL); ri->is_running = 1; - /* it's here; schedule its re-fetch for a long time from now. */ - bridge_fetch_status_arrived(bridge, now); + if (bridge) { /* if we actually want to use this one */ + /* it's here; schedule its re-fetch for a long time from now. */ + bridge_fetch_status_arrived(bridge, now); - add_an_entry_guard(ri, 1); - log_notice(LD_DIR, "new bridge descriptor '%s'", ri->nickname); - if (first) - routerlist_retry_directory_downloads(now); + add_an_entry_guard(ri, 1); + log_notice(LD_DIR, "new bridge descriptor '%s'", ri->nickname); + if (first) + routerlist_retry_directory_downloads(now); + } } } |