Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 67544 invoked from network); 11 Aug 2004 23:09:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Aug 2004 23:09:20 -0000 Received: (qmail 3485 invoked by uid 500); 11 Aug 2004 23:09:18 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 3422 invoked by uid 500); 11 Aug 2004 23:09:18 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 3407 invoked by uid 500); 11 Aug 2004 23:09:18 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 3403 invoked by uid 99); 11 Aug 2004 23:09:18 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 11 Aug 2004 16:09:18 -0700 Received: (qmail 67507 invoked by uid 1134); 11 Aug 2004 23:09:17 -0000 Date: 11 Aug 2004 23:09:17 -0000 Message-ID: <20040811230917.67506.qmail@minotaur.apache.org> From: wrowe@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/proxy proxy_http.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N wrowe 2004/08/11 16:09:17 Modified: modules/proxy proxy_http.c Log: Make sure that the things get logged using the same look-and-feal. Also fix the return code from DECLINED to service unavailable if the connection breaks. Submitted by: mturk Revision Changes Path 1.193 +15 -8 httpd-2.0/modules/proxy/proxy_http.c Index: proxy_http.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v retrieving revision 1.192 retrieving revision 1.193 diff -u -r1.192 -r1.193 --- proxy_http.c 11 Aug 2004 22:45:08 -0000 1.192 +++ proxy_http.c 11 Aug 2004 23:09:17 -0000 1.193 @@ -1115,6 +1115,7 @@ int status; char server_portstr[32]; char *scheme; + const char *proxy_function; const char *u; proxy_conn_rec *backend = NULL; int is_ssl = 0; @@ -1154,12 +1155,19 @@ return DECLINED; } is_ssl = 1; + proxy_function = "HTTPS"; } else if (!(strcmp(scheme, "http") == 0 || (strcmp(scheme, "ftp") == 0 && proxyname))) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: HTTP: declining URL %s", url); return DECLINED; /* only interested in HTTP, or FTP via proxy */ } + else { + if (*scheme == 'h') + proxy_function = "HTTP"; + else + proxy_function = "FTP"; + } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: HTTP: serving URL %s", url); @@ -1173,11 +1181,11 @@ } /* create space for state information */ if (!backend) { - status = ap_proxy_acquire_connection(scheme, &backend, worker, r->server); + status = ap_proxy_acquire_connection(proxy_function, &backend, worker, r->server); if (status != OK) { if (backend) { backend->close_on_recycle = 1; - ap_proxy_release_connection(scheme, backend, r->server); + ap_proxy_release_connection(proxy_function, backend, r->server); } return status; } @@ -1200,14 +1208,13 @@ } /* Step Two: Make the Connection */ - status = ap_proxy_connect_backend(scheme, backend, worker, r->server); - if ( status != OK ) { - return status; + if (ap_proxy_connect_backend(proxy_function, backend, worker, r->server)) { + return HTTP_SERVICE_UNAVAILABLE; } /* Step Three: Create conn_rec */ if (!backend->connection) { - status = ap_proxy_connection_create(scheme, backend, c, r->server); + status = ap_proxy_connection_create(proxy_function, backend, c, r->server); if (status != OK) return status; } @@ -1224,12 +1231,12 @@ server_portstr); if (status != OK) { /* clean up even if there is an error */ - ap_proxy_http_cleanup(scheme, r, backend); + ap_proxy_http_cleanup(proxy_function, r, backend); return status; } /* Step Six: Clean Up */ - status = ap_proxy_http_cleanup(scheme, r, backend); + status = ap_proxy_http_cleanup(proxy_function, r, backend); if ( status != OK ) { return status; }