summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-06-07 11:49:03 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-06-07 11:49:03 +0000
commit7fbe27b79f67b44412b061c6ac9b4aaa9f8c1f1a (patch)
tree361749eccb070eda0d6b36d1727e2b41b1a79cab
parent6b2bcfcd0da4bd77d3da7c7266716a2568fe889e (diff)
downloadnginx-7fbe27b79f67b44412b061c6ac9b4aaa9f8c1f1a.tar.gz
merge r3488:
revert partially r1555 and fix the error "memcached sent invalid trailer"
-rw-r--r--src/http/modules/ngx_http_memcached_module.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
index dc7c76719..4b2af10a9 100644
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -423,15 +423,20 @@ ngx_http_memcached_filter(void *data, ssize_t bytes)
if (ngx_strncmp(b->last,
ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
- ctx->rest)
+ bytes)
!= 0)
{
ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
"memcached sent invalid trailer");
+
+ u->length = 0;
+ ctx->rest = 0;
+
+ return NGX_OK;
}
- u->length = 0;
- ctx->rest = 0;
+ u->length -= bytes;
+ ctx->rest -= bytes;
return NGX_OK;
}