diff options
author | Max Romanov <max.romanov@nginx.com> | 2019-03-25 14:49:28 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2019-03-25 14:49:28 +0300 |
commit | b96e5fd8481f79935967fed56c71f72d16c59f6b (patch) | |
tree | 8ed50124471d46c9c52fa0e0f747b3d5ea531111 /src/nxt_port_socket.c | |
parent | 6c694d4b47b626918e09d386a7d1f66844f76fd8 (diff) | |
download | unit-b96e5fd8481f79935967fed56c71f72d16c59f6b.tar.gz unit-b96e5fd8481f79935967fed56c71f72d16c59f6b.tar.bz2 |
Turning off port read event state after main process fork.
Master port stores two file descriptors and works as a read port on the master
process side. After a fork, the port switches into write mode and the read
socket closes, but the same event structure is used for the write socket.
However, the inherited structure remained in read state, telling the epoll
engine to use MOD operation instead of ADD. The patch resets read event
state, so the engine may write using proper ADD operation.
Diffstat (limited to 'src/nxt_port_socket.c')
-rw-r--r-- | src/nxt_port_socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c index a426df31..c9b5105b 100644 --- a/src/nxt_port_socket.c +++ b/src/nxt_port_socket.c @@ -566,6 +566,7 @@ void nxt_port_read_close(nxt_port_t *port) { port->socket.read_ready = 0; + port->socket.read = NXT_EVENT_INACTIVE; nxt_socket_close(port->socket.task, port->pair[0]); port->pair[0] = -1; } |