diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-09-17 16:37:20 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-09-17 16:37:20 +0300 |
commit | 7458f66ddad9921729bca8131c6d5482c7b57112 (patch) | |
tree | 6b9581ada634943e3612857638339a7f0b83cd60 /src | |
parent | 4bb45250314ad0c26ce7f5578a173340007276de (diff) | |
download | unit-7458f66ddad9921729bca8131c6d5482c7b57112.tar.gz unit-7458f66ddad9921729bca8131c6d5482c7b57112.tar.bz2 |
Fixed non-auto-reset timers.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_conn_read.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/nxt_conn_read.c b/src/nxt_conn_read.c index 98c5e425..7f738de5 100644 --- a/src/nxt_conn_read.c +++ b/src/nxt_conn_read.c @@ -104,18 +104,13 @@ nxt_conn_io_read(nxt_task_t *task, void *obj, void *data) c->socket.read_handler = c->io->read; c->socket.error_handler = state->error_handler; - if (c->read_timer.state == NXT_TIMER_DISABLED - || nxt_fd_event_is_disabled(c->socket.read)) - { - /* Timer may be set or reset. */ - nxt_conn_timer(engine, c, state, &c->read_timer); - - if (nxt_fd_event_is_disabled(c->socket.read)) { - nxt_fd_event_enable_read(engine, &c->socket); - } + if (nxt_fd_event_is_disabled(c->socket.read)) { + nxt_fd_event_enable_read(engine, &c->socket); } - return; + if (state->timer_autoreset || c->read_timer.state == NXT_TIMER_DISABLED) { + nxt_conn_timer(engine, c, state, &c->read_timer); + } } |