comparison src/http/ngx_http_variables.c @ 244:500a3242dff6 NGINX_0_4_7

nginx 0.4.7 *) Feature: the ngx_http_flv_module. *) Feature: the $request_body_file variable. *) Feature: the "charset" and "source_charset" directives support the variables. *) Bugfix: if an "include" SSI command were before another "include" SSI command with an "wait" parameter, then the "wait" parameter might not work. *) Bugfix: if the "proxy_buffering off" directive was used or while working with memcached the connections might not be closed on timeout. *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, and ppc64.
author Igor Sysoev <http://sysoev.ru>
date Tue, 10 Oct 2006 00:00:00 +0400
parents ff906029dd40
children b52bd034c577
comparison
equal deleted inserted replaced
243:d371c9d33781 244:500a3242dff6
47 static ngx_int_t ngx_http_variable_remote_user(ngx_http_request_t *r, 47 static ngx_int_t ngx_http_variable_remote_user(ngx_http_request_t *r,
48 ngx_http_variable_value_t *v, uintptr_t data); 48 ngx_http_variable_value_t *v, uintptr_t data);
49 static ngx_int_t ngx_http_variable_body_bytes_sent(ngx_http_request_t *r, 49 static ngx_int_t ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
50 ngx_http_variable_value_t *v, uintptr_t data); 50 ngx_http_variable_value_t *v, uintptr_t data);
51 static ngx_int_t ngx_http_variable_request_completion(ngx_http_request_t *r, 51 static ngx_int_t ngx_http_variable_request_completion(ngx_http_request_t *r,
52 ngx_http_variable_value_t *v, uintptr_t data);
53 static ngx_int_t ngx_http_variable_request_body_file(ngx_http_request_t *r,
52 ngx_http_variable_value_t *v, uintptr_t data); 54 ngx_http_variable_value_t *v, uintptr_t data);
53 55
54 static ngx_int_t ngx_http_variable_sent_content_type(ngx_http_request_t *r, 56 static ngx_int_t ngx_http_variable_sent_content_type(ngx_http_request_t *r,
55 ngx_http_variable_value_t *v, uintptr_t data); 57 ngx_http_variable_value_t *v, uintptr_t data);
56 static ngx_int_t ngx_http_variable_sent_content_length(ngx_http_request_t *r, 58 static ngx_int_t ngx_http_variable_sent_content_length(ngx_http_request_t *r,
168 170
169 { ngx_string("request_completion"), NULL, 171 { ngx_string("request_completion"), NULL,
170 ngx_http_variable_request_completion, 172 ngx_http_variable_request_completion,
171 0, 0, 0 }, 173 0, 0, 0 },
172 174
175 { ngx_string("request_body_file"), NULL,
176 ngx_http_variable_request_body_file,
177 0, 0, 0 },
178
173 { ngx_string("sent_http_content_type"), NULL, 179 { ngx_string("sent_http_content_type"), NULL,
174 ngx_http_variable_sent_content_type, 0, 0, 0 }, 180 ngx_http_variable_sent_content_type, 0, 0, 0 },
175 181
176 { ngx_string("sent_http_content_length"), NULL, 182 { ngx_string("sent_http_content_length"), NULL,
177 ngx_http_variable_sent_content_length, 0, 0, 0 }, 183 ngx_http_variable_sent_content_length, 0, 0, 0 },
1132 1138
1133 return NGX_OK; 1139 return NGX_OK;
1134 } 1140 }
1135 1141
1136 1142
1143 static ngx_int_t
1144 ngx_http_variable_request_body_file(ngx_http_request_t *r,
1145 ngx_http_variable_value_t *v, uintptr_t data)
1146 {
1147 if (r->request_body == NULL || r->request_body->temp_file == NULL) {
1148 v->len = 0;
1149 v->valid = 1;
1150 v->no_cachable = 0;
1151 v->not_found = 0;
1152 v->data = (u_char *) "";
1153
1154 return NGX_OK;
1155 }
1156
1157 v->len = r->request_body->temp_file->file.name.len;
1158 v->valid = 1;
1159 v->no_cachable = 0;
1160 v->not_found = 0;
1161 v->data = r->request_body->temp_file->file.name.data;
1162
1163 return NGX_OK;
1164 }
1165
1166
1137 ngx_int_t 1167 ngx_int_t
1138 ngx_http_variables_add_core_vars(ngx_conf_t *cf) 1168 ngx_http_variables_add_core_vars(ngx_conf_t *cf)
1139 { 1169 {
1140 ngx_int_t rc; 1170 ngx_int_t rc;
1141 ngx_http_variable_t *v; 1171 ngx_http_variable_t *v;