Fix intermittent windows failures in TLSProxy tests
authorMatt Caswell <matt@openssl.org>
Fri, 20 May 2016 15:34:24 +0000 (16:34 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 27 May 2016 14:18:54 +0000 (15:18 +0100)
When closing down the socket in s_client Windows will close it immediately
even if there is data in the write buffer still waiting to be sent. This
was causing tests to fail in Msys/Mingw builds because TLSProxy doesn't see
the final CloseNotify.

I have experimented with various ways of doing this "properly" (e.g.
shutting down the socket before closing, setting SO_LINGER etc). I can't
seem to find the "magic" formula that will make Windows do this. Inserting
a short 50ms sleep seems to do the trick...but its not very "nice" so I've
inserted a TODO on this item. Perhaps someone else will have better luck
in figuring this out.

RT#4255

Reviewed-by: Richard Levitte <levitte@openssl.org>

No differences found