Mercurial > hg > nginx-quic
comparison src/http/ngx_http_variables.c @ 1356:739dd59468e3 stable-0.5
r1352 merge:
$is_args
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 29 Jul 2007 18:55:59 +0000 |
parents | 3c7c88b7edf8 |
children | e958b3cab51a 6b81bbc36eaf |
comparison
equal
deleted
inserted
replaced
1355:3c7c88b7edf8 | 1356:739dd59468e3 |
---|---|
38 static ngx_int_t ngx_http_variable_server_addr(ngx_http_request_t *r, | 38 static ngx_int_t ngx_http_variable_server_addr(ngx_http_request_t *r, |
39 ngx_http_variable_value_t *v, uintptr_t data); | 39 ngx_http_variable_value_t *v, uintptr_t data); |
40 static ngx_int_t ngx_http_variable_server_port(ngx_http_request_t *r, | 40 static ngx_int_t ngx_http_variable_server_port(ngx_http_request_t *r, |
41 ngx_http_variable_value_t *v, uintptr_t data); | 41 ngx_http_variable_value_t *v, uintptr_t data); |
42 static ngx_int_t ngx_http_variable_scheme(ngx_http_request_t *r, | 42 static ngx_int_t ngx_http_variable_scheme(ngx_http_request_t *r, |
43 ngx_http_variable_value_t *v, uintptr_t data); | |
44 static ngx_int_t ngx_http_variable_is_args(ngx_http_request_t *r, | |
43 ngx_http_variable_value_t *v, uintptr_t data); | 45 ngx_http_variable_value_t *v, uintptr_t data); |
44 static ngx_int_t ngx_http_variable_document_root(ngx_http_request_t *r, | 46 static ngx_int_t ngx_http_variable_document_root(ngx_http_request_t *r, |
45 ngx_http_variable_value_t *v, uintptr_t data); | 47 ngx_http_variable_value_t *v, uintptr_t data); |
46 static ngx_int_t ngx_http_variable_request_filename(ngx_http_request_t *r, | 48 static ngx_int_t ngx_http_variable_request_filename(ngx_http_request_t *r, |
47 ngx_http_variable_value_t *v, uintptr_t data); | 49 ngx_http_variable_value_t *v, uintptr_t data); |
161 ngx_http_variable_request_set, | 163 ngx_http_variable_request_set, |
162 ngx_http_variable_request, | 164 ngx_http_variable_request, |
163 offsetof(ngx_http_request_t, args), | 165 offsetof(ngx_http_request_t, args), |
164 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 }, | 166 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 }, |
165 | 167 |
168 { ngx_string("is_args"), NULL, ngx_http_variable_is_args, | |
169 0, NGX_HTTP_VAR_NOCACHABLE, 0 }, | |
170 | |
166 { ngx_string("request_filename"), NULL, | 171 { ngx_string("request_filename"), NULL, |
167 ngx_http_variable_request_filename, 0, | 172 ngx_http_variable_request_filename, 0, |
168 NGX_HTTP_VAR_NOCACHABLE, 0 }, | 173 NGX_HTTP_VAR_NOCACHABLE, 0 }, |
169 | 174 |
170 { ngx_string("server_name"), NULL, ngx_http_variable_request, | 175 { ngx_string("server_name"), NULL, ngx_http_variable_request, |
875 return NGX_OK; | 880 return NGX_OK; |
876 } | 881 } |
877 | 882 |
878 | 883 |
879 static ngx_int_t | 884 static ngx_int_t |
885 ngx_http_variable_is_args(ngx_http_request_t *r, | |
886 ngx_http_variable_value_t *v, uintptr_t data) | |
887 { | |
888 v->valid = 1; | |
889 v->no_cachable = 0; | |
890 v->not_found = 0; | |
891 | |
892 if (r->args.len == 0) { | |
893 v->len = 0; | |
894 v->data = NULL; | |
895 return NGX_OK; | |
896 } | |
897 | |
898 v->len = 1; | |
899 v->data = (u_char *) "?"; | |
900 | |
901 return NGX_OK; | |
902 } | |
903 | |
904 | |
905 static ngx_int_t | |
880 ngx_http_variable_document_root(ngx_http_request_t *r, | 906 ngx_http_variable_document_root(ngx_http_request_t *r, |
881 ngx_http_variable_value_t *v, uintptr_t data) | 907 ngx_http_variable_value_t *v, uintptr_t data) |
882 { | 908 { |
883 ngx_str_t path; | 909 ngx_str_t path; |
884 ngx_http_core_loc_conf_t *clcf; | 910 ngx_http_core_loc_conf_t *clcf; |