summaryrefslogtreecommitdiff
path: root/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sockets.c b/sockets.c
index 64a3e5d..5b4c0c2 100644
--- a/sockets.c
+++ b/sockets.c
@@ -223,8 +223,10 @@ int socksend(SSL *fd, char *buf, int bufsize, int tls) {
if (tls) {
return SSL_write(fd, buf, bufsize);
} else {
+ // Clear errno in case send() errors
+ errno = 0;
// Cast the supposed SSL *fd to a long int if we're not using TLS
- return send((long int)fd, buf, bufsize, 0);
+ return send((long int)fd, buf, bufsize, MSG_NOSIGNAL); // MSG_NOSIGNAL so a bad send() can't SIGPIPE blabouncer
}
}