From 7458f66ddad9921729bca8131c6d5482c7b57112 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 17 Sep 2018 16:37:20 +0300 Subject: Fixed non-auto-reset timers. --- src/nxt_conn_read.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') 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); + } } -- cgit