summaryrefslogtreecommitdiff
path: root/src/or/cpuworker.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-04-04 21:46:08 +0000
committerNick Mathewson <nickm@torproject.org>2005-04-04 21:46:08 +0000
commit0fff263a4672809c279800dac01a84f7ab1c84a3 (patch)
treee66b3453acc4a3eb9194402e1e8ec4a6f87f5884 /src/or/cpuworker.c
parent533a3bbe2e84379a654f0f281fea1b9238491002 (diff)
downloadtor-0fff263a4672809c279800dac01a84f7ab1c84a3.tar.gz
tor-0fff263a4672809c279800dac01a84f7ab1c84a3.zip
Fix possible bug on threading platforms with running out of fds do to cpuworkers and dnsworkers.
svn:r4008
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r--src/or/cpuworker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index b6e8ca6c9d..155a875fa6 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -262,7 +262,7 @@ static int cpuworker_main(void *data) {
}
if (write_all(fd, buf, LEN_ONION_RESPONSE, 1) != LEN_ONION_RESPONSE) {
log_fn(LOG_ERR,"writing response buf failed. Exiting.");
- spawn_exit();
+ goto end;
}
log_fn(LOG_DEBUG,"finished writing response.");
}
@@ -272,6 +272,7 @@ static int cpuworker_main(void *data) {
crypto_free_pk_env(onion_key);
if (last_onion_key)
crypto_free_pk_env(last_onion_key);
+ close(fd);
spawn_exit();
return 0; /* windows wants this function to return an int */
}