comparison src/mail/ngx_mail_handler.c @ 486:6484cbba0222 NGINX_0_7_55

nginx 0.7.55 *) Bugfix: the http_XXX parameters in "proxy_cache_use_stale" and "fastcgi_cache_use_stale" directives did not work. *) Bugfix: fastcgi cache did not cache header only responses. *) Bugfix: of "select() failed (9: Bad file descriptor)" error in nginx/Unix and "select() failed (10022: ...)" error in nginx/Windows. *) Bugfix: a segmentation fault might occur in worker process, if an "debug_connection" directive was used; the bug had appeared in 0.7.54. *) Bugfix: fix ngx_http_image_filter_module building errors. *) Bugfix: the files bigger than 2G could not be transferred using $r->sendfile. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Wed, 06 May 2009 00:00:00 +0400
parents 33394d1255b0
children 98143f74eb3d
comparison
equal deleted inserted replaced
485:21824e8058e6 486:6484cbba0222
24 in_addr_t in_addr; 24 in_addr_t in_addr;
25 socklen_t len; 25 socklen_t len;
26 ngx_uint_t i; 26 ngx_uint_t i;
27 struct sockaddr_in sin; 27 struct sockaddr_in sin;
28 ngx_mail_log_ctx_t *ctx; 28 ngx_mail_log_ctx_t *ctx;
29 ngx_mail_in_port_t *imip; 29 ngx_mail_in_port_t *mip;
30 ngx_mail_in_addr_t *imia; 30 ngx_mail_in_addr_t *mia;
31 ngx_mail_session_t *s; 31 ngx_mail_session_t *s;
32 32
33 /* find the server configuration for the address:port */ 33 /* find the server configuration for the address:port */
34 34
35 /* AF_INET only */ 35 /* AF_INET only */
36 36
37 imip = c->listening->servers; 37 mip = c->listening->servers;
38 imia = imip->addrs; 38 mia = mip->addrs;
39 39
40 i = 0; 40 i = 0;
41 41
42 if (imip->naddrs > 1) { 42 if (mip->naddrs > 1) {
43 43
44 /* 44 /*
45 * There are several addresses on this port and one of them 45 * There are several addresses on this port and one of them
46 * is the "*:port" wildcard so getsockname() is needed to determine 46 * is the "*:port" wildcard so getsockname() is needed to determine
47 * the server address. 47 * the server address.
68 in_addr = sin.sin_addr.s_addr; 68 in_addr = sin.sin_addr.s_addr;
69 } 69 }
70 70
71 /* the last address is "*" */ 71 /* the last address is "*" */
72 72
73 for ( /* void */ ; i < imip->naddrs - 1; i++) { 73 for ( /* void */ ; i < mip->naddrs - 1; i++) {
74 if (in_addr == imia[i].addr) { 74 if (in_addr == mia[i].addr) {
75 break; 75 break;
76 } 76 }
77 } 77 }
78 } 78 }
79 79
82 if (s == NULL) { 82 if (s == NULL) {
83 ngx_mail_close_connection(c); 83 ngx_mail_close_connection(c);
84 return; 84 return;
85 } 85 }
86 86
87 s->main_conf = imia[i].ctx->main_conf; 87 s->main_conf = mia[i].ctx->main_conf;
88 s->srv_conf = imia[i].ctx->srv_conf; 88 s->srv_conf = mia[i].ctx->srv_conf;
89 89
90 s->addr_text = &imia[i].addr_text; 90 s->addr_text = &mia[i].addr_text;
91 91
92 c->data = s; 92 c->data = s;
93 s->connection = c; 93 s->connection = c;
94 94
95 ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%ui client %V connected to %V", 95 ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%ui client %V connected to %V",
122 122
123 ngx_mail_ssl_init_connection(&sslcf->ssl, c); 123 ngx_mail_ssl_init_connection(&sslcf->ssl, c);
124 return; 124 return;
125 } 125 }
126 126
127 if (imia[i].ssl) { 127 if (mia[i].ssl) {
128 128
129 c->log->action = "SSL handshaking"; 129 c->log->action = "SSL handshaking";
130 130
131 if (sslcf->ssl.ctx == NULL) { 131 if (sslcf->ssl.ctx == NULL) {
132 ngx_log_error(NGX_LOG_ERR, c->log, 0, 132 ngx_log_error(NGX_LOG_ERR, c->log, 0,