summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2018-10-02 19:46:06 +0300
committerMax Romanov <max.romanov@nginx.com>2018-10-02 19:46:06 +0300
commitcb1b0744930801b6e06d05f788c3e7cb40163167 (patch)
tree63a75980502a04da25836213653a4f0dc2cfe53f /src/nxt_port.c
parentd54d806c52756ab65d61713589029627ffa72c5d (diff)
downloadunit-cb1b0744930801b6e06d05f788c3e7cb40163167.tar.gz
unit-cb1b0744930801b6e06d05f788c3e7cb40163167.tar.bz2
Making port fd blocking on app side and non-blocking in Unit.
This issue was introduced in libunit commit (e0f0cd7d244a). All port sockets in application should be in blocking mode whereas Unit itself operates non-blocking sockets. Having non-blocking sockets in application may cause send error during intensive response packets generation. See https://mailman.nginx.org/pipermail/unit/2018-October/000080.html.
Diffstat (limited to 'src/nxt_port.c')
-rw-r--r--src/nxt_port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nxt_port.c b/src/nxt_port.c
index 3d18fa67..30719ad3 100644
--- a/src/nxt_port.c
+++ b/src/nxt_port.c
@@ -276,6 +276,8 @@ nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
nxt_process_use(task, process, -1);
+ nxt_fd_nonblocking(task, msg->fd);
+
port->pair[0] = -1;
port->pair[1] = msg->fd;
port->max_size = new_port_msg->max_size;