From 0292cbbe35cc6296a3128315a9a982fa2aa6832b Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 13 Sep 2004 16:18:09 +0000 Subject: nginx-0.0.10-2004-09-13-20:18:09 import --- src/imap/ngx_imap_handler.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/imap/ngx_imap_handler.c') diff --git a/src/imap/ngx_imap_handler.c b/src/imap/ngx_imap_handler.c index f9e3983a2..6c97416d0 100644 --- a/src/imap/ngx_imap_handler.c +++ b/src/imap/ngx_imap_handler.c @@ -58,7 +58,11 @@ static void ngx_imap_init_session(ngx_event_t *rev) c = rev->data; - /* TODO: timeout */ + if (rev->timedout) { + ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out"); + ngx_imap_close_connection(c); + return; + } if (!(s = ngx_pcalloc(c->pool, sizeof(ngx_imap_session_t)))) { ngx_imap_close_connection(c); @@ -102,7 +106,11 @@ static void ngx_pop3_auth_state(ngx_event_t *rev) ngx_log_debug0(NGX_LOG_DEBUG_IMAP, c->log, 0, "pop3 auth state"); - /* TODO: timeout */ + if (rev->timedout) { + ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out"); + ngx_imap_close_connection(c); + return; + } rc = ngx_pop3_read_command(s); -- cgit v1.2.3