comparison src/core/ngx_connection.c @ 574:7858d4f8dec4 NGINX_0_8_39

nginx 0.8.39 *) Bugfix: an inherited "alias" directive worked incorrectly in inclusive location. *) Bugfix: in "alias" with variables and "try_files" directives combination. *) Bugfix: listen unix domain and IPv6 sockets did not inherit while online upgrade. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 31 May 2010 00:00:00 +0400
parents 5c576ea5dbd9
children 016632f0fb18
comparison
equal deleted inserted replaced
573:7cbc7affef15 574:7858d4f8dec4
94 #endif 94 #endif
95 95
96 ls = cycle->listening.elts; 96 ls = cycle->listening.elts;
97 for (i = 0; i < cycle->listening.nelts; i++) { 97 for (i = 0; i < cycle->listening.nelts; i++) {
98 98
99 /* AF_INET only */ 99 ls[i].sockaddr = ngx_palloc(cycle->pool, NGX_SOCKADDRLEN);
100
101 ls[i].sockaddr = ngx_palloc(cycle->pool, sizeof(struct sockaddr_in));
102 if (ls[i].sockaddr == NULL) { 100 if (ls[i].sockaddr == NULL) {
103 return NGX_ERROR; 101 return NGX_ERROR;
104 } 102 }
105 103
106 ls[i].socklen = sizeof(struct sockaddr_in); 104 ls[i].socklen = NGX_SOCKADDRLEN;
107 if (getsockname(ls[i].fd, ls[i].sockaddr, &ls[i].socklen) == -1) { 105 if (getsockname(ls[i].fd, ls[i].sockaddr, &ls[i].socklen) == -1) {
108 ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno, 106 ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
109 "getsockname() of the inherited " 107 "getsockname() of the inherited "
110 "socket #%d failed", ls[i].fd); 108 "socket #%d failed", ls[i].fd);
111 ls[i].ignore = 1; 109 ls[i].ignore = 1;