Mercurial > hg > nginx
comparison src/mail/ngx_mail_smtp_handler.c @ 2646:f4aea5b40fd7 stable-0.6
r2483, r2484, r2485, r2487, r2488, r2489, r2491 merge:
bugfixes in reverse resolver and SMTP proxy
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 01 Apr 2009 16:25:12 +0000 |
parents | 4c060e30476b |
children | 62c95a6b143b |
comparison
equal
deleted
inserted
replaced
2645:2baa184412b8 | 2646:f4aea5b40fd7 |
---|---|
10 #include <ngx_mail.h> | 10 #include <ngx_mail.h> |
11 #include <ngx_mail_smtp_module.h> | 11 #include <ngx_mail_smtp_module.h> |
12 | 12 |
13 | 13 |
14 static void ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx); | 14 static void ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx); |
15 static void ngx_mail_smtp_resolve_name(ngx_event_t *rev); | |
15 static void ngx_mail_smtp_resolve_name_handler(ngx_resolver_ctx_t *ctx); | 16 static void ngx_mail_smtp_resolve_name_handler(ngx_resolver_ctx_t *ctx); |
16 static void ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c); | 17 static void ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c); |
17 static void ngx_mail_smtp_invalid_pipelining(ngx_event_t *rev); | 18 static void ngx_mail_smtp_invalid_pipelining(ngx_event_t *rev); |
18 static ngx_int_t ngx_mail_smtp_create_buffer(ngx_mail_session_t *s, | 19 static ngx_int_t ngx_mail_smtp_create_buffer(ngx_mail_session_t *s, |
19 ngx_connection_t *c); | 20 ngx_connection_t *c); |
86 | 87 |
87 | 88 |
88 static void | 89 static void |
89 ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx) | 90 ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx) |
90 { | 91 { |
91 ngx_connection_t *c; | 92 ngx_connection_t *c; |
92 ngx_mail_session_t *s; | 93 ngx_mail_session_t *s; |
93 ngx_mail_core_srv_conf_t *cscf; | |
94 | 94 |
95 s = ctx->data; | 95 s = ctx->data; |
96 c = s->connection; | 96 c = s->connection; |
97 | 97 |
98 if (ctx->state) { | 98 if (ctx->state) { |
128 | 128 |
129 ngx_resolve_addr_done(ctx); | 129 ngx_resolve_addr_done(ctx); |
130 | 130 |
131 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, | 131 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, |
132 "address resolved: %V", &s->host); | 132 "address resolved: %V", &s->host); |
133 | |
134 c->read->handler = ngx_mail_smtp_resolve_name; | |
135 | |
136 ngx_post_event(c->read, &ngx_posted_events); | |
137 } | |
138 | |
139 | |
140 static void | |
141 ngx_mail_smtp_resolve_name(ngx_event_t *rev) | |
142 { | |
143 ngx_connection_t *c; | |
144 ngx_mail_session_t *s; | |
145 ngx_resolver_ctx_t *ctx; | |
146 ngx_mail_core_srv_conf_t *cscf; | |
147 | |
148 c = rev->data; | |
149 s = c->data; | |
133 | 150 |
134 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); | 151 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); |
135 | 152 |
136 ctx = ngx_resolve_start(cscf->resolver, NULL); | 153 ctx = ngx_resolve_start(cscf->resolver, NULL); |
137 if (ctx == NULL) { | 154 if (ctx == NULL) { |