nginx-0.0.1-2003-10-27-19:16:17 import
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index ae6d5d1..0bb3cce 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -457,6 +457,7 @@
                 return;
             }
 
+            ngx_event_connect_peer_failed(&p->upstream);
             ngx_http_proxy_close_connection(c);
         }
 
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 9b8ac27..e3a4952 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -629,7 +629,7 @@
                 return;
             }
 
-            if (r->header_timeout_set) {
+            if (rev->timer_set) {
                 ngx_del_timer(rev);
             }
 
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index ce6183e..035d487 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -157,6 +157,12 @@
     ngx_chain_t               *out, **ll, *cl;
     ngx_http_core_loc_conf_t  *clcf;
 
+    rc = ngx_http_discard_body(r);
+
+    if (rc != NGX_OK) {
+        return rc;
+    }
+
     r->headers_out.status = error;
 
     if (error < NGX_HTTP_BAD_REQUEST) {