From 6b554b1ec498e1f487426b3ec5bcbff618db1dc6 Mon Sep 17 00:00:00 2001 From: Subodh Iyengar Date: Mon, 8 Aug 2016 17:55:10 -0700 Subject: [PATCH] Add MSG_NOSIGNAL to AsyncSSLSocket Summary: We are definitely not prepared to handle SIGPIPEs, so add MSG_NOSIGNAL to sendmsg of AsyncSSLSocket. This is a problem which exists in openssl as well which calls send with flags = 0. We recently made a change to move the send into our control, so we can now supply the flag Reviewed By: yfeldblum Differential Revision: D3686679 fbshipit-source-id: ff8fe662e62923c25876bdfd516352639505dca6 --- folly/io/async/AsyncSSLSocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp index a326ca5c..b398e31c 100644 --- a/folly/io/async/AsyncSSLSocket.cpp +++ b/folly/io/async/AsyncSSLSocket.cpp @@ -1536,6 +1536,10 @@ int AsyncSSLSocket::bioWrite(BIO* b, const char* in, int inl) { flags = MSG_EOR; } +#ifdef MSG_NOSIGNAL + flags |= MSG_NOSIGNAL; +#endif + auto result = tsslSock->sendSocketMessage(BIO_get_fd(b, nullptr), &msg, flags); BIO_clear_retry_flags(b); -- 2.34.1