comparison 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
comparison
equal deleted inserted replaced
540:983c48ab79bb 541:b09ee85d0ac8
75 ngx_module_t ngx_imap_proxy_module = { 75 ngx_module_t ngx_imap_proxy_module = {
76 NGX_MODULE_V1, 76 NGX_MODULE_V1,
77 &ngx_imap_proxy_module_ctx, /* module context */ 77 &ngx_imap_proxy_module_ctx, /* module context */
78 ngx_imap_proxy_commands, /* module directives */ 78 ngx_imap_proxy_commands, /* module directives */
79 NGX_IMAP_MODULE, /* module type */ 79 NGX_IMAP_MODULE, /* module type */
80 NULL, /* init master */
80 NULL, /* init module */ 81 NULL, /* init module */
81 NULL /* init process */ 82 NULL, /* init process */
83 NULL, /* init thread */
84 NULL, /* exit thread */
85 NULL, /* exit process */
86 NULL, /* exit master */
87 NGX_MODULE_V1_PADDING
82 }; 88 };
83 89
84 90
85 void 91 void
86 ngx_imap_proxy_init(ngx_imap_session_t *s, ngx_peers_t *peers) 92 ngx_imap_proxy_init(ngx_imap_session_t *s, ngx_peers_t *peers)
99 105
100 p->upstream.peers = peers; 106 p->upstream.peers = peers;
101 p->upstream.log = s->connection->log; 107 p->upstream.log = s->connection->log;
102 p->upstream.log_error = NGX_ERROR_ERR; 108 p->upstream.log_error = NGX_ERROR_ERR;
103 109
110 s->connection->log->action = "in upstream auth state";
111
104 rc = ngx_event_connect_peer(&p->upstream); 112 rc = ngx_event_connect_peer(&p->upstream);
105 113
106 if (rc == NGX_ERROR) { 114 if (rc == NGX_ERROR || rc == NGX_CONNECT_ERROR) {
107 ngx_imap_session_internal_server_error(s); 115 ngx_imap_session_internal_server_error(s);
108 return; 116 return;
109 } 117 }
110 118
111 cscf = ngx_imap_get_module_srv_conf(s, ngx_imap_core_module); 119 cscf = ngx_imap_get_module_srv_conf(s, ngx_imap_core_module);
282 c->write->handler = ngx_imap_proxy_handler; 290 c->write->handler = ngx_imap_proxy_handler;
283 291
284 pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module); 292 pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module);
285 ngx_add_timer(s->connection->read, pcf->timeout); 293 ngx_add_timer(s->connection->read, pcf->timeout);
286 ngx_del_timer(c->read); 294 ngx_del_timer(c->read);
295
296 c->log->action = "proxying";
287 } 297 }
288 } 298 }
289 299
290 300
291 static void 301 static void
405 c->write->handler = ngx_imap_proxy_handler; 415 c->write->handler = ngx_imap_proxy_handler;
406 416
407 pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module); 417 pcf = ngx_imap_get_module_srv_conf(s, ngx_imap_proxy_module);
408 ngx_add_timer(s->connection->read, pcf->timeout); 418 ngx_add_timer(s->connection->read, pcf->timeout);
409 ngx_del_timer(c->read); 419 ngx_del_timer(c->read);
420
421 c->log->action = "proxying";
410 } 422 }
411 } 423 }
412 424
413 425
414 static void 426 static void