mirror of
https://github.com/nginx/nginx.git
synced 2024-12-01 03:03:59 +08:00
fix handling cached HTTP/0.9 response
This commit is contained in:
parent
a1b92a9659
commit
601ab90cd4
@ -338,7 +338,7 @@ ngx_http_file_cache_read(ngx_http_request_t *r, ngx_http_cache_t *c)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((size_t) n <= c->header_start) {
|
if ((size_t) n < c->header_start) {
|
||||||
ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
|
ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
|
||||||
"cache file \"%s\" is too small", c->file.name.data);
|
"cache file \"%s\" is too small", c->file.name.data);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
@ -752,6 +752,11 @@ ngx_http_upstream_cache_send(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
r->cached = 1;
|
r->cached = 1;
|
||||||
c = r->cache;
|
c = r->cache;
|
||||||
|
|
||||||
|
if (c->header_start == c->body_start) {
|
||||||
|
r->http_version = NGX_HTTP_VERSION_9;
|
||||||
|
return ngx_http_cache_send(r);
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: cache stack */
|
/* TODO: cache stack */
|
||||||
|
|
||||||
u->buffer = *c->buf;
|
u->buffer = *c->buf;
|
||||||
|
Loading…
Reference in New Issue
Block a user