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
This commit is contained in:
Roger Dingledine
2004-01-06 07:53:40 +00:00
parent 276dae52b5
commit c485725c5a
4 changed files with 13 additions and 1 deletions
+1
View File
@@ -126,6 +126,7 @@ int cpuworker_main(void *data) {
close(fdarray[0]); /* this is the side of the socketpair the parent uses */
fd = fdarray[1]; /* this side is ours */
connection_free_all(); /* so the child doesn't hold the parent's fd's open */
for(;;) {