diff options
author | Andrei Belov <defan@nginx.com> | 2019-05-30 17:44:29 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-05-30 17:44:29 +0300 |
commit | 4921df052be8437d912f3c60faa9a667890e4498 (patch) | |
tree | 3678c551f148a0d177721597de978c090237f205 /src/nxt_socketpair.c | |
parent | 3b7a7ff2aa5840d4238584410ee1ebc6860fb9c5 (diff) | |
parent | 7da320a93af07765e79c929287704936c431f3cd (diff) | |
download | unit-4921df052be8437d912f3c60faa9a667890e4498.tar.gz unit-4921df052be8437d912f3c60faa9a667890e4498.tar.bz2 |
Merged with the default branch.1.9.0-1
Diffstat (limited to '')
-rw-r--r-- | src/nxt_socketpair.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/nxt_socketpair.c b/src/nxt_socketpair.c index a7396b31..10ea562e 100644 --- a/src/nxt_socketpair.c +++ b/src/nxt_socketpair.c @@ -21,9 +21,9 @@ static ssize_t nxt_sendmsg(nxt_socket_t s, nxt_fd_t fd, nxt_iobuf_t *iob, - nxt_uint_t niob); + nxt_uint_t niob); static ssize_t nxt_recvmsg(nxt_socket_t s, nxt_fd_t *fd, nxt_iobuf_t *iob, - nxt_uint_t niob); + nxt_uint_t niob); nxt_int_t @@ -94,9 +94,14 @@ nxt_socketpair_send(nxt_fd_event_t *ev, nxt_fd_t fd, nxt_iobuf_t *iob, case NXT_EAGAIN: nxt_debug(ev->task, "sendmsg(%d) not ready", ev->fd); - ev->write_ready = 0; + break; - return NXT_AGAIN; + /* + * Returned (at least on OSX) when trying to send many small messages. + */ + case NXT_ENOBUFS: + nxt_debug(ev->task, "sendmsg(%d) no buffers", ev->fd); + break; case NXT_EINTR: nxt_debug(ev->task, "sendmsg(%d) interrupted", ev->fd); @@ -108,6 +113,10 @@ nxt_socketpair_send(nxt_fd_event_t *ev, nxt_fd_t fd, nxt_iobuf_t *iob, return NXT_ERROR; } + + ev->write_ready = 0; + + return NXT_AGAIN; } } |