comparison src/http/modules/ngx_http_autoindex_module.c @ 96:ca4f70b3ccc6 NGINX_0_2_2

nginx 0.2.2 *) Feature: the "config errmsg" command of the ngx_http_ssi_module. *) Change: the ngx_http_geo_module variables can be overridden by the "set" directive. *) Feature: the "ssl_protocols" and "ssl_prefer_server_ciphers" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Bugfix: the ngx_http_autoindex_module did not show correctly the long file names; *) Bugfix: the ngx_http_autoindex_module now do not show the files starting by dot. *) Bugfix: if the SSL handshake failed then another connection may be closed too. Thanks to Rob Mueller. *) Bugfix: the export versions of MSIE 5.x could not connect via HTTPS.
author Igor Sysoev <http://sysoev.ru>
date Fri, 30 Sep 2005 00:00:00 +0400
parents 45945fa8b8ba
children f63280c59dd5
comparison
equal deleted inserted replaced
95:2f95911bc4b4 96:ca4f70b3ccc6
269 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 269 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
270 "http autoindex file: \"%s\"", ngx_de_name(&dir)); 270 "http autoindex file: \"%s\"", ngx_de_name(&dir));
271 271
272 len = ngx_de_namelen(&dir); 272 len = ngx_de_namelen(&dir);
273 273
274 if (len == 1 && ngx_de_name(&dir)[0] == '.') { 274 if (ngx_de_name(&dir)[0] == '.') {
275 continue; 275 continue;
276 } 276 }
277 277
278 if (len == 2
279 && ngx_de_name(&dir)[0] == '.'
280 && ngx_de_name(&dir)[1] == '.')
281 {
282 continue;
283 }
284
285 if (!dir.valid_info) { 278 if (!dir.valid_info) {
286 279
287 if (dname.len + 1 + len > fname.len) { 280 if (dname.len + 1 + len + 1 > fname.len) {
288 fname.len = dname.len + 1 + len + 32; 281 fname.len = dname.len + 1 + len + 1 + 32;
289 282
290 fname.data = ngx_palloc(pool, fname.len); 283 fname.data = ngx_palloc(pool, fname.len);
291 if (fname.data == NULL) { 284 if (fname.data == NULL) {
292 return ngx_http_autoindex_error(r, &dir, dname.data); 285 return ngx_http_autoindex_error(r, &dir, dname.data);
293 } 286 }
466 b->last = ngx_sprintf(b->last, "%19O", entry[i].size); 459 b->last = ngx_sprintf(b->last, "%19O", entry[i].size);
467 } 460 }
468 461
469 } else { 462 } else {
470 if (entry[i].dir) { 463 if (entry[i].dir) {
471 b->last = ngx_cpymem(b->last, " -", sizeof(" -") - 1); 464 b->last = ngx_cpymem(b->last, " -",
465 sizeof(" -") - 1);
472 466
473 } else { 467 } else {
474 length = entry[i].size; 468 length = entry[i].size;
475 469
476 if (length > 1024 * 1024 * 1024 - 1) { 470 if (length > 1024 * 1024 * 1024 - 1) {
496 } 490 }
497 scale = 'K'; 491 scale = 'K';
498 492
499 } else { 493 } else {
500 size = (ngx_int_t) length; 494 size = (ngx_int_t) length;
501 scale = ' '; 495 scale = '\0';
502 } 496 }
503 497
504 b->last = ngx_sprintf(b->last, "%6i", size); 498 if (scale) {
505 499 b->last = ngx_sprintf(b->last, "%6i%c", size, scale);
506 if (scale != ' ') { 500
507 *b->last++ = scale; 501 } else {
502 b->last = ngx_sprintf(b->last, " %6i", size);
508 } 503 }
509 } 504 }
510 } 505 }
511 506
512 *b->last++ = CR; 507 *b->last++ = CR;