comparison src/http/modules/ngx_http_realip_module.c @ 668:9fbf3ad94cbf NGINX_1_1_18

nginx 1.1.18 *) Change: keepalive connections are no longer disabled for Safari by default. *) Feature: the $connection_requests variable. *) Feature: $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd and $tcpinfo_rcv_space variables. *) Feature: the "worker_cpu_affinity" directive now works on FreeBSD. *) Feature: the "xslt_param" and "xslt_string_param" directives. Thanks to Samuel Behan. *) Bugfix: in configure tests. Thanks to Piotr Sikora. *) Bugfix: in the ngx_http_xslt_filter_module. *) Bugfix: nginx could not be built on Debian GNU/Hurd.
author Igor Sysoev <http://sysoev.ru>
date Wed, 28 Mar 2012 00:00:00 +0400
parents d0f7a625f27c
children 4dcaf40cc702
comparison
equal deleted inserted replaced
667:e0eabdb2bad1 668:9fbf3ad94cbf
14 #define NGX_HTTP_REALIP_XFWD 1 14 #define NGX_HTTP_REALIP_XFWD 1
15 #define NGX_HTTP_REALIP_HEADER 2 15 #define NGX_HTTP_REALIP_HEADER 2
16 16
17 17
18 typedef struct { 18 typedef struct {
19 in_addr_t mask; 19 ngx_array_t *from; /* array of ngx_in_cidr_t */
20 in_addr_t addr;
21 } ngx_http_realip_from_t;
22
23
24 typedef struct {
25 ngx_array_t *from; /* array of ngx_http_realip_from_t */
26 ngx_uint_t type; 20 ngx_uint_t type;
27 ngx_uint_t hash; 21 ngx_uint_t hash;
28 ngx_str_t header; 22 ngx_str_t header;
29 #if (NGX_HAVE_UNIX_DOMAIN) 23 #if (NGX_HAVE_UNIX_DOMAIN)
30 ngx_uint_t unixsock; /* unsigned unixsock:2; */ 24 ngx_uint_t unixsock; /* unsigned unixsock:2; */
112 size_t len; 106 size_t len;
113 ngx_uint_t i, hash; 107 ngx_uint_t i, hash;
114 ngx_list_part_t *part; 108 ngx_list_part_t *part;
115 ngx_table_elt_t *header; 109 ngx_table_elt_t *header;
116 struct sockaddr_in *sin; 110 struct sockaddr_in *sin;
111 ngx_in_cidr_t *from;
117 ngx_connection_t *c; 112 ngx_connection_t *c;
118 ngx_http_realip_ctx_t *ctx; 113 ngx_http_realip_ctx_t *ctx;
119 ngx_http_realip_from_t *from;
120 ngx_http_realip_loc_conf_t *rlcf; 114 ngx_http_realip_loc_conf_t *rlcf;
121 115
122 ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module); 116 ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);
123 117
124 if (ctx) { 118 if (ctx) {
315 ngx_http_realip_loc_conf_t *rlcf = conf; 309 ngx_http_realip_loc_conf_t *rlcf = conf;
316 310
317 ngx_int_t rc; 311 ngx_int_t rc;
318 ngx_str_t *value; 312 ngx_str_t *value;
319 ngx_cidr_t cidr; 313 ngx_cidr_t cidr;
320 ngx_http_realip_from_t *from; 314 ngx_in_cidr_t *from;
321 315
322 value = cf->args->elts; 316 value = cf->args->elts;
323 317
324 #if (NGX_HAVE_UNIX_DOMAIN) 318 #if (NGX_HAVE_UNIX_DOMAIN)
325 319
330 324
331 #endif 325 #endif
332 326
333 if (rlcf->from == NULL) { 327 if (rlcf->from == NULL) {
334 rlcf->from = ngx_array_create(cf->pool, 2, 328 rlcf->from = ngx_array_create(cf->pool, 2,
335 sizeof(ngx_http_realip_from_t)); 329 sizeof(ngx_in_cidr_t));
336 if (rlcf->from == NULL) { 330 if (rlcf->from == NULL) {
337 return NGX_CONF_ERROR; 331 return NGX_CONF_ERROR;
338 } 332 }
339 } 333 }
340 334