comparison src/http/ngx_http_upstream.c @ 2308:3f98400e31e9

memcached response was stored in variable with END
author Igor Sysoev <igor@sysoev.ru>
date Wed, 12 Nov 2008 21:01:01 +0000
parents c77f4710595c
children 64854406b1f9
comparison
equal deleted inserted replaced
2307:4b98aa04ee24 2308:3f98400e31e9
1335 ngx_http_upstream_finalize_request(r, u, 1335 ngx_http_upstream_finalize_request(r, u,
1336 NGX_HTTP_INTERNAL_SERVER_ERROR); 1336 NGX_HTTP_INTERNAL_SERVER_ERROR);
1337 return; 1337 return;
1338 } 1338 }
1339 1339
1340 if (u->buffer.last - u->buffer.pos >= (ssize_t) u->length) { 1340 n = u->buffer.last - u->buffer.pos;
1341 if (u->input_filter(u->input_filter_ctx, 0) == NGX_ERROR) { 1341
1342 if (n) {
1343 u->buffer.last -= n;
1344
1345 if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
1342 ngx_http_upstream_finalize_request(r, u, NGX_ERROR); 1346 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
1343 return; 1347 return;
1344 } 1348 }
1345 1349
1346 ngx_http_upstream_finalize_request(r, u, 0); 1350 if (u->length == 0) {
1347 return; 1351 ngx_http_upstream_finalize_request(r, u, 0);
1352 return;
1353 }
1348 } 1354 }
1349 1355
1350 rev->handler = ngx_http_upstream_process_body_in_memory; 1356 rev->handler = ngx_http_upstream_process_body_in_memory;
1351 1357
1352 ngx_http_upstream_process_body_in_memory(rev); 1358 ngx_http_upstream_process_body_in_memory(rev);