ngx_parse_time not handling seconds flag properly?

Mike Smith mike at mdms.org
Wed Jan 28 06:29:58 MSK 2009


It looks to me like ngx_parse_time is scaling to seconds when you
don't want it and not scaling when you do. When called from
ngx_conf_set_msec_slot, it scales all msec values up by a factor of
1000, so if I want a timeout of 180ms I actually get a timeout of
180s.

Can anyone comment on this.

Thanks,
Mike

Index: src/core/ngx_parse.c
===================================================================
--- src/core/ngx_parse.c	(.../tags/nginx-0.7.32)	(revision 15961)
+++ src/core/ngx_parse.c	(.../trunk/nginx)	(revision 15961)
@@ -115,7 +115,7 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t sec)
     value = 0;
     total = 0;
     step = sec ? st_start : st_month;
-    scale = sec ? 1 : 1000;
+    scale = sec ? 1000 : 1;

     p = line->data;
     last = p + line->len;





More information about the nginx mailing list