diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2017-10-02 19:10:20 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2017-10-02 19:10:20 +0300 |
commit | 105dd42bd79f0d499c9ed1f6f973adb6011abaa0 (patch) | |
tree | 6f9e2eb40b3b832e14fec2092d66baecb1b4182c /src/stream/ngx_stream_variables.c | |
parent | e22f5b71fe21bab59883e1e7d96d36490c627a04 (diff) | |
download | nginx-105dd42bd79f0d499c9ed1f6f973adb6011abaa0.tar.gz nginx-105dd42bd79f0d499c9ed1f6f973adb6011abaa0.zip |
Upstream: better handling of invalid headers in cache files.
If cache file is truncated, it is possible that u->process_header()
will return NGX_AGAIN. Added appropriate handling of this case by
changing the error to NGX_HTTP_UPSTREAM_INVALID_HEADER.
Also, added appropriate logging of this and NGX_HTTP_UPSTREAM_INVALID_HEADER
cases at the "crit" level. Note that this will result in duplicate logging
in case of NGX_HTTP_UPSTREAM_INVALID_HEADER. While this is something better
to avoid, it is considered to be an overkill to implement cache-specific
error logging in u->process_header().
Additionally, u->buffer.start is now reset to be able to receive a new
response, and u->cache_status set to MISS to provide the value in the
$upstream_cache_status variable, much like it happens on other cache file
errors detected by ngx_http_file_cache_read(), instead of HIT, which is
believed to be misleading.
Diffstat (limited to 'src/stream/ngx_stream_variables.c')
0 files changed, 0 insertions, 0 deletions