Replaced ngx_http_realip_from_t with ngx_in_cidr_t.
Ruslan Ermilov
10 years ago
15 | 15 | |
16 | 16 | |
17 | 17 | typedef struct { |
18 | in_addr_t mask; | |
19 | in_addr_t addr; | |
20 | } ngx_http_realip_from_t; | |
21 | ||
22 | ||
23 | typedef struct { | |
24 | ngx_array_t *from; /* array of ngx_http_realip_from_t */ | |
18 | ngx_array_t *from; /* array of ngx_in_cidr_t */ | |
25 | 19 | ngx_uint_t type; |
26 | 20 | ngx_uint_t hash; |
27 | 21 | ngx_str_t header; |
113 | 107 | ngx_list_part_t *part; |
114 | 108 | ngx_table_elt_t *header; |
115 | 109 | struct sockaddr_in *sin; |
110 | ngx_in_cidr_t *from; | |
116 | 111 | ngx_connection_t *c; |
117 | 112 | ngx_http_realip_ctx_t *ctx; |
118 | ngx_http_realip_from_t *from; | |
119 | 113 | ngx_http_realip_loc_conf_t *rlcf; |
120 | 114 | |
121 | 115 | ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module); |
316 | 310 | ngx_int_t rc; |
317 | 311 | ngx_str_t *value; |
318 | 312 | ngx_cidr_t cidr; |
319 | ngx_http_realip_from_t *from; | |
313 | ngx_in_cidr_t *from; | |
320 | 314 | |
321 | 315 | value = cf->args->elts; |
322 | 316 | |
331 | 325 | |
332 | 326 | if (rlcf->from == NULL) { |
333 | 327 | rlcf->from = ngx_array_create(cf->pool, 2, |
334 | sizeof(ngx_http_realip_from_t)); | |
328 | sizeof(ngx_in_cidr_t)); | |
335 | 329 | if (rlcf->from == NULL) { |
336 | 330 | return NGX_CONF_ERROR; |
337 | 331 | } |