mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* Style fixes. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@813254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -167,7 +167,8 @@ 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 %s to %s:%d", url, uri.hostname, uri.port);
|
"proxy: CONNECT: connecting %s to %s:%d", url, uri.hostname,
|
||||||
|
uri.port);
|
||||||
|
|
||||||
/* 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,
|
err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port,
|
||||||
@@ -182,7 +183,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
if (proxyname) {
|
if (proxyname) {
|
||||||
connectname = proxyname;
|
connectname = proxyname;
|
||||||
connectport = proxyport;
|
connectport = proxyport;
|
||||||
err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC, proxyport, 0, p);
|
err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC,
|
||||||
|
proxyport, 0, p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
connectname = uri.hostname;
|
connectname = uri.hostname;
|
||||||
@@ -190,7 +192,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
connect_addr = uri_addr;
|
connect_addr = uri_addr;
|
||||||
}
|
}
|
||||||
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);
|
||||||
|
|
||||||
/* 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)) {
|
||||||
@@ -206,10 +209,12 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
case APR_URI_SNEWS_DEFAULT_PORT:
|
case APR_URI_SNEWS_DEFAULT_PORT:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return ap_proxyerror(r, HTTP_FORBIDDEN, "Connect to remote machine blocked");
|
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
||||||
|
"Connect to remote machine blocked");
|
||||||
}
|
}
|
||||||
} else if(!allowed_port(conf, uri.port)) {
|
} else if(!allowed_port(conf, uri.port)) {
|
||||||
return ap_proxyerror(r, HTTP_FORBIDDEN, "Connect to remote machine blocked");
|
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
||||||
|
"Connect to remote machine blocked");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -311,7 +316,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
/* FIXME: Error checking ignored.
|
/* FIXME: Error checking ignored.
|
||||||
*/
|
*/
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
||||||
"proxy: CONNECT: sending the CONNECT request to the remote proxy");
|
"proxy: CONNECT: sending the CONNECT request"
|
||||||
|
" to the remote proxy");
|
||||||
ap_fprintf(backconn->output_filters, bb,
|
ap_fprintf(backconn->output_filters, bb,
|
||||||
"CONNECT %s HTTP/1.0" CRLF, r->uri);
|
"CONNECT %s HTTP/1.0" CRLF, r->uri);
|
||||||
ap_fprintf(backconn->output_filters, bb,
|
ap_fprintf(backconn->output_filters, bb,
|
||||||
@@ -326,7 +332,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
ap_xlate_proto_to_ascii(buffer, nbytes);
|
ap_xlate_proto_to_ascii(buffer, nbytes);
|
||||||
ap_fwrite(c->output_filters, bb, buffer, nbytes);
|
ap_fwrite(c->output_filters, bb, buffer, nbytes);
|
||||||
nbytes = apr_snprintf(buffer, sizeof(buffer),
|
nbytes = apr_snprintf(buffer, sizeof(buffer),
|
||||||
"Proxy-agent: %s" CRLF CRLF, ap_get_server_banner());
|
"Proxy-agent: %s" CRLF CRLF,
|
||||||
|
ap_get_server_banner());
|
||||||
ap_xlate_proto_to_ascii(buffer, nbytes);
|
ap_xlate_proto_to_ascii(buffer, nbytes);
|
||||||
ap_fwrite(c->output_filters, bb, buffer, nbytes);
|
ap_fwrite(c->output_filters, bb, buffer, nbytes);
|
||||||
ap_fflush(c->output_filters, bb);
|
ap_fflush(c->output_filters, bb);
|
||||||
@@ -360,7 +367,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
/* r->sent_bodyct = 1;*/
|
/* r->sent_bodyct = 1;*/
|
||||||
|
|
||||||
while (1) { /* Infinite loop until error (one side closes the connection) */
|
while (1) { /* Infinite loop until error (one side closes the connection) */
|
||||||
if ((rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled)) != APR_SUCCESS) {
|
if ((rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled))
|
||||||
|
!= APR_SUCCESS) {
|
||||||
apr_socket_close(sock);
|
apr_socket_close(sock);
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: CONNECT: error apr_poll()");
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: CONNECT: error apr_poll()");
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
@@ -382,9 +390,11 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
#endif
|
#endif
|
||||||
rv = proxy_connect_transfer(r, backconn, c, bb, "sock");
|
rv = proxy_connect_transfer(r, backconn, c, bb, "sock");
|
||||||
}
|
}
|
||||||
else if ((pollevent & APR_POLLERR) || (pollevent & APR_POLLHUP)) {
|
else if ((pollevent & APR_POLLERR)
|
||||||
|
|| (pollevent & APR_POLLHUP)) {
|
||||||
rv = APR_EPIPE;
|
rv = APR_EPIPE;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r, "proxy: CONNECT: err/hup on backconn");
|
ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
|
||||||
|
"proxy: CONNECT: err/hup on backconn");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cur->desc.s == client_socket) {
|
else if (cur->desc.s == client_socket) {
|
||||||
|
Reference in New Issue
Block a user