comparison 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
comparison
equal deleted inserted replaced
3486:5d28d30ba1b1 3487:5d2acf153153
430 430
431 if (u->length == ctx->rest) { 431 if (u->length == ctx->rest) {
432 432
433 if (ngx_strncmp(b->last, 433 if (ngx_strncmp(b->last,
434 ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest, 434 ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
435 ctx->rest) 435 bytes)
436 != 0) 436 != 0)
437 { 437 {
438 ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, 438 ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
439 "memcached sent invalid trailer"); 439 "memcached sent invalid trailer");
440
441 u->length = 0;
442 ctx->rest = 0;
443
444 return NGX_OK;
440 } 445 }
441 446
442 u->length = 0; 447 u->length -= bytes;
443 ctx->rest = 0; 448 ctx->rest -= bytes;
444 449
445 return NGX_OK; 450 return NGX_OK;
446 } 451 }
447 452
448 for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { 453 for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {