comparison src/mail/ngx_mail_auth_http_module.c @ 552:c04fa65fe604 NGINX_0_8_22

nginx 0.8.22 *) Feature: the "proxy_bind", "fastcgi_bind", and "memcached_bind" directives. *) Feature: the "access" and the "deny" directives support IPv6. *) Feature: the "set_real_ip_from" directive supports IPv6 addresses in request headers. *) Feature: the "unix:" parameter of the "set_real_ip_from" directive. *) Bugfix: nginx did not delete unix domain socket after configuration testing. *) Bugfix: nginx deleted unix domain socket while online upgrade. *) Bugfix: the "!-x" operator did not work. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault might occur in a worker process, if limit_rate was used in HTTPS server. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault might occur in a worker process while $limit_rate logging. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault might occur in a worker process, if there was no "listen" directive in "server" block; the bug had appeared in 0.8.21.
author Igor Sysoev <http://sysoev.ru>
date Tue, 03 Nov 2009 00:00:00 +0300
parents f39b9e29530d
children daf4847b43ff
comparison
equal deleted inserted replaced
551:c88014f74832 552:c04fa65fe604
10 #include <ngx_event_connect.h> 10 #include <ngx_event_connect.h>
11 #include <ngx_mail.h> 11 #include <ngx_mail.h>
12 12
13 13
14 typedef struct { 14 typedef struct {
15 ngx_peer_addr_t *peer; 15 ngx_addr_t *peer;
16 16
17 ngx_msec_t timeout; 17 ngx_msec_t timeout;
18 18
19 ngx_str_t host_header; 19 ngx_str_t host_header;
20 ngx_str_t uri; 20 ngx_str_t uri;
455 { 455 {
456 u_char *p; 456 u_char *p;
457 time_t timer; 457 time_t timer;
458 size_t len, size; 458 size_t len, size;
459 ngx_int_t rc, port, n; 459 ngx_int_t rc, port, n;
460 ngx_peer_addr_t *peer; 460 ngx_addr_t *peer;
461 struct sockaddr_in *sin; 461 struct sockaddr_in *sin;
462 462
463 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, 463 ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
464 "mail auth http process headers"); 464 "mail auth http process headers");
465 465
762 ngx_destroy_pool(ctx->pool); 762 ngx_destroy_pool(ctx->pool);
763 ngx_mail_session_internal_server_error(s); 763 ngx_mail_session_internal_server_error(s);
764 return; 764 return;
765 } 765 }
766 766
767 peer = ngx_pcalloc(s->connection->pool, sizeof(ngx_peer_addr_t)); 767 peer = ngx_pcalloc(s->connection->pool, sizeof(ngx_addr_t));
768 if (peer == NULL) { 768 if (peer == NULL) {
769 ngx_destroy_pool(ctx->pool); 769 ngx_destroy_pool(ctx->pool);
770 ngx_mail_session_internal_server_error(s); 770 ngx_mail_session_internal_server_error(s);
771 return; 771 return;
772 } 772 }
793 return; 793 return;
794 } 794 }
795 795
796 sin->sin_port = htons((in_port_t) port); 796 sin->sin_port = htons((in_port_t) port);
797 797
798 ctx->addr.data[ctx->addr.len] = '\0'; 798 sin->sin_addr.s_addr = ngx_inet_addr(ctx->addr.data, ctx->addr.len);
799 sin->sin_addr.s_addr = inet_addr((char *) ctx->addr.data);
800 if (sin->sin_addr.s_addr == INADDR_NONE) { 799 if (sin->sin_addr.s_addr == INADDR_NONE) {
801 ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, 800 ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
802 "auth http server %V sent invalid server " 801 "auth http server %V sent invalid server "
803 "address:\"%V\"", 802 "address:\"%V\"",
804 ctx->peer.name, &ctx->addr); 803 ctx->peer.name, &ctx->addr);