comparison src/http/modules/ngx_http_autoindex_module.c @ 68:056fd0e5a5a6 NGINX_0_1_34

nginx 0.1.34 *) Bugfix: the worker process may got caught in an endless loop if the big response part were include by SSI. *) Bugfix: the variables set by the "set" directive were not available in SSI. *) Feature: the "autoindex_localtime" directive. *) Bugfix: the empty value of the "proxy_set_header" directive forbids the client request header line passing.
author Igor Sysoev <http://sysoev.ru>
date Thu, 26 May 2005 00:00:00 +0400
parents b55cbf18157e
children b31656313b59
comparison
equal deleted inserted replaced
67:a6f560937e2a 68:056fd0e5a5a6
31 } ngx_http_autoindex_entry_t; 31 } ngx_http_autoindex_entry_t;
32 32
33 33
34 typedef struct { 34 typedef struct {
35 ngx_flag_t enable; 35 ngx_flag_t enable;
36 ngx_flag_t localtime;
36 } ngx_http_autoindex_loc_conf_t; 37 } ngx_http_autoindex_loc_conf_t;
37 38
38 39
39 #define NGX_HTTP_AUTOINDEX_NAME_LEN 50 40 #define NGX_HTTP_AUTOINDEX_NAME_LEN 50
40 41
54 { ngx_string("autoindex"), 55 { ngx_string("autoindex"),
55 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 56 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
56 ngx_conf_set_flag_slot, 57 ngx_conf_set_flag_slot,
57 NGX_HTTP_LOC_CONF_OFFSET, 58 NGX_HTTP_LOC_CONF_OFFSET,
58 offsetof(ngx_http_autoindex_loc_conf_t, enable), 59 offsetof(ngx_http_autoindex_loc_conf_t, enable),
60 NULL },
61
62 { ngx_string("autoindex_localtime"),
63 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
64 ngx_conf_set_flag_slot,
65 NGX_HTTP_LOC_CONF_OFFSET,
66 offsetof(ngx_http_autoindex_loc_conf_t, localtime),
59 NULL }, 67 NULL },
60 68
61 ngx_null_command 69 ngx_null_command
62 }; 70 };
63 71
389 b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len; 397 b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
390 } 398 }
391 399
392 *b->last++ = ' '; 400 *b->last++ = ' ';
393 401
394 ngx_gmtime(entry[i].mtime, &tm); 402 ngx_gmtime(entry[i].mtime + ngx_gmtoff * 60 * alcf->localtime, &tm);
395 403
396 b->last = ngx_sprintf(b->last, "%02d-%s-%d %02d:%02d ", 404 b->last = ngx_sprintf(b->last, "%02d-%s-%d %02d:%02d ",
397 tm.ngx_tm_mday, 405 tm.ngx_tm_mday,
398 months[tm.ngx_tm_mon - 1], 406 months[tm.ngx_tm_mon - 1],
399 tm.ngx_tm_year, 407 tm.ngx_tm_year,
540 if (conf == NULL) { 548 if (conf == NULL) {
541 return NGX_CONF_ERROR; 549 return NGX_CONF_ERROR;
542 } 550 }
543 551
544 conf->enable = NGX_CONF_UNSET; 552 conf->enable = NGX_CONF_UNSET;
553 conf->localtime = NGX_CONF_UNSET;
545 554
546 return conf; 555 return conf;
547 } 556 }
548 557
549 558
552 { 561 {
553 ngx_http_autoindex_loc_conf_t *prev = parent; 562 ngx_http_autoindex_loc_conf_t *prev = parent;
554 ngx_http_autoindex_loc_conf_t *conf = child; 563 ngx_http_autoindex_loc_conf_t *conf = child;
555 564
556 ngx_conf_merge_value(conf->enable, prev->enable, 0); 565 ngx_conf_merge_value(conf->enable, prev->enable, 0);
566 ngx_conf_merge_value(conf->localtime, prev->localtime, 0);
557 567
558 return NGX_CONF_OK; 568 return NGX_CONF_OK;
559 } 569 }