summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_socketpair.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_socketpair.c')
-rw-r--r--src/nxt_socketpair.c17
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;
}
}