summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conn_accept.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2018-05-30 18:46:05 +0300
committerIgor Sysoev <igor@sysoev.ru>2018-05-30 18:46:05 +0300
commitff6ca2a82c956807e28bb290efa70e791e1f8f8d (patch)
tree06ac66b0e5c8382d79b203fdf4d717b75f188160 /src/nxt_conn_accept.c
parente54fb892a44705c5d6f81e0351070e368a6b38f1 (diff)
downloadunit-ff6ca2a82c956807e28bb290efa70e791e1f8f8d.tar.gz
unit-ff6ca2a82c956807e28bb290efa70e791e1f8f8d.tar.bz2
Fixed keep-alive hanging after reconfiguration.
Diffstat (limited to 'src/nxt_conn_accept.c')
-rw-r--r--src/nxt_conn_accept.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nxt_conn_accept.c b/src/nxt_conn_accept.c
index a2aaa940..4ad2d02f 100644
--- a/src/nxt_conn_accept.c
+++ b/src/nxt_conn_accept.c
@@ -45,6 +45,7 @@ nxt_listen_event(nxt_task_t *task, nxt_listen_socket_t *ls)
engine = task->thread->engine;
lev->batch = engine->batch;
+ lev->count = 1;
lev->socket.read_work_queue = &engine->accept_work_queue;
lev->socket.read_handler = nxt_conn_listen_handler;
@@ -194,19 +195,23 @@ nxt_conn_accept(nxt_task_t *task, nxt_listen_event_t *lev, nxt_conn_t *c)
nxt_queue_insert_head(&task->thread->engine->idle_connections, &c->link);
+ c->listen = lev;
+ lev->count++;
+ c->socket.data = NULL;
+
c->read_work_queue = lev->work_queue;
c->write_work_queue = lev->work_queue;
if (lev->listen->read_after_accept) {
//c->socket.read_ready = 1;
-// lev->listen->handler(task, c, lev->socket.data);
+// lev->listen->handler(task, c, lev);
nxt_work_queue_add(c->read_work_queue, lev->listen->handler,
- &c->task, c, lev->socket.data);
+ &c->task, c, lev);
} else {
nxt_work_queue_add(c->write_work_queue, lev->listen->handler,
- &c->task, c, lev->socket.data);
+ &c->task, c, lev);
}
next = nxt_conn_accept_next(task, lev);