Mercurial > hg > nginx
diff src/http/modules/ngx_http_memcached_module.c @ 3487:5d2acf153153
revert partially r1555 and fix the error "memcached sent invalid trailer"
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2010 15:16:22 +0000 |
parents | ac9c0380337d |
children | dd1570b6f237 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_memcached_module.c Thu Apr 01 12:45:59 2010 +0000 +++ b/src/http/modules/ngx_http_memcached_module.c Thu Apr 01 15:16:22 2010 +0000 @@ -432,15 +432,20 @@ 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; }