httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r571863 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
Date Sat, 01 Sep 2007 19:45:27 GMT
Author: niq
Date: Sat Sep  1 12:45:20 2007
New Revision: 571863

URL: http://svn.apache.org/viewvc?rev=571863&view=rev
Log:
Move error-checking to where it should be
Updating r571414 (patch for PR 40756) following rpluem comment

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=571863&r1=571862&r2=571863&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Sat Sep  1 12:45:20 2007
@@ -122,6 +122,11 @@
 
     /* do a DNS lookup for the destination host */
     err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, 0, p);
+    if (APR_SUCCESS != err) {
+	return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p,
+			     "DNS lookup failure for: ",
+			     uri.hostname, NULL));
+    }
 
     /* are we connecting directly, or via a proxy? */
     if (proxyname) {
@@ -136,12 +141,6 @@
     }
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
          "proxy: CONNECT: connecting to remote proxy %s on port %d", connectname, connectport);
-
-    if (APR_SUCCESS != err) {
-	return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p,
-			     "DNS lookup failure for: ",
-			     uri.hostname, NULL));
-    }
  
     /* check if ProxyBlock directive on this host */
     if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {



Mime
View raw message