[or-cvs] backport: fix the "closing wedged cpuworkers" bug.

arma at seul.org arma at seul.org
Tue Jul 4 15:59:13 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/tor-011x/tor/src/or

Modified Files:
      Tag: tor-0_1_1-patches
	cpuworker.c dns.c 
Log Message:
backport: fix the "closing wedged cpuworkers" bug.


Index: cpuworker.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v
retrieving revision 1.101.2.1
retrieving revision 1.101.2.2
diff -u -p -d -r1.101.2.1 -r1.101.2.2
--- cpuworker.c	25 Apr 2006 07:31:16 -0000	1.101.2.1
+++ cpuworker.c	4 Jul 2006 15:59:11 -0000	1.101.2.2
@@ -473,6 +473,10 @@ assign_to_cpuworker(connection_t *cpuwor
     tag_pack(tag, circ->p_conn->addr, circ->p_conn->port, circ->p_circ_id);
 
     cpuworker->state = CPUWORKER_STATE_BUSY_ONION;
+    /* touch the lastwritten timestamp, since that's how we check to
+     * see how long it's been since we asked the question, and sometimes
+     * we check before the first call to connection_handle_write(). */
+    cpuworker->timestamp_lastwritten = time(NULL);
     num_cpuworkers_busy++;
 
     connection_write_to_buf((char*)&question_type, 1, cpuworker);

Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.182.2.1
retrieving revision 1.182.2.2
diff -u -p -d -r1.182.2.1 -r1.182.2.2
--- dns.c	18 Apr 2006 03:05:34 -0000	1.182.2.1
+++ dns.c	4 Jul 2006 15:59:11 -0000	1.182.2.2
@@ -377,6 +377,10 @@ assign_to_dnsworker(connection_t *exitco
   tor_free(dnsconn->address);
   dnsconn->address = tor_strdup(exitconn->address);
   dnsconn->state = DNSWORKER_STATE_BUSY;
+  /* touch the lastwritten timestamp, since that's how we check to
+   * see how long it's been since we asked the question, and sometimes
+   * we check before the first call to connection_handle_write(). */
+  dnsconn->timestamp_lastwritten = time(NULL);
   num_dnsworkers_busy++;
 
   len = strlen(dnsconn->address);



More information about the tor-commits mailing list