diff src/imap/ngx_imap_handler.c @ 423:fda5987b188d

nginx-0.0.10-2004-09-13-20:18:09 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 13 Sep 2004 16:18:09 +0000
parents edaefb2a20fc
children da8c5707af39
line wrap: on
line diff
--- 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_ev
 
     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_even
 
     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);