mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Move error-checking to where it should be
Updating r571414 (patch for PR 40756) following rpluem comment git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@571863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -122,6 +122,11 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
|
|
||||||
/* do a DNS lookup for the destination host */
|
/* do a DNS lookup for the destination host */
|
||||||
err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, 0, p);
|
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? */
|
/* are we connecting directly, or via a proxy? */
|
||||||
if (proxyname) {
|
if (proxyname) {
|
||||||
@@ -137,12 +142,6 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
||||||
"proxy: CONNECT: connecting to remote proxy %s on port %d", connectname, connectport);
|
"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 */
|
/* check if ProxyBlock directive on this host */
|
||||||
if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {
|
if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {
|
||||||
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
||||||
|
Reference in New Issue
Block a user