comparison src/http/ngx_http_upstream.c @ 5297:0ae9a2958886

Upstream: NGX_ERROR after pipe errors.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 25 Jul 2013 14:56:41 +0400
parents 1ccdda1f37f3
children a7b2db9119e0
comparison
equal deleted inserted replaced
5296:1ccdda1f37f3 5297:0ae9a2958886
2902 2902
2903 return; 2903 return;
2904 } 2904 }
2905 2905
2906 if (ngx_event_pipe(p, wev->write) == NGX_ABORT) { 2906 if (ngx_event_pipe(p, wev->write) == NGX_ABORT) {
2907 ngx_http_upstream_finalize_request(r, u, 0); 2907 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
2908 return; 2908 return;
2909 } 2909 }
2910 2910
2911 } else { 2911 } else {
2912 p->downstream_error = 1; 2912 p->downstream_error = 1;
2927 2927
2928 return; 2928 return;
2929 } 2929 }
2930 2930
2931 if (ngx_event_pipe(p, 1) == NGX_ABORT) { 2931 if (ngx_event_pipe(p, 1) == NGX_ABORT) {
2932 ngx_http_upstream_finalize_request(r, u, 0); 2932 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
2933 return; 2933 return;
2934 } 2934 }
2935 } 2935 }
2936 2936
2937 ngx_http_upstream_process_request(r); 2937 ngx_http_upstream_process_request(r);
2955 u->pipe->upstream_error = 1; 2955 u->pipe->upstream_error = 1;
2956 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); 2956 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
2957 2957
2958 } else { 2958 } else {
2959 if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) { 2959 if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) {
2960 ngx_http_upstream_finalize_request(r, u, 0); 2960 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
2961 return; 2961 return;
2962 } 2962 }
2963 } 2963 }
2964 2964
2965 ngx_http_upstream_process_request(r); 2965 ngx_http_upstream_process_request(r);
3033 if (p->downstream_error) { 3033 if (p->downstream_error) {
3034 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 3034 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
3035 "http upstream downstream error"); 3035 "http upstream downstream error");
3036 3036
3037 if (!u->cacheable && !u->store && u->peer.connection) { 3037 if (!u->cacheable && !u->store && u->peer.connection) {
3038 ngx_http_upstream_finalize_request(r, u, 0); 3038 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
3039 } 3039 }
3040 } 3040 }
3041 } 3041 }
3042 3042
3043 3043