diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-09-15 17:33:26 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-09-15 17:33:26 +0100 |
commit | 406864e0875058f9533c861eaf65d956902bdb96 (patch) | |
tree | ccbfb0a0055240e35155cd62fb8622aaab2e0b20 /blabouncer.c | |
parent | 6ba01e9fc9727246f40009824f9d0ea49ba92485 (diff) |
Use global signal(SIGPIPE, SIG_IGN) instead of the send() flag MSG_NOSIGNAL since we can't pass MSG_NOSIGNAL to OpenSSL's SSL_write when using TLS connections.
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c index d6df294..d692d19 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -482,6 +482,9 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) { sigaddset(&sigset, SIGTERM); sigprocmask(SIG_BLOCK, &sigset, &oldset); + // Extra signal handling to ignore SIGPIPE so failing send() and/or SSL_write() doesn't terminate blabouncer with SIGPIPE + signal(SIGPIPE, SIG_IGN); + while (1) { debugprint(DEBUG_FULL, "top of loop, fdmax %d.\n", fdmax); FD_ZERO(&rfds); // clear entries from fd set |