It did close the socket when I reported the bug, not sure how the code was changed since than. I got that from a project I worked at. Adding return looks very close to removing that strange-looking line as in that case the line will not get control and the only difference is what soap_envelope_begin_in does after if blocks. If that's enough please add the change to the project's source code.
Silent closing of socket without sending error response is a bug!
Wrong envelope handling
\@input and "found no \bibdata command"