Mercurial > hg > nginx-ranges
diff src/http/modules/ngx_http_dav_module.c @ 376:edf1cb6c328e NGINX_0_7_0
nginx 0.7.0
*) Change: now the 0x00-0x1F, '"' and '\' characters are escaped as
\xXX in an access_log.
Thanks to Maxim Dounin.
*) Change: now nginx allows several "Host" request header line.
*) Feature: the "modified" flag in the "expires" directive.
*) Feature: the $uid_got and $uid_set variables may be used at any
request processing stage.
*) Feature: the $hostname variable.
Thanks to Andrei Nigmatulin.
*) Feature: DESTDIR support.
Thanks to Todd A. Fisher and Andras Voroskoi.
*) Bugfix: a segmentation fault might occur in worker process on Linux,
if keepalive was enabled.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 19 May 2008 00:00:00 +0400 |
parents | babd3d9efb62 |
children | 984bb0b1399b |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_dav_module.c +++ b/src/http/modules/ngx_http_dav_module.c @@ -512,7 +512,7 @@ ngx_http_dav_mkcol_handler(ngx_http_requ static ngx_int_t ngx_http_dav_copy_move_handler(ngx_http_request_t *r) { - u_char *p, *desthost, *last, ch; + u_char *p, *host, *last, ch; size_t len, root; ngx_err_t err; ngx_int_t rc, depth; @@ -520,7 +520,7 @@ ngx_http_dav_copy_move_handler(ngx_http_ ngx_str_t path, uri; ngx_tree_ctx_t tree; ngx_file_info_t fi; - ngx_table_elt_t *host, *dest, *over; + ngx_table_elt_t *dest, *over; ngx_http_dav_copy_ctx_t copy; ngx_http_dav_loc_conf_t *dlcf; @@ -536,9 +536,9 @@ ngx_http_dav_copy_move_handler(ngx_http_ return NGX_HTTP_BAD_REQUEST; } - host = r->headers_in.host; + len = r->headers_in.server.len; - if (host == NULL) { + if (len == 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "client sent no \"Host\" header"); return NGX_HTTP_BAD_REQUEST; @@ -553,7 +553,7 @@ ngx_http_dav_copy_move_handler(ngx_http_ goto invalid_destination; } - desthost = dest->value.data + sizeof("https://") - 1; + host = dest->value.data + sizeof("https://") - 1; } else #endif @@ -564,12 +564,10 @@ ngx_http_dav_copy_move_handler(ngx_http_ goto invalid_destination; } - desthost = dest->value.data + sizeof("http://") - 1; + host = dest->value.data + sizeof("http://") - 1; } - len = r->headers_in.host_name_len; - - if (ngx_strncmp(desthost, host->value.data, len) != 0) { + if (ngx_strncmp(host, r->headers_in.server.data, len) != 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "\"Destination\" URI \"%V\" is handled by " "different repository than the source URI", @@ -579,7 +577,7 @@ ngx_http_dav_copy_move_handler(ngx_http_ last = dest->value.data + dest->value.len; - for (p = desthost + len; p < last; p++) { + for (p = host + len; p < last; p++) { if (*p == '/') { goto destination_done; }