]> granicus.if.org Git - apache/commitdiff
send a 'bad-gateway'
authorIan Holsman <ianh@apache.org>
Wed, 20 Feb 2002 20:25:15 +0000 (20:25 +0000)
committerIan Holsman <ianh@apache.org>
Wed, 20 Feb 2002 20:25:15 +0000 (20:25 +0000)
when a invaild response flys in

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93519 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_http.c

index aaf78177829af78f0b408c8c68bb10f783b85066..d2bab6cbb0d6ae522e5f8ad11f31c778bfa5a528 100644 (file)
@@ -737,6 +737,16 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                              "returned by %s (%s)", major, minor, r->uri,
                              r->method);
                 p_conn->close += 1;
+                /*
+                 * ap_send_error relies on a headers_out to be present. we
+                 * are in a bad position here.. so force everything we send out
+                 * to have nothing to do with the incoming packet
+                 */
+                r->headers_out = apr_table_make(r->pool,1);
+                r->status = HTTP_BAD_GATEWAY;
+                r->status_line = "bad gateway";
+                return r->status;
+
             } else {
                 /* strip connection listed hop-by-hop headers from response */
                 const char *buf;