Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 3050:f54b02dbb12b
axe r->connection->destroyed testing
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 26 Aug 2009 16:14:57 +0000 |
parents | 0278f13b04c5 |
children | 6060225e9261 |
comparison
equal
deleted
inserted
replaced
3049:67254117b774 | 3050:f54b02dbb12b |
---|---|
2258 if (do_write) { | 2258 if (do_write) { |
2259 | 2259 |
2260 if (u->out_bufs || u->busy_bufs) { | 2260 if (u->out_bufs || u->busy_bufs) { |
2261 rc = ngx_http_output_filter(r, u->out_bufs); | 2261 rc = ngx_http_output_filter(r, u->out_bufs); |
2262 | 2262 |
2263 if (downstream->destroyed) { | |
2264 return; | |
2265 } | |
2266 | |
2267 if (rc == NGX_ERROR) { | 2263 if (rc == NGX_ERROR) { |
2268 ngx_http_upstream_finalize_request(r, u, 0); | 2264 ngx_http_upstream_finalize_request(r, u, 0); |
2269 return; | 2265 return; |
2270 } | 2266 } |
2271 | 2267 |
2434 | 2430 |
2435 return; | 2431 return; |
2436 } | 2432 } |
2437 | 2433 |
2438 if (ngx_event_pipe(p, wev->write) == NGX_ABORT) { | 2434 if (ngx_event_pipe(p, wev->write) == NGX_ABORT) { |
2439 | |
2440 if (c->destroyed) { | |
2441 return; | |
2442 } | |
2443 | |
2444 ngx_http_upstream_finalize_request(r, u, 0); | 2435 ngx_http_upstream_finalize_request(r, u, 0); |
2445 return; | 2436 return; |
2446 } | 2437 } |
2447 | 2438 |
2448 } else { | 2439 } else { |
2464 | 2455 |
2465 return; | 2456 return; |
2466 } | 2457 } |
2467 | 2458 |
2468 if (ngx_event_pipe(p, 1) == NGX_ABORT) { | 2459 if (ngx_event_pipe(p, 1) == NGX_ABORT) { |
2469 | |
2470 if (c->destroyed) { | |
2471 return; | |
2472 } | |
2473 | |
2474 ngx_http_upstream_finalize_request(r, u, 0); | 2460 ngx_http_upstream_finalize_request(r, u, 0); |
2475 return; | 2461 return; |
2476 } | 2462 } |
2477 } | 2463 } |
2478 | 2464 |
2496 if (c->read->timedout) { | 2482 if (c->read->timedout) { |
2497 u->pipe->upstream_error = 1; | 2483 u->pipe->upstream_error = 1; |
2498 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); | 2484 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); |
2499 | 2485 |
2500 } else { | 2486 } else { |
2501 c = r->connection; | |
2502 | |
2503 if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) { | 2487 if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) { |
2504 | |
2505 if (c->destroyed) { | |
2506 return; | |
2507 } | |
2508 | |
2509 ngx_http_upstream_finalize_request(r, u, 0); | 2488 ngx_http_upstream_finalize_request(r, u, 0); |
2510 return; | 2489 return; |
2511 } | 2490 } |
2512 } | 2491 } |
2513 | 2492 |