diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-04 20:48:30 +0400 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-04 20:48:30 +0400 |
commit | 5ab74625d6b28860a08d64ee808a62508a1491dc (patch) | |
tree | e0d64924d1423f09aa9f420f985add8278121354 /src | |
parent | 48d96ced6ff6cea533d56d0d09129f6632a19e4d (diff) | |
download | nginx-5ab74625d6b28860a08d64ee808a62508a1491dc.tar.gz nginx-5ab74625d6b28860a08d64ee808a62508a1491dc.zip |
Win32: $request_time fixed.
On win32, time_t is 64 bits wide by default, and passing an ngx_msec_int_t
argument for %T format specifier doesn't work. This doesn't manifest itself
on other platforms as time_t and ngx_msec_int_t are usually of the same size.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_log_module.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_variables.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index aa6a3fcee..7eb29b38a 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -780,7 +780,7 @@ ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf, ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec)); ms = ngx_max(ms, 0); - return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000); + return ngx_sprintf(buf, "%T.%03M", (time_t) ms / 1000, ms % 1000); } diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 4138bda42..3ec038aef 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1992,7 +1992,7 @@ ngx_http_variable_request_time(ngx_http_request_t *r, ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec)); ms = ngx_max(ms, 0); - v->len = ngx_sprintf(p, "%T.%03M", ms / 1000, ms % 1000) - p; + v->len = ngx_sprintf(p, "%T.%03M", (time_t) ms / 1000, ms % 1000) - p; v->valid = 1; v->no_cacheable = 0; v->not_found = 0; |