aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-15 14:21:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-15 14:21:57 +0100
commit405109fafa0624c6f34b4faffa4c0d4d116dfded (patch)
tree4f6c2d223543bcdd7fad17689ee2cab9eb4907fd /src/libutil
parentaa2f5832f8b282b176f52aca82553fd554326716 (diff)
downloadrspamd-405109fafa0624c6f34b4faffa4c0d4d116dfded.tar.gz
rspamd-405109fafa0624c6f34b4faffa4c0d4d116dfded.zip
Block SIGPIPE for HTTP writing.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/http.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index c2d103b4e..e78a79890 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -581,10 +581,12 @@ rspamd_http_write_helper (struct rspamd_http_connection *conn)
struct rspamd_http_connection_private *priv;
struct iovec *start;
guint niov, i;
+ gint flags = 0;
gsize remain;
gssize r;
GError *err;
struct iovec *cur_iov;
+ struct msghdr msg;
priv = conn->priv;
@@ -613,7 +615,13 @@ rspamd_http_write_helper (struct rspamd_http_connection *conn)
}
}
- r = writev (conn->fd, start, MIN (IOV_MAX, niov));
+ memset (&msg, 0, sizeof (msg));
+ msg.msg_iov = start;
+ msg.msg_iovlen = MIN (IOV_MAX, niov);
+#ifdef MSG_NOSIGNAL
+ flags = MSG_NOSIGNAL;
+#endif
+ r = sendmsg (conn->fd, &msg, flags);
if (r == -1) {
err =