aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_autoindex_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-05-26 18:12:40 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-05-26 18:12:40 +0000
commit403d2443a38f0df9da01c6649ddfd49ab4b6a7e2 (patch)
tree21383258d4f7718cafe79604aa2af63e993620ab /src/http/modules/ngx_http_autoindex_module.c
parent3144ab6c01a5776947a5cb60e04f1b1ba69ad9e0 (diff)
downloadnginx-403d2443a38f0df9da01c6649ddfd49ab4b6a7e2.tar.gz
nginx-403d2443a38f0df9da01c6649ddfd49ab4b6a7e2.zip
nginx-0.1.34-RELEASE importrelease-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.
Diffstat (limited to 'src/http/modules/ngx_http_autoindex_module.c')
-rw-r--r--src/http/modules/ngx_http_autoindex_module.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index 76c5b0314..96ab81e48 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -33,6 +33,7 @@ typedef struct {
typedef struct {
ngx_flag_t enable;
+ ngx_flag_t localtime;
} ngx_http_autoindex_loc_conf_t;
@@ -58,6 +59,13 @@ static ngx_command_t ngx_http_autoindex_commands[] = {
offsetof(ngx_http_autoindex_loc_conf_t, enable),
NULL },
+ { ngx_string("autoindex_localtime"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+ ngx_conf_set_flag_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_autoindex_loc_conf_t, localtime),
+ NULL },
+
ngx_null_command
};
@@ -391,7 +399,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
*b->last++ = ' ';
- ngx_gmtime(entry[i].mtime, &tm);
+ ngx_gmtime(entry[i].mtime + ngx_gmtoff * 60 * alcf->localtime, &tm);
b->last = ngx_sprintf(b->last, "%02d-%s-%d %02d:%02d ",
tm.ngx_tm_mday,
@@ -542,6 +550,7 @@ ngx_http_autoindex_create_loc_conf(ngx_conf_t *cf)
}
conf->enable = NGX_CONF_UNSET;
+ conf->localtime = NGX_CONF_UNSET;
return conf;
}
@@ -554,6 +563,7 @@ ngx_http_autoindex_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_autoindex_loc_conf_t *conf = child;
ngx_conf_merge_value(conf->enable, prev->enable, 0);
+ ngx_conf_merge_value(conf->localtime, prev->localtime, 0);
return NGX_CONF_OK;
}