Mercurial > hg > nginx-vendor-current
comparison src/mail/ngx_mail_handler.c @ 296:2ceaee987f37 NGINX_0_5_18
nginx 0.5.18
*) Feature: the ngx_http_sub_filter_module.
*) Feature: the "$upstream_http_..." variables.
*) Feature: now the $upstream_status and $upstream_response_time
variables keep data about all upstreams before X-Accel-Redirect.
*) Bugfix: a segmentation fault occurred in master process after first
reconfiguration and receiving any signal if nginx was built with
ngx_http_perl_module and perl did not support multiplicity; bug
appeared in 0.5.9.
*) Bugfix: if perl did not support multiplicity, then after
reconfiguration perl code did not work; bug appeared in 0.3.38.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 19 Apr 2007 00:00:00 +0400 |
parents | f745bf973510 |
children | fc223117327f |
comparison
equal
deleted
inserted
replaced
295:65b7ac8795e3 | 296:2ceaee987f37 |
---|---|
295 s->salt.len = ngx_sprintf(s->salt.data, "<%ul.%T@%V>" CRLF, | 295 s->salt.len = ngx_sprintf(s->salt.data, "<%ul.%T@%V>" CRLF, |
296 ngx_random(), ngx_time(), &cscf->server_name) | 296 ngx_random(), ngx_time(), &cscf->server_name) |
297 - s->salt.data; | 297 - s->salt.data; |
298 | 298 |
299 if (s->protocol == NGX_MAIL_POP3_PROTOCOL) { | 299 if (s->protocol == NGX_MAIL_POP3_PROTOCOL) { |
300 s->out.data = ngx_palloc(c->pool, | 300 s->out.data = ngx_palloc(c->pool, |
301 greetings[0].len + 1 + s->salt.len); | 301 greetings[0].len + 1 + s->salt.len); |
302 if (s->out.data == NULL) { | 302 if (s->out.data == NULL) { |
303 ngx_mail_session_internal_server_error(s); | 303 ngx_mail_session_internal_server_error(s); |
304 return; | 304 return; |
305 } | 305 } |
306 | 306 |
307 p = ngx_cpymem(s->out.data, | 307 p = ngx_cpymem(s->out.data, |
308 greetings[0].data, greetings[0].len - 2); | 308 greetings[0].data, greetings[0].len - 2); |
309 *p++ = ' '; | 309 *p++ = ' '; |
310 p = ngx_cpymem(p, s->salt.data, s->salt.len); | 310 p = ngx_cpymem(p, s->salt.data, s->salt.len); |
311 | 311 |
312 s->out.len = p - s->out.data; | 312 s->out.len = p - s->out.data; |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 ngx_add_timer(c->read, cscf->timeout); | 316 ngx_add_timer(c->read, cscf->timeout); |
317 | 317 |
1406 break; | 1406 break; |
1407 | 1407 |
1408 case NGX_SMTP_MAIL: | 1408 case NGX_SMTP_MAIL: |
1409 | 1409 |
1410 if (s->connection->log->log_level >= NGX_LOG_INFO) { | 1410 if (s->connection->log->log_level >= NGX_LOG_INFO) { |
1411 l.len = s->buffer->last - s->buffer->start; | 1411 l.len = s->buffer->last - s->buffer->start; |
1412 l.data = s->buffer->start; | 1412 l.data = s->buffer->start; |
1413 | 1413 |
1414 for (i = 0; i < l.len; i++) { | 1414 for (i = 0; i < l.len; i++) { |
1415 ch = l.data[i]; | 1415 ch = l.data[i]; |
1416 | 1416 |
1417 if (ch != CR && ch != LF) { | 1417 if (ch != CR && ch != LF) { |
1418 continue; | 1418 continue; |
1419 } | 1419 } |
1420 | 1420 |
1421 l.data[i] = ' '; | 1421 l.data[i] = ' '; |
1422 } | 1422 } |
1423 | 1423 |
1424 while (i) { | 1424 while (i) { |
1425 if (l.data[i - 1] != ' ') { | 1425 if (l.data[i - 1] != ' ') { |
1426 break; | 1426 break; |
1427 } | 1427 } |
1428 | 1428 |
1429 i--; | 1429 i--; |
1430 } | 1430 } |
1431 | 1431 |
1432 l.len = i; | 1432 l.len = i; |
1433 | 1433 |
1434 ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, | 1434 ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, |
1435 "client was rejected: \"%V\"", &l); | 1435 "client was rejected: \"%V\"", &l); |
1436 } | 1436 } |
1437 | 1437 |
1438 text = smtp_auth_required; | 1438 text = smtp_auth_required; |
1439 size = sizeof(smtp_auth_required) - 1; | 1439 size = sizeof(smtp_auth_required) - 1; |
1440 break; | 1440 break; |