Mercurial > hg > nginx-quic
comparison src/mail/ngx_mail_handler.c @ 2798:268d8d3faa34
axe imap module artifacts
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 May 2009 19:34:59 +0000 |
parents | a59b26eee816 |
children | a96a8c916b0c |
comparison
equal
deleted
inserted
replaced
2797:90422d071d3f | 2798:268d8d3faa34 |
---|---|
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, |