comparison src/http/modules/ngx_http_autoindex_module.c @ 126:df17fbafec8f NGINX_0_3_10

nginx 0.3.10 *) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
author Igor Sysoev <http://sysoev.ru>
date Tue, 15 Nov 2005 00:00:00 +0300
parents 408f195b3482
children 36af50a5582d
comparison
equal deleted inserted replaced
125:97504de1f89e 126:df17fbafec8f
96 }; 96 };
97 97
98 98
99 ngx_module_t ngx_http_autoindex_module = { 99 ngx_module_t ngx_http_autoindex_module = {
100 NGX_MODULE_V1, 100 NGX_MODULE_V1,
101 &ngx_http_autoindex_module_ctx, /* module context */ 101 &ngx_http_autoindex_module_ctx, /* module context */
102 ngx_http_autoindex_commands, /* module directives */ 102 ngx_http_autoindex_commands, /* module directives */
103 NGX_HTTP_MODULE, /* module type */ 103 NGX_HTTP_MODULE, /* module type */
104 NULL, /* init master */ 104 NULL, /* init master */
105 ngx_http_autoindex_init, /* init module */ 105 ngx_http_autoindex_init, /* init module */
106 NULL, /* init process */ 106 NULL, /* init process */
246 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err, 246 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
247 ngx_read_dir_n " \"%V\" failed", &path); 247 ngx_read_dir_n " \"%V\" failed", &path);
248 return ngx_http_autoindex_error(r, &dir, &path); 248 return ngx_http_autoindex_error(r, &dir, &path);
249 } 249 }
250 250
251 break; 251 break;
252 } 252 }
253 253
254 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 254 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
255 "http autoindex file: \"%s\"", ngx_de_name(&dir)); 255 "http autoindex file: \"%s\"", ngx_de_name(&dir));
256 256
300 entry = ngx_array_push(&entries); 300 entry = ngx_array_push(&entries);
301 if (entry == NULL) { 301 if (entry == NULL) {
302 return ngx_http_autoindex_error(r, &dir, &path); 302 return ngx_http_autoindex_error(r, &dir, &path);
303 } 303 }
304 304
305 entry->name.len = len; 305 entry->name.len = len;
306 306
307 entry->name.data = ngx_palloc(pool, len + 1); 307 entry->name.data = ngx_palloc(pool, len + 1);
308 if (entry->name.data == NULL) { 308 if (entry->name.data == NULL) {
309 return ngx_http_autoindex_error(r, &dir, &path); 309 return ngx_http_autoindex_error(r, &dir, &path);
310 } 310 }
444 if (entry[i].dir) { 444 if (entry[i].dir) {
445 b->last = ngx_cpymem(b->last, " -", 445 b->last = ngx_cpymem(b->last, " -",
446 sizeof(" -") - 1); 446 sizeof(" -") - 1);
447 } else { 447 } else {
448 b->last = ngx_sprintf(b->last, "%19O", entry[i].size); 448 b->last = ngx_sprintf(b->last, "%19O", entry[i].size);
449 } 449 }
450 450
451 } else { 451 } else {
452 if (entry[i].dir) { 452 if (entry[i].dir) {
453 b->last = ngx_cpymem(b->last, " -", 453 b->last = ngx_cpymem(b->last, " -",
454 sizeof(" -") - 1); 454 sizeof(" -") - 1);
458 458
459 if (length > 1024 * 1024 * 1024 - 1) { 459 if (length > 1024 * 1024 * 1024 - 1) {
460 size = (ngx_int_t) (length / (1024 * 1024 * 1024)); 460 size = (ngx_int_t) (length / (1024 * 1024 * 1024));
461 if ((length % (1024 * 1024 * 1024)) 461 if ((length % (1024 * 1024 * 1024))
462 > (1024 * 1024 * 1024 / 2 - 1)) 462 > (1024 * 1024 * 1024 / 2 - 1))
463 { 463 {
464 size++; 464 size++;
465 } 465 }
466 scale = 'G'; 466 scale = 'G';
467 467
468 } else if (length > 1024 * 1024 - 1) { 468 } else if (length > 1024 * 1024 - 1) {