PROTON-1501: c epoll proactor can raise SIGPIPE

Use MSG_NOSIGNAL flag to send() to prevent SIGPIPE being raised on write to a
broken pipe.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4fd08e09
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4fd08e09
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4fd08e09

Branch: refs/heads/master
Commit: 4fd08e09d3d686e0cbf953ea5e2d3f22c6160598
Parents: c5c2ff1
Author: Alan Conway <[email protected]>
Authored: Mon Jun 12 13:48:39 2017 -0400
Committer: Alan Conway <[email protected]>
Committed: Mon Jun 12 13:48:39 2017 -0400

----------------------------------------------------------------------
 proton-c/src/proactor/epoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4fd08e09/proton-c/src/proactor/epoll.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proactor/epoll.c b/proton-c/src/proactor/epoll.c
index 1f10ca0..c4d0c73 100644
--- a/proton-c/src/proactor/epoll.c
+++ b/proton-c/src/proactor/epoll.c
@@ -889,7 +889,7 @@ static pconnection_t *get_pconnection(pn_connection_t* c) {
 
 // Return true unless error
 static bool pconnection_write(pconnection_t *pc, pn_bytes_t wbuf) {
-  ssize_t n = write(pc->psocket.sockfd, wbuf.start, wbuf.size);
+  ssize_t n = send(pc->psocket.sockfd, wbuf.start, wbuf.size, MSG_NOSIGNAL);
   if (n > 0) {
     pn_connection_driver_write_done(&pc->driver, n);
     if ((size_t) n < wbuf.size) pc->write_blocked = true;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to