]> git.kaiwu.me - nginx.git/commit
Cache: fixed cache valid slot to reject incorrect statuses.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 18 Apr 2018 13:11:41 +0000 (16:11 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 18 Apr 2018 13:11:41 +0000 (16:11 +0300)
commit8b4c7725d2015637584c4fa66667ad1ced21edb8
treefaa521141d057b9bc9b9ee020b68c03d5c0f8016
parent59d806b56f4898ff9f36027611cbd466ff977958
Cache: fixed cache valid slot to reject incorrect statuses.

Previously, result of ngx_atoi() was assigned to an ngx_uint_t variable,
and errors reported by ngx_atoi() became positive, so the following check
in "status < 100" failed to catch them.  This resulted in the configurations
like "proxy_cache_valid 2xx 30s" being accepted as correct, while they
in fact do nothing.  Changing type to ngx_int_t fixes this, and such
configurations are now properly rejected.
src/http/ngx_http_file_cache.c