diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-04-01 15:16:22 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-04-01 15:16:22 +0000 |
commit | 6bdcc58a9cf60db8ea87716f97496319f21631e1 (patch) | |
tree | 152bfc9b27f1d6bad88ddca403494c8c3ee0f5e4 /src/http/modules/ngx_http_memcached_module.c | |
parent | 170a54f326ff6d49058dcc4e4b5dcf36bcbb134a (diff) | |
download | nginx-6bdcc58a9cf60db8ea87716f97496319f21631e1.tar.gz nginx-6bdcc58a9cf60db8ea87716f97496319f21631e1.zip |
revert partially r1555 and fix the error "memcached sent invalid trailer"
Diffstat (limited to 'src/http/modules/ngx_http_memcached_module.c')
-rw-r--r-- | src/http/modules/ngx_http_memcached_module.c | 11 |
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 2dae38a4b..090a285d3 100644 --- a/src/http/modules/ngx_http_memcached_module.c +++ b/src/http/modules/ngx_http_memcached_module.c @@ -432,15 +432,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; } |