diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2011-09-17 03:53:07 -0700 |
---|---|---|
committer | Robert Ransom <rransom.8774@gmail.com> | 2011-10-02 12:49:35 -0700 |
commit | fbea8c8ef1e2f549e84ee681a9640c3006f7ad64 (patch) | |
tree | 5c3a01e4f706e81c39172d826f0c154303e4b882 /src/or/rendclient.c | |
parent | 34a6b8b7e588b6f10e6e87cf876ef6ada49f8b8a (diff) | |
download | tor-fbea8c8ef1e2f549e84ee681a9640c3006f7ad64.tar.gz tor-fbea8c8ef1e2f549e84ee681a9640c3006f7ad64.zip |
Detect and remove unreachable intro points
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 3c1c116af5..0a9e2a605f 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -662,6 +662,11 @@ rend_client_cancel_descriptor_fetches(void) * current hidden service connection attempt has ended or it has * appeared in a newly fetched rendezvous descriptor. * + * If <b>failure_type</b> is INTRO_POINT_FAILURE_UNREACHABLE, + * increment the intro point's reachability-failure count; if it has + * now failed MAX_INTRO_POINT_REACHABILITY_FAILURES or more times, + * remove the intro point from (our parsed copy of) the HS descriptor. + * * Return -1 if error, 0 if no usable intro points remain or service * unrecognized, 1 if recognized and some intro points remain. */ @@ -704,6 +709,20 @@ rend_client_report_intro_point_failure(extend_info_t *failed_intro, case INTRO_POINT_FAILURE_TIMEOUT: intro->timed_out = 1; break; + case INTRO_POINT_FAILURE_UNREACHABLE: + ++(intro->unreachable_count); + { + int zap_intro_point = + intro->unreachable_count >= MAX_INTRO_POINT_REACHABILITY_FAILURES; + log_info(LD_REND, "Failed to reach this intro point %u times.%s", + intro->unreachable_count, + zap_intro_point ? " Removing from descriptor.": ""); + if (zap_intro_point) { + rend_intro_point_free(intro); + smartlist_del(ent->parsed->intro_nodes, i); + } + } + break; } break; } |