Mercurial > hg > nginx-ranges
comparison src/http/ngx_http_variables.c @ 322:d16d691432c9 NGINX_0_6_5
nginx 0.6.5
*) Feature: $nginx_version variable.
Thanks to Nick S. Grechukh.
*) Feature: the mail proxy supports AUTHENTICATE in IMAP mode.
Thanks to Maxim Dounin.
*) Feature: the mail proxy supports STARTTLS in SMTP mode.
Thanks to Maxim Dounin.
*) Bugfix: now nginx escapes space in $memcached_key variable.
*) Bugfix: nginx was incorrectly built by Sun Studio on
Solaris/amd64.
Thanks to Jiang Hong.
*) Bugfix: of minor potential bugs.
Thanks to Coverity's Scan.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 23 Jul 2007 00:00:00 +0400 |
parents | 95183808f549 |
children | f7cd062ee035 |
comparison
equal
deleted
inserted
replaced
321:a87830ef6fdd | 322:d16d691432c9 |
---|---|
6 | 6 |
7 #include <ngx_config.h> | 7 #include <ngx_config.h> |
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
9 #include <ngx_event.h> | 9 #include <ngx_event.h> |
10 #include <ngx_http.h> | 10 #include <ngx_http.h> |
11 #include <nginx.h> | |
11 | 12 |
12 | 13 |
13 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, |
14 ngx_http_variable_value_t *v, uintptr_t data); | 15 ngx_http_variable_value_t *v, uintptr_t data); |
15 static void ngx_http_variable_request_set_size(ngx_http_request_t *r, | 16 static void ngx_http_variable_request_set_size(ngx_http_request_t *r, |
64 static ngx_int_t ngx_http_variable_sent_keep_alive(ngx_http_request_t *r, | 65 static ngx_int_t ngx_http_variable_sent_keep_alive(ngx_http_request_t *r, |
65 ngx_http_variable_value_t *v, uintptr_t data); | 66 ngx_http_variable_value_t *v, uintptr_t data); |
66 static ngx_int_t ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r, | 67 static ngx_int_t ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r, |
67 ngx_http_variable_value_t *v, uintptr_t data); | 68 ngx_http_variable_value_t *v, uintptr_t data); |
68 | 69 |
70 static ngx_int_t ngx_http_variable_nginx_version(ngx_http_request_t *r, | |
71 ngx_http_variable_value_t *v, uintptr_t data); | |
69 | 72 |
70 /* | 73 /* |
71 * TODO: | 74 * TODO: |
72 * Apache CGI: AUTH_TYPE, PATH_INFO (null), PATH_TRANSLATED | 75 * Apache CGI: AUTH_TYPE, PATH_INFO (null), PATH_TRANSLATED |
73 * REMOTE_HOST (null), REMOTE_IDENT (null), | 76 * REMOTE_HOST (null), REMOTE_IDENT (null), |
203 { ngx_string("limit_rate"), ngx_http_variable_request_set_size, | 206 { ngx_string("limit_rate"), ngx_http_variable_request_set_size, |
204 ngx_http_variable_request, | 207 ngx_http_variable_request, |
205 offsetof(ngx_http_request_t, limit_rate), | 208 offsetof(ngx_http_request_t, limit_rate), |
206 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 }, | 209 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 }, |
207 | 210 |
211 { ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version, | |
212 0, 0, 0 }, | |
213 | |
208 { ngx_null_string, NULL, NULL, 0, 0, 0 } | 214 { ngx_null_string, NULL, NULL, 0, 0, 0 } |
209 }; | 215 }; |
210 | 216 |
211 | 217 |
212 ngx_http_variable_value_t ngx_http_variable_null_value = | 218 ngx_http_variable_value_t ngx_http_variable_null_value = |
1203 | 1209 |
1204 return NGX_OK; | 1210 return NGX_OK; |
1205 } | 1211 } |
1206 | 1212 |
1207 | 1213 |
1214 static ngx_int_t | |
1215 ngx_http_variable_nginx_version(ngx_http_request_t *r, | |
1216 ngx_http_variable_value_t *v, uintptr_t data) | |
1217 { | |
1218 v->len = sizeof(NGINX_VERSION) - 1; | |
1219 v->valid = 1; | |
1220 v->no_cachable = 0; | |
1221 v->not_found = 0; | |
1222 v->data = (u_char *) NGINX_VERSION; | |
1223 | |
1224 return NGX_OK; | |
1225 } | |
1226 | |
1227 | |
1208 ngx_int_t | 1228 ngx_int_t |
1209 ngx_http_variables_add_core_vars(ngx_conf_t *cf) | 1229 ngx_http_variables_add_core_vars(ngx_conf_t *cf) |
1210 { | 1230 { |
1211 ngx_int_t rc; | 1231 ngx_int_t rc; |
1212 ngx_http_variable_t *v; | 1232 ngx_http_variable_t *v; |