diff options
author | Roger Dingledine <arma@torproject.org> | 2004-01-06 07:53:40 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-01-06 07:53:40 +0000 |
commit | c485725c5a284b9d08eba3eeab71a97c704351eb (patch) | |
tree | 9b3013b1e4a1e791841e05806498298c868cabe9 /src/or/connection.c | |
parent | 276dae52b5cb02e84205bcbd710ff8fa34d71185 (diff) | |
download | tor-c485725c5a284b9d08eba3eeab71a97c704351eb.tar.gz tor-c485725c5a284b9d08eba3eeab71a97c704351eb.zip |
Fix the dns bug: children weren't dying
We were telling a child to die by closing the parent's file descriptor
to him. But newer children were inheriting the open file descriptor from
the parent, and since they weren't closing them, the socket never closed,
so the child never read eof, so he never knew to exit.
As a side effect to this bug, we were probably failing to properly close
connections to remote hosts, ORs, and OPs, after a dns child was born.
I'm surprised Tor worked at all.
svn:r974
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 5299e8965c..03134d3355 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -128,6 +128,15 @@ void connection_free(connection_t *conn) { free(conn); } +void connection_free_all(void) { + int i, n; + connection_t **carray; + + get_connection_array(&carray,&n); + for(i=0;i<n;i++) + connection_free(carray[i]); +} + int connection_create_listener(char *bindaddress, uint16_t bindport, int type) { struct sockaddr_in bindaddr; /* where to bind */ struct hostent *rent; |