Upstream: u->length now defaults to -1 (API change).

That is, by default we assume that response end is signalled by
a connection close.  This seems to be better default, and in line
with u->pipe->length behaviour.

Memcached module was modified accordingly.
This commit is contained in:
Maxim Dounin 2013-07-25 14:58:11 +04:00
parent 187f3948ed
commit 416b922bd2
2 changed files with 5 additions and 2 deletions

View File

@ -441,8 +441,11 @@ ngx_http_memcached_filter_init(void *data)
u = ctx->request->upstream;
if (u->headers_in.status_n != 404) {
u->length += NGX_HTTP_MEMCACHED_END;
u->length = u->headers_in.content_length_n + NGX_HTTP_MEMCACHED_END;
ctx->rest = NGX_HTTP_MEMCACHED_END;
} else {
u->length = 0;
}
return NGX_OK;

View File

@ -1994,7 +1994,7 @@ ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
r->headers_out.content_length_n = u->headers_in.content_length_n;
u->length = u->headers_in.content_length_n;
u->length = -1;
return NGX_OK;
}