diff options
| author | 2009-05-09 08:46:55 +0000 | |
|---|---|---|
| committer | 2009-05-09 08:46:55 +0000 | |
| commit | c4820dfabccf20cfb702661139574f5bf943652e (patch) | |
| tree | 12115683cd322733df7c444baedc78c10be1f0d2 /src | |
| parent | updating FSF address, part 2, thanks to Kebianizao again (diff) | |
| download | KVIrc-c4820dfabccf20cfb702661139574f5bf943652e.tar.gz KVIrc-c4820dfabccf20cfb702661139574f5bf943652e.tar.bz2 KVIrc-c4820dfabccf20cfb702661139574f5bf943652e.zip | |
probable patch for #440, needs testing
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3203 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvilib/net/kvi_ssl.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kvilib/net/kvi_ssl.cpp b/src/kvilib/net/kvi_ssl.cpp index ba764d7c3..5549201b5 100644 --- a/src/kvilib/net/kvi_ssl.cpp +++ b/src/kvilib/net/kvi_ssl.cpp @@ -39,6 +39,10 @@ #include <stdio.h> +#if !(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) + #include <signal.h> +#endif + static bool g_bSSLInitialized = false; static KviMutex * g_pSSLMutex = 0; @@ -285,8 +289,18 @@ 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 + signal( SIGPIPE, SIG_IGN ); + // At least attempt to shutdown the connection gracefully + SSL_shutdown(m_pSSL); + //restore normal SIGPIPE behaviour. + signal( SIGPIPE, SIG_DFL ); + #else // At least attempt to shutdown the connection gracefully SSL_shutdown(m_pSSL); + #endif SSL_free(m_pSSL); m_pSSL = 0; } |
