]> granicus.if.org Git - apache/commitdiff
Always use the cleanup. Do not close the socket directly.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:45:08 +0000 (22:45 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:45:08 +0000 (22:45 +0000)
Submitted by: mturk

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

modules/proxy/proxy_http.c

index 13caec90adb074b607c6008647367ed3fe091764..9a2063cf153d8d998c0489b7edfd6e699ef78390 100644 (file)
@@ -795,9 +795,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             len = ap_getline(buffer, sizeof(buffer), rp, 0);
         }
         if (len <= 0) {
-            apr_socket_close(backend->sock);
-            backend->sock = NULL;
-//            backend->connection = NULL;
+            ap_proxy_http_cleanup(NULL, r, backend);
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "proxy: error reading status line from remote "
                           "server %s", backend->hostname);
@@ -819,9 +817,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
              * if the status line was > 8192 bytes
              */
             else if ((buffer[5] != '1') || (len >= sizeof(buffer)-1)) {
-                apr_socket_close(backend->sock);
-//                backend->connection = NULL;
-                backend->sock = NULL;
+                ap_proxy_http_cleanup(NULL, r, backend);
                 return ap_proxyerror(r, HTTP_BAD_GATEWAY,
                 apr_pstrcat(p, "Corrupt status line returned by remote "
                             "server: ", buffer, NULL));