diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-03-04 14:06:57 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-03-04 14:06:57 +0000 |
commit | 8184d1b3a72c31e7e6492fc189d687ce85548279 (patch) | |
tree | 34e977c47f852d35117464b3cd5e82253fb4fa04 /src/os/win32/ngx_files.c | |
parent | 7ad4a94eee3e17e073d6e8b638b7bd0a2209d2df (diff) | |
download | nginx-8184d1b3a72c31e7e6492fc189d687ce85548279.tar.gz nginx-8184d1b3a72c31e7e6492fc189d687ce85548279.zip |
nginx-0.1.24-RELEASE importrelease-0.1.24
*) Feature: the ngx_http_ssi_filter_module supports the QUERY_STRING
and DOCUMENT_URI variables.
*) Bugfix: the ngx_http_autoindex_module may some times return the 404
response for existent directory, if this directory was used in
"alias" directive.
*) Bugfix: the ngx_http_ssi_filter_module ran incorrectly for large
responses.
*) Bugfix: the lack of the "Referer" header line was always accounted
as valid referrer.
Diffstat (limited to 'src/os/win32/ngx_files.c')
-rw-r--r-- | src/os/win32/ngx_files.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c index 00d6bbc8e..ce0fdc966 100644 --- a/src/os/win32/ngx_files.c +++ b/src/os/win32/ngx_files.c @@ -174,9 +174,10 @@ ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, ngx_int_t ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool) { - int rc, collision; - u_int num; - u_char *name; + u_char *name; + ngx_int_t rc; + ngx_uint_t collision; + ngx_atomic_uint_t num; if (!(name = ngx_palloc(pool, to->len + 1 + 10 + 1 + sizeof("DELETE")))) { return NGX_ERROR; @@ -188,18 +189,19 @@ ngx_int_t ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, /* mutex_lock() (per cache or single ?) */ - do { + for ( ;; ) { num = ngx_next_temp_number(collision); - ngx_sprintf(name + to->len, ".%010u.DELETE", num); + ngx_sprintf(name + to->len, ".%0muA.DELETE", num); - if (MoveFile((const char *) to->data, (const char *) name) == 0) { - collision = 1; - ngx_log_error(NGX_LOG_ERR, pool->log, ngx_errno, - "MoveFile() failed"); + if (MoveFile((const char *) to->data, (const char *) name) != 0) { + break; } - } while (collision); + collision = 1; + + ngx_log_error(NGX_LOG_ERR, pool->log, ngx_errno, "MoveFile() failed"); + } if (MoveFile((const char *) from->data, (const char *) to->data) == 0) { rc = NGX_ERROR; |