Full_Name: Howard Chu
Submission from: (NULL) (126.96.36.199)
Submitted by: hyc
During connection setup, there are a couple of places where we perform
operations on a socket and log an error if it fails, but otherwise keep going.
It turns out, if the error is EBADF, eventually this gets back to the event
loop, which always does a clean shutdown on any socket error. We should instead
stop init'ing the socket, and not hand it over to the event loop.
This situation only arose because of a long-standing bug in 3rd party code that
was double-closing an fd. https://github.com/heimdal/heimdal/issues/431
normal situations, none of this can ever occur.
Regardless, tracking this here and committing the debug code we used to track it
down, in case we ever need it again in the future.