revert partially r1555 and fix the error "memcached sent invalid trailer"

This commit is contained in:
Igor Sysoev 2010-04-01 15:16:22 +00:00
parent ee16f19cf6
commit 5a7f376945

View file

@ -432,15 +432,20 @@ ngx_http_memcached_filter(void *data, ssize_t bytes)
if (ngx_strncmp(b->last, if (ngx_strncmp(b->last,
ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest, ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
ctx->rest) bytes)
!= 0) != 0)
{ {
ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
"memcached sent invalid trailer"); "memcached sent invalid trailer");
u->length = 0;
ctx->rest = 0;
return NGX_OK;
} }
u->length = 0; u->length -= bytes;
ctx->rest = 0; ctx->rest -= bytes;
return NGX_OK; return NGX_OK;
} }