# HG changeset patch # User Igor Sysoev # Date 1051108482 0 # Node ID 939bc7cd9a90b385b33e1091710361c3e804e29f # Parent eacfdd1c31b96793f7d17de772f84c3d88bda674 nginx-0.0.1-2003-04-23-18:34:42 import diff -r eacfdd1c31b9 -r 939bc7cd9a90 src/http/modules/proxy/ngx_http_event_proxy_handler.c --- a/src/http/modules/proxy/ngx_http_event_proxy_handler.c Tue Apr 22 15:02:58 2003 +0000 +++ b/src/http/modules/proxy/ngx_http_event_proxy_handler.c Wed Apr 23 14:34:42 2003 +0000 @@ -371,8 +371,7 @@ return NGX_DONE; } - if (p->tries /* STUB !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ - + if (p->tries > 1 && (rc == NGX_HTTP_BAD_GATEWAY || rc == NGX_HTTP_GATEWAY_TIME_OUT || (rc == NGX_OK @@ -1083,7 +1082,12 @@ int rc; rc = ngx_event_proxy_read_upstream(p->event_proxy); - if (rc == NGX_OK) { + + if (p->event_proxy->fatal_error) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + + if (p->event_proxy->upstream_eof && p->event_proxy->upstream_error) { rc = ngx_event_close_connection(p->connection->read); }