diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-22 10:42:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-22 10:42:54 -0400 |
commit | d3382297fea0317880acb2c9d7d323be5027ff41 (patch) | |
tree | e96874f87c97702e121b4f7ac0d8bb1b590f4d36 /src | |
parent | 01b23a6d49f039d831074ead18dfd38548809a7d (diff) | |
parent | 530fac10aaef5e38327c8704d657a2e67987f102 (diff) | |
download | tor-d3382297fea0317880acb2c9d7d323be5027ff41.tar.gz tor-d3382297fea0317880acb2c9d7d323be5027ff41.zip |
Merge remote-tracking branch 'arma/feature13153'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuituse.c | 33 | ||||
-rw-r--r-- | src/or/or.h | 3 | ||||
-rw-r--r-- | src/or/routerparse.c | 3 |
3 files changed, 16 insertions, 23 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index bd42bd39cb..c1a81520e7 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -2070,7 +2070,7 @@ static void link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ, crypt_path_t *cpath) { - const node_t *exitnode; + const node_t *exitnode = NULL; /* add it into the linked list of streams on this circuit */ log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %u.", @@ -2104,23 +2104,22 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ, circ->isolation_any_streams_attached = 1; connection_edge_update_circuit_isolation(apconn, circ, 0); + /* Compute the exitnode if possible, for logging below */ + if (cpath->extend_info) + exitnode = node_get_by_id(cpath->extend_info->identity_digest); + /* See if we can use optimistic data on this circuit */ - if (cpath->extend_info && - (exitnode = node_get_by_id(cpath->extend_info->identity_digest)) && - exitnode->rs) { - /* Okay; we know what exit node this is. */ - if (optimistic_data_enabled() && - circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL && - exitnode->rs->version_supports_optimistic_data) - apconn->may_use_optimistic_data = 1; - else - apconn->may_use_optimistic_data = 0; - log_info(LD_APP, "Looks like completed circuit to %s %s allow " - "optimistic data for connection to %s", - safe_str_client(node_describe(exitnode)), - apconn->may_use_optimistic_data ? "does" : "doesn't", - safe_str_client(apconn->socks_request->address)); - } + if (optimistic_data_enabled() && + circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL) + apconn->may_use_optimistic_data = 1; + else + apconn->may_use_optimistic_data = 0; + log_info(LD_APP, "Looks like completed circuit to %s %s allow " + "optimistic data for connection to %s", + /* node_describe() does the right thing if exitnode is NULL */ + safe_str_client(node_describe(exitnode)), + apconn->may_use_optimistic_data ? "does" : "doesn't", + safe_str_client(apconn->socks_request->address)); } /** Return true iff <b>address</b> is matched by one of the entries in diff --git a/src/or/or.h b/src/or/or.h index ba7eeea9e6..b2b0d5f7ab 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2149,9 +2149,6 @@ typedef struct routerstatus_t { /** True iff this router is a version that, if it caches directory info, * we can get microdescriptors from. */ unsigned int version_supports_microdesc_cache:1; - /** True iff this router is a version that allows DATA cells to arrive on - * a stream before it has sent a CONNECTED cell. */ - unsigned int version_supports_optimistic_data:1; /** True iff this router has a version that allows it to accept EXTEND2 * cells */ unsigned int version_supports_extend2_cells:1; diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 281341d134..250d1cd062 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1916,12 +1916,9 @@ routerstatus_parse_entry_from_string(memarea_t *area, rs->version_known = 1; if (strcmpstart(tok->args[0], "Tor ")) { rs->version_supports_microdesc_cache = 1; - rs->version_supports_optimistic_data = 1; } else { rs->version_supports_microdesc_cache = tor_version_supports_microdescriptors(tok->args[0]); - rs->version_supports_optimistic_data = - tor_version_as_new_as(tok->args[0], "0.2.3.1-alpha"); rs->version_supports_extend2_cells = tor_version_as_new_as(tok->args[0], "0.2.4.8-alpha"); } |