diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-10-07 13:30:52 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-10-07 13:30:52 +0000 |
commit | 208eed22101e987a370036fa3851ce81c088c599 (patch) | |
tree | 40f2aa55bb0415eef08415373d380577eb18561f /src/http/ngx_http_variables.c | |
parent | 12b7a12a2d2cbf4a98a23c2d6c0c06ff588d2d70 (diff) | |
download | nginx-release-0.3.0.tar.gz nginx-release-0.3.0.zip |
nginx-0.3.0-RELEASE importrelease-0.3.0
*) Change: the 10-days live time limit of worker process was
eliminated. The limit was introduced because of millisecond timers
overflow.
Diffstat (limited to 'src/http/ngx_http_variables.c')
-rw-r--r-- | src/http/ngx_http_variables.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 214015fe9..7b0d231b7 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -619,8 +619,6 @@ ngx_http_variable_document_root(ngx_http_request_t *r, uintptr_t data) static ngx_http_variable_value_t * ngx_http_variable_request_filename(ngx_http_request_t *r, uintptr_t data) { - u_char *p; - ngx_http_core_loc_conf_t *clcf; ngx_http_variable_value_t *vv; vv = ngx_palloc(r->pool, sizeof(ngx_http_variable_value_t)); @@ -630,29 +628,13 @@ ngx_http_variable_request_filename(ngx_http_request_t *r, uintptr_t data) vv->value = 0; - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - if (!clcf->alias) { - vv->text.len = clcf->root.len + r->uri.len; - vv->text.data = ngx_palloc(r->pool, vv->text.len); - if (vv->text.data == NULL) { - return NULL; - } - - p = ngx_cpymem(vv->text.data, clcf->root.data, clcf->root.len); - ngx_memcpy(p, r->uri.data, r->uri.len + 1); + if (ngx_http_map_uri_to_path(r, &vv->text, 0) == NULL) { + return NULL; + } - } else { - vv->text.len = clcf->root.len + r->uri.len + 2 - clcf->name.len; - vv->text.data = ngx_palloc(r->pool, vv->text.len); - if (vv->text.data == NULL) { - return NULL; - } + /* ngx_http_map_uri_to_path() allocates memory for terminating '\0' */ - p = ngx_cpymem(vv->text.data, clcf->root.data, clcf->root.len); - ngx_memcpy(p, r->uri.data + clcf->name.len, - r->uri.len + 1 - clcf->name.len); - } + vv->text.len--; return vv; } |