From a4516c1e75453dec8a82c77617091b3d1bed8cb0 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 4 Jul 2006 15:59:11 +0000 Subject: backport: fix the "closing wedged cpuworkers" bug. svn:r6718 --- src/or/cpuworker.c | 4 ++++ src/or/dns.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/or') diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index badca3563e..bece3456bc 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -473,6 +473,10 @@ assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type, 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); diff --git a/src/or/dns.c b/src/or/dns.c index ebbc5b75bd..5303ced78a 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -377,6 +377,10 @@ assign_to_dnsworker(connection_t *exitconn) 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); -- cgit v1.2.3-54-g00ecf