From: Subodh Iyengar Date: Tue, 9 Aug 2016 00:55:10 +0000 (-0700) Subject: Add MSG_NOSIGNAL to AsyncSSLSocket X-Git-Tag: v2016.08.15.00~37 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6b554b1ec498e1f487426b3ec5bcbff618db1dc6;p=folly.git 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 --- 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);