diff options
| author | 2012-02-27 15:33:51 +0000 | |
|---|---|---|
| committer | 2012-02-27 15:33:51 +0000 | |
| commit | 79a548fbe8c2dda75ffdd23aba5b66c8ba21964d (patch) | |
| tree | 8f1c580f7b8aa0846a83896a9b0b24e26bfda5f2 /src/kvilib/net/KviSSL.cpp | |
| parent | another compilation fix for win32 (diff) | |
| download | KVIrc-79a548fbe8c2dda75ffdd23aba5b66c8ba21964d.tar.gz KVIrc-79a548fbe8c2dda75ffdd23aba5b66c8ba21964d.tar.bz2 KVIrc-79a548fbe8c2dda75ffdd23aba5b66c8ba21964d.zip | |
fixed #440 for osx; updated INSTALL-Win32.txt for openssl>=1.0
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6078 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/kvilib/net/KviSSL.cpp')
| -rw-r--r-- | src/kvilib/net/KviSSL.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/kvilib/net/KviSSL.cpp b/src/kvilib/net/KviSSL.cpp index a146cc652..dcc1a043c 100644 --- a/src/kvilib/net/KviSSL.cpp +++ b/src/kvilib/net/KviSSL.cpp @@ -40,6 +40,7 @@ #include <stdio.h> #if !(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) + // linux, mac #include <signal.h> #endif @@ -308,9 +309,22 @@ void KviSSL::shutdown() { if(m_pSSL) { - #if !(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) - //avoid to die on a SIGPIPE if the connection has close (SSL_shutdown can call send()) - //see bug #440 + //avoid to die on a SIGPIPE if the connection has close (SSL_shutdown can call send()) + //see bug #440 + + #if defined(COMPILE_ON_OSX) + // SIG_IGN is ignored under osx, need to use sigprocmask + sigset_t x; + sigemptyset (&x); + sigaddset(&x, SIGPIPE); + sigprocmask(SIG_BLOCK, &x, NULL) + + SSL_shutdown(m_pSSL); + + sigprocmask(SIG_UNBLOCK, &x, NULL) + + #elif !(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) + // ignore SIGPIPE signal( SIGPIPE, SIG_IGN ); // At least attempt to shutdown the connection gracefully SSL_shutdown(m_pSSL); |
