Merge branch 'maint-0.2.9' into release-0.2.9
This commit is contained in:
commit
f5ce44e6bd
|
@ -0,0 +1,6 @@
|
||||||
|
o Minor bugfixes (single onion services, Tor2web):
|
||||||
|
- Stop logging long-term one-hop circuits deliberately created by single
|
||||||
|
onion services and Tor2web. These log messages are intended to diagnose
|
||||||
|
issue 8387, which relates to circuits hanging around forever for no
|
||||||
|
reason.
|
||||||
|
Fixes bug 20613; bugfix on 0.2.9.1-alpha. Reported by "pastly".
|
|
@ -788,6 +788,8 @@ static time_t last_expired_clientside_circuits = 0;
|
||||||
* As a diagnostic for bug 8387, log information about how many one-hop
|
* As a diagnostic for bug 8387, log information about how many one-hop
|
||||||
* circuits we have around that have been there for at least <b>age</b>
|
* circuits we have around that have been there for at least <b>age</b>
|
||||||
* seconds. Log a few of them.
|
* seconds. Log a few of them.
|
||||||
|
* Ignores Single Onion Service intro and Tor2web redezvous circuits, they are
|
||||||
|
* expected to be long-term one-hop circuits.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
circuit_log_ancient_one_hop_circuits(int age)
|
circuit_log_ancient_one_hop_circuits(int age)
|
||||||
|
@ -797,6 +799,7 @@ circuit_log_ancient_one_hop_circuits(int age)
|
||||||
time_t cutoff = now - age;
|
time_t cutoff = now - age;
|
||||||
int n_found = 0;
|
int n_found = 0;
|
||||||
smartlist_t *log_these = smartlist_new();
|
smartlist_t *log_these = smartlist_new();
|
||||||
|
const or_options_t *options = get_options();
|
||||||
|
|
||||||
SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) {
|
SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) {
|
||||||
const origin_circuit_t *ocirc;
|
const origin_circuit_t *ocirc;
|
||||||
|
@ -804,6 +807,19 @@ circuit_log_ancient_one_hop_circuits(int age)
|
||||||
continue;
|
continue;
|
||||||
if (circ->timestamp_created.tv_sec >= cutoff)
|
if (circ->timestamp_created.tv_sec >= cutoff)
|
||||||
continue;
|
continue;
|
||||||
|
/* Single Onion Services deliberately make long term one-hop intro
|
||||||
|
* connections. We only ignore active intro point connections, if we take
|
||||||
|
* a long time establishing, that's worth logging. */
|
||||||
|
if (rend_service_allow_non_anonymous_connection(options) &&
|
||||||
|
circ->purpose == CIRCUIT_PURPOSE_S_INTRO)
|
||||||
|
continue;
|
||||||
|
/* Tor2web deliberately makes long term one-hop rend connections,
|
||||||
|
* particularly when Tor2webRendezvousPoints is used. We only ignore
|
||||||
|
* active rend point connections, if we take a long time to rendezvous,
|
||||||
|
* that's worth logging. */
|
||||||
|
if (rend_client_allow_non_anonymous_connection(options) &&
|
||||||
|
circ->purpose == CIRCUIT_PURPOSE_C_REND_JOINED)
|
||||||
|
continue;
|
||||||
ocirc = CONST_TO_ORIGIN_CIRCUIT(circ);
|
ocirc = CONST_TO_ORIGIN_CIRCUIT(circ);
|
||||||
|
|
||||||
if (ocirc->build_state && ocirc->build_state->onehop_tunnel) {
|
if (ocirc->build_state && ocirc->build_state->onehop_tunnel) {
|
||||||
|
@ -839,7 +855,7 @@ circuit_log_ancient_one_hop_circuits(int age)
|
||||||
|
|
||||||
tor_asprintf(&dirty, "Dirty since %s (%ld seconds vs %ld-second cutoff)",
|
tor_asprintf(&dirty, "Dirty since %s (%ld seconds vs %ld-second cutoff)",
|
||||||
dirty_since, (long)(now - circ->timestamp_dirty),
|
dirty_since, (long)(now - circ->timestamp_dirty),
|
||||||
(long) get_options()->MaxCircuitDirtiness);
|
(long) options->MaxCircuitDirtiness);
|
||||||
} else {
|
} else {
|
||||||
dirty = tor_strdup("Not marked dirty");
|
dirty = tor_strdup("Not marked dirty");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue