Mercurial > hg > nginx-quic
comparison src/http/ngx_http_variables.c @ 1355:3c7c88b7edf8 stable-0.5
r1351 merge:
allow to set $args
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 29 Jul 2007 18:55:24 +0000 |
parents | adb6d251ac92 |
children | 9ca095d36863 |
comparison
equal
deleted
inserted
replaced
1349:50bdde056629 | 1355:3c7c88b7edf8 |
---|---|
10 #include <ngx_http.h> | 10 #include <ngx_http.h> |
11 #include <nginx.h> | 11 #include <nginx.h> |
12 | 12 |
13 | 13 |
14 static ngx_int_t ngx_http_variable_request(ngx_http_request_t *r, | 14 static ngx_int_t ngx_http_variable_request(ngx_http_request_t *r, |
15 ngx_http_variable_value_t *v, uintptr_t data); | |
16 static void ngx_http_variable_request_set(ngx_http_request_t *r, | |
15 ngx_http_variable_value_t *v, uintptr_t data); | 17 ngx_http_variable_value_t *v, uintptr_t data); |
16 static void ngx_http_variable_request_set_size(ngx_http_request_t *r, | 18 static void ngx_http_variable_request_set_size(ngx_http_request_t *r, |
17 ngx_http_variable_value_t *v, uintptr_t data); | 19 ngx_http_variable_value_t *v, uintptr_t data); |
18 static ngx_int_t ngx_http_variable_header(ngx_http_request_t *r, | 20 static ngx_int_t ngx_http_variable_header(ngx_http_request_t *r, |
19 ngx_http_variable_value_t *v, uintptr_t data); | 21 ngx_http_variable_value_t *v, uintptr_t data); |
153 | 155 |
154 { ngx_string("query_string"), NULL, ngx_http_variable_request, | 156 { ngx_string("query_string"), NULL, ngx_http_variable_request, |
155 offsetof(ngx_http_request_t, args), | 157 offsetof(ngx_http_request_t, args), |
156 NGX_HTTP_VAR_NOCACHABLE, 0 }, | 158 NGX_HTTP_VAR_NOCACHABLE, 0 }, |
157 | 159 |
158 { ngx_string("args"), NULL, ngx_http_variable_request, | 160 { ngx_string("args"), |
161 ngx_http_variable_request_set, | |
162 ngx_http_variable_request, | |
159 offsetof(ngx_http_request_t, args), | 163 offsetof(ngx_http_request_t, args), |
160 NGX_HTTP_VAR_NOCACHABLE, 0 }, | 164 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 }, |
161 | 165 |
162 { ngx_string("request_filename"), NULL, | 166 { ngx_string("request_filename"), NULL, |
163 ngx_http_variable_request_filename, 0, | 167 ngx_http_variable_request_filename, 0, |
164 NGX_HTTP_VAR_NOCACHABLE, 0 }, | 168 NGX_HTTP_VAR_NOCACHABLE, 0 }, |
165 | 169 |
499 return NGX_OK; | 503 return NGX_OK; |
500 } | 504 } |
501 | 505 |
502 | 506 |
503 static void | 507 static void |
508 ngx_http_variable_request_set(ngx_http_request_t *r, | |
509 ngx_http_variable_value_t *v, uintptr_t data) | |
510 { | |
511 ngx_str_t *s; | |
512 | |
513 s = (ngx_str_t *) ((char *) r + data); | |
514 | |
515 s->len = v->len; | |
516 s->data = v->data; | |
517 } | |
518 | |
519 | |
520 static void | |
504 ngx_http_variable_request_set_size(ngx_http_request_t *r, | 521 ngx_http_variable_request_set_size(ngx_http_request_t *r, |
505 ngx_http_variable_value_t *v, uintptr_t data) | 522 ngx_http_variable_value_t *v, uintptr_t data) |
506 { | 523 { |
507 ssize_t s, *sp; | 524 ssize_t s, *sp; |
508 ngx_str_t val; | 525 ngx_str_t val; |