summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2012-06-06 13:58:39 -0400
committerAlan Antonuk <alan.antonuk@gmail.com>2012-06-06 18:00:12 -0400
commit815f5215dcf2f0fb487dc89f4ec4f1ef6bfb2ff2 (patch)
tree9e3844a1bc9e1f422086be37ccfbf6afc246430a
parentfe5a35ae194307aef7cd0da2cb5265cbdff005fc (diff)
downloadrabbitmq-c-github-ask-815f5215dcf2f0fb487dc89f4ec4f1ef6bfb2ff2.tar.gz
Set MSG_NOSIGNAL flag to supress SIGPIPE in send()
-rw-r--r--librabbitmq/amqp_connection.c2
-rw-r--r--librabbitmq/amqp_socket.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c
index 561d496..4639b68 100644
--- a/librabbitmq/amqp_connection.c
+++ b/librabbitmq/amqp_connection.c
@@ -413,7 +413,7 @@ int amqp_send_frame(amqp_connection_state_t state,
amqp_e32(out_frame, 3, out_frame_len);
amqp_e8(out_frame, out_frame_len + HEADER_SIZE, AMQP_FRAME_END);
res = send(state->sockfd, out_frame,
- out_frame_len + HEADER_SIZE + FOOTER_SIZE, 0);
+ out_frame_len + HEADER_SIZE + FOOTER_SIZE, MSG_NOSIGNAL);
}
if (res < 0)
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index 6b9486c..909f62d 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -83,7 +83,7 @@ int amqp_send_header(amqp_connection_state_t state) {
AMQP_PROTOCOL_VERSION_MAJOR,
AMQP_PROTOCOL_VERSION_MINOR,
AMQP_PROTOCOL_VERSION_REVISION };
- return send(state->sockfd, (void *)header, 8, 0);
+ return send(state->sockfd, (void *)header, 8, MSG_NOSIGNAL);
}
static amqp_bytes_t sasl_method_name(amqp_sasl_method_enum method) {