Commit Graph

96 Commits

Author SHA1 Message Date
Roman Arutyunyan
cae1b5d63a Core: reverted prefix-based temp files (a9138c35120d).
The use_temp_path http cache feature is now implemented using a separate temp
hierarchy in cache directory.  Prefix-based temp files are no longer needed.
2015-02-02 21:28:09 +03:00
Roman Arutyunyan
54e14a387f Core: supported directory skipping in ngx_walk_tree().
If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.
2015-02-02 19:38:32 +03:00
Valentin Bartenev
a54e37edda Core: added prefix-based temporary files.
Now, if the "path" parameter is NULL, ngx_create_temp_file() will use
file->name as a predefined file path prefix.
2014-12-26 16:22:54 +03:00
Valentin Bartenev
c07bebdcd1 Unified handling of ngx_create_temp_file() return value.
The original check for NGX_AGAIN was surplus, since the function returns
only NGX_OK or NGX_ERROR.  Now it looks similar to other places.

No functional changes.
2014-12-26 16:22:50 +03:00
Valentin Bartenev
db1532944c Improved check for duplicate path names in ngx_add_path().
The same path names with different "data" context should not be allowed.

In particular it rejects configurations like this:

    proxy_cache_path /var/cache/ keys_zone=one:10m max_size=1g inactive=5m;
    proxy_cache_path /var/cache/ keys_zone=two:20m max_size=4m inactive=30s;
2013-09-16 18:49:23 +04:00
Valentin Bartenev
eb10d8f71e Removed surplus initializations from ngx_conf_set_path_slot().
An instance of ngx_path_t is already zeroed by ngx_pcalloc().
2013-09-16 18:49:22 +04:00
Valentin Bartenev
f0fbcaf098 Use ngx_pcalloc() in ngx_conf_merge_path_value().
It initializes the "data" pointer of ngx_path_t that will be checked after
subsequent changes.
2013-09-16 18:49:10 +04:00
Maxim Dounin
e3cab76758 Backed out f1a91825730a and 7094bd12c1ff.
While ngx_get_full_name() might have a bit more descriptive arguments,
the ngx_conf_full_name() is generally easier to use when parsing
configuration and limits exposure of cycle->prefix / cycle->conf_prefix
details.
2013-08-20 21:11:19 +04:00
Valentin Bartenev
d29d21bade Replaced ngx_conf_full_name() with ngx_get_full_name().
The ngx_get_full_name() function takes more readable arguments list.
2013-08-06 19:58:40 +04:00
Valentin Bartenev
3c5bd34771 Fixed memory leaks in the root and auth_basic_user_file directives.
If a relative path is set by variables, then the ngx_conf_full_name()
function was called while processing requests, which causes allocations
from the cycle pool.

A new function that takes pool as an argument was introduced.
2013-08-06 19:58:40 +04:00
Valentin Bartenev
fac3b341da Fixed handling of ngx_write_fd() and ngx_read_fd() errors.
The ngx_write_fd() and ngx_read_fd() functions return -1 in case of error,
so the incorrect comparison with NGX_FILE_ERROR (which is 0 on windows
platforms) might result in inaccurate error message in the error log.

