diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-01-03 18:06:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-01-03 18:06:51 +0000 |
commit | ead52e0bdcf72d03a51b6f092607591a51fcdb20 (patch) | |
tree | 0ff4213dbea20ea5337d3ee6300011b1e02d7430 /src/or/cpuworker.c | |
parent | c173c4724973fff0fc0d878bc85db2cfc347300f (diff) | |
download | tor-ead52e0bdcf72d03a51b6f092607591a51fcdb20.tar.gz tor-ead52e0bdcf72d03a51b6f092607591a51fcdb20.zip |
Possible fix for task #43: when running on a multithreaded environment (currently only windows), threads should not close opposite sides of their socketpairs, and workers should not call connection_free_all(). This may fix win32 servers.
svn:r3247
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r-- | src/or/cpuworker.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index b1fef2660b..c9ac3ebee4 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -210,7 +210,7 @@ static int cpuworker_main(void *data) { crypto_pk_env_t *onion_key = NULL, *last_onion_key = NULL; fd = fdarray[1]; /* this side is ours */ -#ifndef MS_WINDOWS +#ifndef TOR_IS_MULTITHREADED tor_close_socket(fdarray[0]); /* this is the side of the socketpair the parent uses */ connection_free_all(); /* so the child doesn't hold the parent's fd's open */ #endif @@ -282,7 +282,9 @@ static int spawn_cpuworker(void) { spawn_func(cpuworker_main, (void*)fd); log_fn(LOG_DEBUG,"just spawned a worker."); +#ifndef TOR_IS_MULTITHREADED tor_close_socket(fd[1]); /* we don't need the worker's side of the pipe */ +#endif conn = connection_new(CONN_TYPE_CPUWORKER); |