[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Richard Levitte
levitte at openssl.org
Mon Jan 15 17:55:46 UTC 2018
The branch OpenSSL_1_1_0-stable has been updated
via 9556a442188421b109d8c4ff51d34f3981aa25f0 (commit)
from 44e688bca36ab4e1b4cd1cf6710871b7906e7c96 (commit)
- Log -----------------------------------------------------------------
commit 9556a442188421b109d8c4ff51d34f3981aa25f0
Author: Richard Levitte <levitte at openssl.org>
Date: Mon Jan 15 10:40:24 2018 +0100
Fix intermittent Windows and Cygwin failures in s_server
The same kind of failure that has already been observed on the
s_client can sometimes also be observed on s_server, so we need to add
the same kind of 50ms delay as was previously added on s_client.
Ref: git commit cb2e10f257a464c6b475b321dd9e4769df84dbf6:
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Rich Salz <rsalz at openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5079)
(cherry picked from commit d17bdfc26d87097c2c80854fd521b6ecebdf5ebb)
-----------------------------------------------------------------------
Summary of changes:
apps/s_socket.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/apps/s_socket.c b/apps/s_socket.c
index 9988626..e8fc37f 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -178,6 +178,20 @@ int do_server(int *accept_sock, const char *host, const char *port,
break;
}
i = (*cb)(sock, type, context);
+
+ /*
+ * Give the socket time to send its last data before we close it.
+ * No amount of setting SO_LINGER etc on the socket seems to
+ * persuade Windows to send the data before closing the socket...
+ * but sleeping for a short time seems to do it (units in ms)
+ * TODO: Find a better way to do this
+ */
+#if defined(OPENSSL_SYS_WINDOWS)
+ Sleep(50);
+#elif defined(OPENSSL_SYS_CYGWIN)
+ usleep(50000);
+#endif
+
/*
* If we ended with an alert being sent, but still with data in the
* network buffer to be read, then calling BIO_closesocket() will
More information about the openssl-commits
mailing list