Also the ngx_errno global variable is being set only if the returned value
is -1.
2012-12-14 15:24:24 +00:00
Andrey Belov
8be233c8f2 Correct plural form for "path" in the whole source base. 2012-09-28 13:49:26 +00:00
Ruslan Ermilov
47a04aaa27 Fixed spelling in multiline C comments. 2012-04-03 07:37:31 +00:00
Maxim Konovalov
f8d59e33f3 Copyright updated. 2012-01-18 15:07:43 +00:00
Igor Sysoev
c2cafadfa5 elimination of reading cache files by cache loader 2011-07-24 19:46:53 +00:00
Igor Sysoev
05b1a8f1e3 ngx_str_set() and ngx_str_null() 2010-05-14 09:56:37 +00:00
Igor Sysoev
d08b65ca61 do not set file time in ngx_copy_file() if the time is -1,
this fixes an issue when file is moved across devices
2010-03-30 14:15:25 +00:00
Igor Sysoev
a75362dcdb fix Win32 error message when an temporary file replaces an existent file:
return at once if ngx_win32_rename_file() was not failed
and do not try to delete already the renamed temporary file
2009-12-17 10:05:39 +00:00
Igor Sysoev
44be39475c fix Win32 error messages when an temporary file replaces an existent file:
*) do not rename an already renamed file
*) now ngx_win32_rename_file() returns error code
*) do not log failure inside ngx_win32_rename_file()
2009-12-15 13:47:02 +00:00
Igor Sysoev
3f438068eb ignore EACCES errors for top level directories in ngx_create_full_path() 2009-10-14 11:46:09 +00:00
Igor Sysoev
d0188e09af do not create Win32 drive letter in ngx_create_full_path() 2009-10-14 11:36:16 +00:00
Igor Sysoev
3a58935936 *) share temporary number between workers
*) randomize collision offset
2009-08-21 09:06:35 +00:00
Igor Sysoev
f95847d0ba test EXDEV after path creation 2009-08-20 15:53:57 +00:00
Igor Sysoev
0ddc1978ee fix copy failure logging and stale files removal, introduced in r3025 2009-08-20 13:41:32 +00:00
Igor Sysoev
9db33c9234 fix copy destination name length, introduced in r3025 2009-08-20 13:37:26 +00:00
Igor Sysoev
aa4bba5298 fix building on 64-bit platforms, introduced in r3025 2009-08-13 13:48:41 +00:00
Igor Sysoev
b7a09c5523 allow cross device temporary files atomic copying:
*) ngx_copy_file()
*) delete ngx_ext_rename_file_t.log_rename_error and .rename_error fields
2009-08-12 12:05:33 +00:00
Igor Sysoev
c9538c069f NGX_ENOPATH 2009-08-11 14:25:04 +00:00
Igor Sysoev
4413fad0db cache loader process 2009-08-10 13:27:14 +00:00
Igor Sysoev
65105aaae3 Win32 returns ERROR_PATH_NOT_FOUND instead of ERROR_FILE_NOT_FOUND 2009-05-28 15:32:22 +00:00
Igor Sysoev
ef919756d9 uniform ngx_file_info() interface with ngx_fd_info() 2009-04-29 19:28:52 +00:00
Igor Sysoev
19298ec1d3 introduce cache manager instead of cache cleaner 2009-03-30 07:45:55 +00:00
Igor Sysoev
52859f2f13 a prelimiary proxy cache support 2009-03-23 13:14:51 +00:00
Igor Sysoev
1f4220ee86 small optimization: " == NGX_ERROR" > " != NGX_OK" 2009-02-24 10:42:23 +00:00
Igor Sysoev
524f54f56d use ngx_ext_rename_file() for single file MOVE 2008-12-10 14:53:45 +00:00
Igor Sysoev
7f6b2ffc60 *) back out r2040
*) refactor ngx_palloc()
*) introduce ngx_pnalloc()
*) additional pool blocks have smaller header
2008-06-17 15:00:30 +00:00
Igor Sysoev
34cec29e0c C++ compatibility 2008-03-03 16:32:16 +00:00
Igor Sysoev
501fc74854 transform ngx_create_path_and_rename_file() to ngx_ext_rename_file() 2008-01-03 22:16:37 +00:00
Igor Sysoev
9461d6e09e comment ngx_walk_tree() 2007-12-18 18:04:37 +00:00
Igor Sysoev
00cbb8a16e ngx_create_hashed_filename() does not need ngx_file_t 2007-12-17 21:29:34 +00:00
Igor Sysoev
3b112b8c21 create the only cleanup 2007-12-17 21:23:05 +00:00
Igor Sysoev
86ef6aaa6b move condition declarations inside blocks where they are used 2007-12-10 12:09:51 +00:00
Igor Sysoev
e9af690e61 ngx_create_path_and_rename_file() 2007-12-07 20:22:03 +00:00
Igor Sysoev
a1df416d65 --sysconfdir=DIR 2007-07-29 18:05:45 +00:00
Igor Sysoev
b1ccbdad7b fix potential double free(),
found by Coverity's Scan
2007-07-19 19:11:57 +00:00
Igor Sysoev
fbd9b4399f proxy_store and fastcgi_store were changed,
proxy_store_access and fastcgi_store_access were added
2007-07-13 08:30:34 +00:00
Igor Sysoev
58feb53eb4 proxy_store and fastcgi_store 2007-07-12 11:19:05 +00:00
Igor Sysoev
d1a0ee7fc7 allocate less memory on 64-bit platforms 2007-01-29 20:33:51 +00:00
Igor Sysoev
b8bfa20c91 shorten temporary names on 64-bit platforms 2007-01-29 20:28:00 +00:00
Igor Sysoev
cd5b99a045 undo "client_body_in_file_only any"
and introduce "client_body_in_file_only clean"

introduce ngx_pool_delete_file() to not break a possible third-party
ngx_pool_cleanup_file() usage that may lead to an removal of the useful files

delete unnecessary ngx_http_finalize_request_body()
2007-01-25 08:45:04 +00:00