# HG changeset patch # User Maxim Dounin # Date 1374749891 -14400 # Node ID f538a67c9f770d89efcc5bafeb01acca65a0c043 # Parent b779728b180ce0757f26a72a291db7b2a0e094e4 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. diff -r b779728b180c -r f538a67c9f77 src/http/modules/ngx_http_memcached_module.c --- a/src/http/modules/ngx_http_memcached_module.c Thu Jul 25 14:56:59 2013 +0400 +++ b/src/http/modules/ngx_http_memcached_module.c Thu Jul 25 14:58:11 2013 +0400 @@ -441,8 +441,11 @@ 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; diff -r b779728b180c -r f538a67c9f77 src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c Thu Jul 25 14:56:59 2013 +0400 +++ b/src/http/ngx_http_upstream.c Thu Jul 25 14:58:11 2013 +0400 @@ -1994,7 +1994,7 @@ 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; }