summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-06-16 16:26:02 -0400
committerNick Mathewson <nickm@torproject.org>2009-06-16 16:26:02 -0400
commitdf03d6eca8d8bda9afc848f85dd32428826bfc41 (patch)
tree43c23cd10923ec455837e64d489a54d3fe51bd3d /src/or/connection_edge.c
parent0d2976d64b43083e1f036ecca6a8c9634830f0e9 (diff)
parentca8708a9ce3f8e6a4b3aadf2e35edfd2b49c1a2d (diff)
downloadtor-df03d6eca8d8bda9afc848f85dd32428826bfc41.tar.gz
tor-df03d6eca8d8bda9afc848f85dd32428826bfc41.zip
Merge commit 'karsten/bug997-hidservfetch'
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 5600d52aaf..3cd00e2828 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1678,22 +1678,12 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
safe_str(conn->rend_data->onion_address));
rend_client_refetch_v2_renddesc(conn->rend_data);
} else { /* r > 0 */
-/** How long after we receive a hidden service descriptor do we consider
- * it valid? */
-#define NUM_SECONDS_BEFORE_HS_REFETCH (60*15)
- if (now - entry->received < NUM_SECONDS_BEFORE_HS_REFETCH) {
- conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
- log_info(LD_REND, "Descriptor is here and fresh enough. Great.");
- if (connection_ap_handshake_attach_circuit(conn) < 0) {
- if (!conn->_base.marked_for_close)
- connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH);
- return -1;
- }
- } else {
- conn->_base.state = AP_CONN_STATE_RENDDESC_WAIT;
- log_info(LD_REND, "Stale descriptor %s. Re-fetching.",
- safe_str(conn->rend_data->onion_address));
- rend_client_refetch_v2_renddesc(conn->rend_data);
+ conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
+ log_info(LD_REND, "Descriptor is here. Great.");
+ if (connection_ap_handshake_attach_circuit(conn) < 0) {
+ if (!conn->_base.marked_for_close)
+ connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH);
+ return -1;
}
}
return 0;