diff src/imap/ngx_imap_proxy_module.c @ 541:b09ee85d0ac8 release-0.1.45

nginx-0.1.45-RELEASE import *) Change: the "ssl_engine" directive was canceled in the ngx_http_ssl_module and now is introduced at global level. *) Bugfix: the responses with SSI subrequests did not transferred via SSL connection. *) Various bug fixes in the IMAP/POP3 proxy.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 08 Sep 2005 14:36:09 +0000
parents 371c1cee100d
children 511a89da35ad
line wrap: on
line diff
--- a/src/imap/ngx_imap_proxy_module.c
+++ b/src/imap/ngx_imap_proxy_module.c
@@ -77,8 +77,14 @@ ngx_module_t  ngx_imap_proxy_module = {
     &ngx_imap_proxy_module_ctx,            /* module context */
     ngx_imap_proxy_commands,               /* module directives */
     NGX_IMAP_MODULE,                       /* module type */
+    NULL,                                  /* init master */
     NULL,                                  /* init module */
-    NULL                                   /* init process */
+    NULL,                                  /* init process */
+    NULL,                                  /* init thread */
+    NULL,                                  /* exit thread */
+    NULL,                                  /* exit process */
+    NULL,                                  /* exit master */
+    NGX_MODULE_V1_PADDING
 };
 
 
@@ -101,9 +107,11 @@ ngx_imap_proxy_init(ngx_imap_session_t *
     p->upstream.log = s->connection->log;
     p->upstream.log_error = NGX_ERROR_ERR;
 
+    s->connection->log->action = "in upstream auth state";
+
     rc = ngx_event_connect_peer(&p->upstream);
 
-    if (rc == NGX_ERROR) {
+    if (rc == NGX_ERROR || rc == NGX_CONNECT_ERROR) {
         ngx_imap_session_internal_server_error(s);
         return;
     }
@@ -284,6 +292,8 @@ ngx_imap_proxy_imap_handler(ngx_event_t 
         pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module);
         ngx_add_timer(s->connection->read, pcf->timeout);
         ngx_del_timer(c->read);
+
+        c->log->action = "proxying";
     }
 }
 
@@ -407,6 +417,8 @@ ngx_imap_proxy_pop3_handler(ngx_event_t 
         pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module);
         ngx_add_timer(s->connection->read, pcf->timeout);
         ngx_del_timer(c->read);
+
+        c->log->action = "proxying";
     }
 }