[openssl-users] Response from server is lost on close

Michael Wojcik Michael.Wojcik at microfocus.com
Wed Dec 2 23:53:14 UTC 2015


Just to amplify on Jakob's response: the reason that sometimes you see the reply is that sometimes your application manages to get it from the stack before the stack receives and processes the RST from the peer. In the example you provided, there was a 52ms window in which you could have read that response before the RST told the stack to throw it away.

If the conversation is aborting for cause - for example because the peer process exited without reading some received data - then this is the correct behavior. If the peer is causing the RST by mucking around with the SO_LINGER socket option, then the peer application is probably broken. (There are cases where an application might legitimately want to send an RST rather than a FIN, but they're few and far between.)

In any event, you're at the mercy of TCP's semantics. When the conversation is aborted, rather than terminated normally, unprocessed data goes away. That's a Good Thing, because the peer has no way of knowing whether you received it.

As is usually the case with this sort of issue, the real question is what problem are you actually trying to solve? "How can I make TCP behave differently?" is not the right question.

Michael Wojcik
Technology Specialist, Micro Focus



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151202/4491e1c4/attachment.html>


More information about the openssl-users mailing list