chiark / gitweb /
server/admin: Fix client destruction some more.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 14 Dec 2008 22:03:21 +0000 (22:03 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 Dec 2008 22:03:21 +0000 (22:03 +0000)
commit94593d1b0c15761b829f98a804b2ef42a4a84b0a
treedf257d3815fff8172ff535a1bbfa68037573fafe
parent5fb10b44d547dfcb3612b85e7115355301535ca0
server/admin: Fix client destruction some more.

It's possible that finally destroying a client can kill others.  For
example, if the second client (a) has sent EOF, and (b) has a background
command outstanding with the first; then when the first sends EOF, the
second gets taken down too.

Unfortunately, what actually happens in this case is that the newly
defunct clients get put on the dead list -- and then ignored because the
dead list is silently killed at the end of a_destroypending.  Fix by
clearing the list at the top of a_destroypending, and doing the whole
job repeatedly until there are no more cascades.

The change is mostly indenting a loop: it looks less scary with -b.
server/admin.c