Mercurial > hg > nginx
diff src/http/ngx_http_upstream.c @ 1295:5383f5232364
proxy_store and fastcgi_store were changed,
proxy_store_access and fastcgi_store_access were added
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 13 Jul 2007 08:30:34 +0000 |
parents | 13a4ce6e7f1e |
children | 32cdba6f2ec1 |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c Thu Jul 12 11:35:57 2007 +0000 +++ b/src/http/ngx_http_upstream.c Fri Jul 13 08:30:34 2007 +0000 @@ -372,7 +372,7 @@ cln->data = r; u->cleanup = &cln->handler; - u->store = (u->conf->store != 0); + u->store = (u->conf->store || u->conf->store_lengths); ngx_http_upstream_connect(r, u); } @@ -2029,7 +2029,9 @@ #if !(NGX_WIN32) - if (ngx_change_file_access(temp->data, u->conf->store) == NGX_FILE_ERROR) { + if (ngx_change_file_access(temp->data, u->conf->store_access) + == NGX_FILE_ERROR) + { err = ngx_errno; failed = ngx_change_file_access_n; name = temp->data; @@ -2052,13 +2054,24 @@ err = ngx_errno; failed = ngx_set_file_time_n; name = temp->data; - + goto failed; } } } - ngx_http_map_uri_to_path(r, &path, &root, 0); + if (u->conf->store_lengths == NULL) { + + ngx_http_map_uri_to_path(r, &path, &root, 0); + + } else { + if (ngx_http_script_run(r, &path, u->conf->store_lengths->elts, 0, + u->conf->store_values->elts) + == NULL) + { + return; + } + } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upstream stores \"%s\" to \"%s\"", temp->data, path.data); @@ -2074,8 +2087,8 @@ if (err == NGX_ENOENT) { - err = ngx_create_full_path(path.data, ngx_dir_access(u->conf->store)); - + err = ngx_create_full_path(path.data, + ngx_dir_access(u->conf->store_access)); if (err == 0) { if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) { return;