comparison src/mail/ngx_mail_proxy_module.c @ 382:984bb0b1399b NGINX_0_7_3

nginx 0.7.3 *) Change: the "rss" extension MIME type has been changed to "application/rss+xml". *) Change: now the "gzip_vary" directive turned on issues a "Vary: Accept-Encoding" header line for uncompressed responses too. *) Feature: now the "rewrite" directive does a redirect automatically if the "https://" protocol is used. *) Bugfix: the "proxy_pass" directive did not work with the HTTPS protocol; the bug had appeared in 0.6.9.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 Jun 2008 00:00:00 +0400
parents 6639b93e81b2
children ad0a34a8efa6
comparison
equal deleted inserted replaced
381:23d1555141d9 382:984bb0b1399b
251 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user"); 251 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user");
252 252
253 s->connection->log->action = "sending user name to upstream"; 253 s->connection->log->action = "sending user name to upstream";
254 254
255 line.len = sizeof("USER ") - 1 + s->login.len + 2; 255 line.len = sizeof("USER ") - 1 + s->login.len + 2;
256 line.data = ngx_palloc(c->pool, line.len); 256 line.data = ngx_pnalloc(c->pool, line.len);
257 if (line.data == NULL) { 257 if (line.data == NULL) {
258 ngx_mail_proxy_internal_server_error(s); 258 ngx_mail_proxy_internal_server_error(s);
259 return; 259 return;
260 } 260 }
261 261
270 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send pass"); 270 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send pass");
271 271
272 s->connection->log->action = "sending password to upstream"; 272 s->connection->log->action = "sending password to upstream";
273 273
274 line.len = sizeof("PASS ") - 1 + s->passwd.len + 2; 274 line.len = sizeof("PASS ") - 1 + s->passwd.len + 2;
275 line.data = ngx_palloc(c->pool, line.len); 275 line.data = ngx_pnalloc(c->pool, line.len);
276 if (line.data == NULL) { 276 if (line.data == NULL) {
277 ngx_mail_proxy_internal_server_error(s); 277 ngx_mail_proxy_internal_server_error(s);
278 return; 278 return;
279 } 279 }
280 280
367 367
368 s->connection->log->action = "sending LOGIN command to upstream"; 368 s->connection->log->action = "sending LOGIN command to upstream";
369 369
370 line.len = s->tag.len + sizeof("LOGIN ") - 1 370 line.len = s->tag.len + sizeof("LOGIN ") - 1
371 + 1 + NGX_SIZE_T_LEN + 1 + 2; 371 + 1 + NGX_SIZE_T_LEN + 1 + 2;
372 line.data = ngx_palloc(c->pool, line.len); 372 line.data = ngx_pnalloc(c->pool, line.len);
373 if (line.data == NULL) { 373 if (line.data == NULL) {
374 ngx_mail_proxy_internal_server_error(s); 374 ngx_mail_proxy_internal_server_error(s);
375 return; 375 return;
376 } 376 }
377 377
386 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user"); 386 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user");
387 387
388 s->connection->log->action = "sending user name to upstream"; 388 s->connection->log->action = "sending user name to upstream";
389 389
390 line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2; 390 line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2;
391 line.data = ngx_palloc(c->pool, line.len); 391 line.data = ngx_pnalloc(c->pool, line.len);
392 if (line.data == NULL) { 392 if (line.data == NULL) {
393 ngx_mail_proxy_internal_server_error(s); 393 ngx_mail_proxy_internal_server_error(s);
394 return; 394 return;
395 } 395 }
396 396
406 "mail proxy send passwd"); 406 "mail proxy send passwd");
407 407
408 s->connection->log->action = "sending password to upstream"; 408 s->connection->log->action = "sending password to upstream";
409 409
410 line.len = s->passwd.len + 2; 410 line.len = s->passwd.len + 2;
411 line.data = ngx_palloc(c->pool, line.len); 411 line.data = ngx_pnalloc(c->pool, line.len);
412 if (line.data == NULL) { 412 if (line.data == NULL) {
413 ngx_mail_proxy_internal_server_error(s); 413 ngx_mail_proxy_internal_server_error(s);
414 return; 414 return;
415 } 415 }
416 416
503 s->connection->log->action = "sending HELO/EHLO to upstream"; 503 s->connection->log->action = "sending HELO/EHLO to upstream";
504 504
505 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); 505 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
506 506
507 line.len = sizeof("HELO ") - 1 + cscf->server_name.len + 2; 507 line.len = sizeof("HELO ") - 1 + cscf->server_name.len + 2;
508 line.data = ngx_palloc(c->pool, line.len); 508 line.data = ngx_pnalloc(c->pool, line.len);
509 if (line.data == NULL) { 509 if (line.data == NULL) {
510 ngx_mail_proxy_internal_server_error(s); 510 ngx_mail_proxy_internal_server_error(s);
511 return; 511 return;
512 } 512 }
513 513
533 line.len = sizeof("XCLIENT PROTO=SMTP HELO= ADDR= LOGIN= NAME=" 533 line.len = sizeof("XCLIENT PROTO=SMTP HELO= ADDR= LOGIN= NAME="
534 CRLF) - 1 534 CRLF) - 1
535 + s->esmtp + s->smtp_helo.len 535 + s->esmtp + s->smtp_helo.len
536 + s->connection->addr_text.len + s->login.len + s->host.len; 536 + s->connection->addr_text.len + s->login.len + s->host.len;
537 537
538 line.data = ngx_palloc(c->pool, line.len); 538 line.data = ngx_pnalloc(c->pool, line.len);
539 if (line.data == NULL) { 539 if (line.data == NULL) {
540 ngx_mail_proxy_internal_server_error(s); 540 ngx_mail_proxy_internal_server_error(s);
541 return; 541 return;
542 } 542 }
543 543