summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-11-12 21:01:01 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-11-12 21:01:01 +0000
commita4859091741f1acce2d4690eca95e9277f10dc44 (patch)
tree1290e8e3283f7829879e01f38cc4bcacdf9ab9cb
parentc8b40a2401a2a5769f957bfa4633fe4db7c9f91e (diff)
downloadnginx-a4859091741f1acce2d4690eca95e9277f10dc44.tar.gz
memcached response was stored in variable with END
-rw-r--r--src/http/ngx_http_upstream.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index c3fc8612c..31468fc7a 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1337,14 +1337,20 @@ ngx_http_upstream_process_header(ngx_event_t *rev)
return;
}
- if (u->buffer.last - u->buffer.pos >= (ssize_t) u->length) {
- if (u->input_filter(u->input_filter_ctx, 0) == NGX_ERROR) {
+ n = u->buffer.last - u->buffer.pos;
+
+ if (n) {
+ u->buffer.last -= n;
+
+ if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
return;
}
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
+ if (u->length == 0) {
+ ngx_http_upstream_finalize_request(r, u, 0);
+ return;
+ }
}
rev->handler = ngx_http_upstream_process_body_in_memory;