[or-cvs] hidden service client connections were using some of their

Roger Dingledine arma at seul.org
Tue Apr 26 22:36:03 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	rendclient.c 
Log Message:
hidden service client connections were using some of their
60 seconds fetching the hidserv descriptor, which made them
more likely to fail on the first attempt, yet they work fine
on the second. so now give them extra time for the first try.


Index: rendclient.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendclient.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- rendclient.c	2 Apr 2005 22:11:24 -0000	1.83
+++ rendclient.c	26 Apr 2005 22:36:00 -0000	1.84
@@ -382,6 +382,7 @@
 void rend_client_desc_here(char *query) {
   connection_t *conn;
   rend_cache_entry_t *entry;
+  time_t now = time(NULL);
 
   while ((conn = connection_get_by_type_state_rendquery(CONN_TYPE_AP,
                                  AP_CONN_STATE_RENDDESC_WAIT, query))) {
@@ -391,6 +392,13 @@
        * valid entry from before which we should reuse */
       log_fn(LOG_INFO,"Rend desc is usable. Launching circuits.");
       conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
+
+      /* restart their timeout values, so they get a fair shake at
+       * connecting to the hidden service. */
+      conn->timestamp_created = now;
+      conn->timestamp_lastread = now;
+      conn->timestamp_lastwritten = now;
+
       if (connection_ap_handshake_attach_circuit(conn) < 0) {
         /* it will never work */
         log_fn(LOG_WARN,"attaching to a rend circ failed. Closing conn.");



More information about the tor-commits mailing list