comparison src/http/modules/ngx_http_autoindex_module.c @ 390:0b6053502c55 NGINX_0_7_7

nginx 0.7.7 *) Change: now the EAGAIN error returned by connect() is not considered as temporary error. *) Change: now the $ssl_client_cert variable value is a certificate with TAB character intended before each line except first one; an unchanged certificate is available in the $ssl_client_raw_cert variable. *) Feature: the "ask" parameter in the "ssl_verify_client" directive. *) Feature: byte-range processing improvements. Thanks to Maxim Dounin. *) Feature: the "directio" directive. *) Feature: MacOSX 1.5 sendfile() support. *) Bugfix: now in MacOSX and Cygwin locations are tested in case insensitive mode; however, the compare is provided by single-byte locales only. *) Bugfix: mail proxy SSL connections hanged, if select, poll, or /dev/poll methods were used. *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Jul 2008 00:00:00 +0400
parents 984bb0b1399b
children e7dbea1ee115
comparison
equal deleted inserted replaced
389:930e48a26dde 390:0b6053502c55
133 static ngx_int_t 133 static ngx_int_t
134 ngx_http_autoindex_handler(ngx_http_request_t *r) 134 ngx_http_autoindex_handler(ngx_http_request_t *r)
135 { 135 {
136 u_char *last, *filename, scale; 136 u_char *last, *filename, scale;
137 off_t length; 137 off_t length;
138 size_t len, copy, allocated, root; 138 size_t len, utf_len, allocated, root;
139 ngx_tm_t tm; 139 ngx_tm_t tm;
140 ngx_err_t err; 140 ngx_err_t err;
141 ngx_buf_t *b; 141 ngx_buf_t *b;
142 ngx_int_t rc, size; 142 ngx_int_t rc, size;
143 ngx_str_t path; 143 ngx_str_t path;
327 327
328 entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len, 328 entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len,
329 NGX_ESCAPE_HTML); 329 NGX_ESCAPE_HTML);
330 330
331 if (r->utf8) { 331 if (r->utf8) {
332 entry->utf_len = ngx_utf_length(entry->name.data, entry->name.len); 332 entry->utf_len = ngx_utf8_length(entry->name.data, entry->name.len);
333 } else { 333 } else {
334 entry->utf_len = len; 334 entry->utf_len = len;
335 } 335 }
336 336
337 entry->dir = ngx_de_is_dir(&dir); 337 entry->dir = ngx_de_is_dir(&dir);
410 *b->last++ = '"'; 410 *b->last++ = '"';
411 *b->last++ = '>'; 411 *b->last++ = '>';
412 412
413 len = entry[i].utf_len; 413 len = entry[i].utf_len;
414 414
415 if (entry[i].name.len - len) { 415 if (entry[i].name.len != len) {
416 if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) { 416 if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) {
417 copy = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1; 417 utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1;
418 418
419 } else { 419 } else {
420 copy = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; 420 utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN + 1;
421 } 421 }
422 422
423 b->last = ngx_utf_cpystrn(b->last, entry[i].name.data, copy); 423 b->last = ngx_utf8_cpystrn(b->last, entry[i].name.data,
424 utf_len, entry[i].name.len + 1);
424 last = b->last; 425 last = b->last;
425 426
426 } else { 427 } else {
427 b->last = ngx_cpystrn(b->last, entry[i].name.data, 428 b->last = ngx_cpystrn(b->last, entry[i].name.data,
428 NGX_HTTP_AUTOINDEX_NAME_LEN + 1); 429 NGX_HTTP_AUTOINDEX_NAME_LEN + 1);