From 0fff263a4672809c279800dac01a84f7ab1c84a3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 Apr 2005 21:46:08 +0000 Subject: Fix possible bug on threading platforms with running out of fds do to cpuworkers and dnsworkers. svn:r4008 --- src/or/cpuworker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/or/cpuworker.c') 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 */ } -- cgit v1.2.3-54-g00ecf