sockfilt.c: Fixed detection of client-side connection close
authorMarc Hoersken <info@marc-hoersken.de>
Sat, 6 Apr 2013 21:09:50 +0000 (23:09 +0200)
committerMarc Hoersken <info@marc-hoersken.de>
Sat, 6 Apr 2013 21:09:50 +0000 (23:09 +0200)
commit4e2ed01a2e7e6995ce96d93ede5f800aea8d1698
treeeccf915bc3648deea2bf8f40bb5ac1d4dddc9a06
parentae4558dbb479f09ea01164b1a0d4ac54ec88b29c
sockfilt.c: Fixed detection of client-side connection close

WINSOCK only:
Since FD_CLOSE is only signaled once, it may trigger at the same
time as FD_READ. Data actually being available makes it impossible
to detect that the connection was closed by checking that recv returns
zero. Another recv attempt could block the connection if it was
not closed. This workaround abuses exceptfds in conjunction with
readfds to signal that the connection has actually closed.
tests/server/sockfilt.c