comparison src/http/ngx_http_upstream.c @ 2805:60551422e150

reinit proxy/fastcgi header parser before ngx_http_upstream_cache_send()
author Igor Sysoev <igor@sysoev.ru>
date Tue, 05 May 2009 17:18:33 +0000
parents edc0cd9db5cf
children 6ad4bba6313e
comparison
equal deleted inserted replaced
2804:edc0cd9db5cf 2805:60551422e150
1470 1470
1471 1471
1472 static ngx_int_t 1472 static ngx_int_t
1473 ngx_http_upstream_test_next(ngx_http_request_t *r, ngx_http_upstream_t *u) 1473 ngx_http_upstream_test_next(ngx_http_request_t *r, ngx_http_upstream_t *u)
1474 { 1474 {
1475 ngx_int_t rc;
1475 ngx_uint_t status; 1476 ngx_uint_t status;
1476 ngx_http_upstream_next_t *un; 1477 ngx_http_upstream_next_t *un;
1477 1478
1478 status = u->headers_in.status_n; 1479 status = u->headers_in.status_n;
1479 1480
1489 } 1490 }
1490 1491
1491 #if (NGX_HTTP_CACHE) 1492 #if (NGX_HTTP_CACHE)
1492 1493
1493 if (u->stale_cache && (u->conf->cache_use_stale & un->mask)) { 1494 if (u->stale_cache && (u->conf->cache_use_stale & un->mask)) {
1494 ngx_http_upstream_finalize_request(r, u, 1495
1495 ngx_http_upstream_cache_send(r, u)); 1496 rc = u->reinit_request(r);
1497
1498 if (rc == NGX_OK) {
1499 rc = ngx_http_upstream_cache_send(r, u);
1500 }
1501
1502 ngx_http_upstream_finalize_request(r, u, rc);
1496 return NGX_OK; 1503 return NGX_OK;
1497 } 1504 }
1498 1505
1499 #endif 1506 #endif
1500 } 1507 }
2641 if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) { 2648 if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) {
2642 2649
2643 #if (NGX_HTTP_CACHE) 2650 #if (NGX_HTTP_CACHE)
2644 2651
2645 if (u->stale_cache && (u->conf->cache_use_stale & ft_type)) { 2652 if (u->stale_cache && (u->conf->cache_use_stale & ft_type)) {
2646 2653 ngx_int_t rc;
2647 ngx_http_upstream_finalize_request(r, u, 2654
2648 ngx_http_upstream_cache_send(r, u)); 2655 rc = u->reinit_request(r);
2656
2657 if (rc == NGX_OK) {
2658 rc = ngx_http_upstream_cache_send(r, u);
2659 }
2660
2661 ngx_http_upstream_finalize_request(r, u, rc);
2649 return; 2662 return;
2650 } 2663 }
2651 #endif 2664 #endif
2652 2665
2653 ngx_http_upstream_finalize_request(r, u, status); 2666 ngx_http_upstream_finalize_request(r, u, status);