Mercurial > hg > nginx-vendor-current
comparison src/http/modules/ngx_http_realip_module.c @ 448:76a79816b771 NGINX_0_7_36
nginx 0.7.36
*) Feature: a preliminary IPv6 support; the "listen" directive of the
HTTP module supports IPv6.
*) Bugfix: the $ancient_browser variable did not work for browsers
preset by a "modern_browser" directives.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Sat, 21 Feb 2009 00:00:00 +0300 |
parents | b246022ef454 |
children | a8424ffa495c |
comparison
equal
deleted
inserted
replaced
447:40964c811e59 | 448:76a79816b771 |
---|---|
11 | 11 |
12 #define NGX_HTTP_REALIP_XREALIP 0 | 12 #define NGX_HTTP_REALIP_XREALIP 0 |
13 #define NGX_HTTP_REALIP_XFWD 1 | 13 #define NGX_HTTP_REALIP_XFWD 1 |
14 #define NGX_HTTP_REALIP_HEADER 2 | 14 #define NGX_HTTP_REALIP_HEADER 2 |
15 | 15 |
16 | |
17 /* AF_INET only */ | |
18 | 16 |
19 typedef struct { | 17 typedef struct { |
20 in_addr_t mask; | 18 in_addr_t mask; |
21 in_addr_t addr; | 19 in_addr_t addr; |
22 } ngx_http_realip_from_t; | 20 } ngx_http_realip_from_t; |
207 | 205 |
208 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "realip: \"%s\"", ip); | 206 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "realip: \"%s\"", ip); |
209 | 207 |
210 /* AF_INET only */ | 208 /* AF_INET only */ |
211 | 209 |
210 if (r->connection->sockaddr->sa_family != AF_INET) { | |
211 return NGX_DECLINED; | |
212 } | |
213 | |
212 sin = (struct sockaddr_in *) c->sockaddr; | 214 sin = (struct sockaddr_in *) c->sockaddr; |
213 | 215 |
214 from = rlcf->from->elts; | 216 from = rlcf->from->elts; |
215 for (i = 0; i < rlcf->from->nelts; i++) { | 217 for (i = 0; i < rlcf->from->nelts; i++) { |
216 | 218 |