1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Cleanup of dead functions within proxy_util.c.

PR:
Obtained from:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88732 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2001-04-05 18:53:04 +00:00
parent afce43baa9
commit a43bb9db2e
4 changed files with 11 additions and 67 deletions

View File

@@ -412,7 +412,7 @@ static int proxy_handler(request_rec *r)
return ap_proxy_http_handler(r, url, NULL, 0); return ap_proxy_http_handler(r, url, NULL, 0);
#if FTP #if FTP
if (strcasecmp(scheme, "ftp") == 0) if (strcasecmp(scheme, "ftp") == 0)
return ap_proxy_ftp_handler(r, NULL, url); return ap_proxy_ftp_handler(r, url);
#endif #endif
else { else {
ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,

View File

@@ -156,7 +156,6 @@ struct proxy_alias {
struct dirconn_entry { struct dirconn_entry {
char *name; char *name;
// struct apr_sockaddr_t *addr;
struct in_addr addr, mask; struct in_addr addr, mask;
struct hostent *hostentry; struct hostent *hostentry;
int (*matcher) (struct dirconn_entry * This, request_rec *r); int (*matcher) (struct dirconn_entry * This, request_rec *r);
@@ -236,10 +235,8 @@ char *ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
char **passwordp, char **hostp, int *port); char **passwordp, char **hostp, int *port);
const char *ap_proxy_date_canon(apr_pool_t *p, const char *x); const char *ap_proxy_date_canon(apr_pool_t *p, const char *x);
apr_table_t *ap_proxy_read_headers(request_rec *r, request_rec *rp, char *buffer, int size, conn_rec *c); apr_table_t *ap_proxy_read_headers(request_rec *r, request_rec *rp, char *buffer, int size, conn_rec *c);
void ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *hdrs);
int ap_proxy_liststr(const char *list, const char *val); int ap_proxy_liststr(const char *list, const char *val);
char *ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val); char *ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val);
void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength);
int ap_proxy_hex2sec(const char *x); int ap_proxy_hex2sec(const char *x);
void ap_proxy_sec2hex(int t, char *y); void ap_proxy_sec2hex(int t, char *y);
const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp); const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
@@ -249,8 +246,6 @@ int ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
int ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p); int ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
int ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p); int ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr); int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r); int ap_proxy_pre_http_connection(conn_rec *c);
/* This function is called by ap_table_do() for all header lines */
int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
#endif /*MOD_PROXY_H*/ #endif /*MOD_PROXY_H*/

View File

@@ -217,7 +217,7 @@ int ap_proxy_http_handler(request_rec *r, char *url,
} }
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server, ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: connecting %s to %s:%d", url, uri.hostname, uri.port); "proxy: HTTP 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, 0, p); err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, 0, p);
@@ -398,10 +398,7 @@ int ap_proxy_http_handler(request_rec *r, char *url,
*/ */
/* set up the connection filters */ /* set up the connection filters */
ap_add_input_filter("HTTP_IN", NULL, NULL, origin); ap_proxy_pre_http_connection(origin);
ap_add_input_filter("CORE_IN", NULL, NULL, origin);
ap_add_output_filter("CORE", NULL, NULL, origin);
/* strip connection listed hop-by-hop headers from the request */ /* strip connection listed hop-by-hop headers from the request */
/* even though in theory a connection: close coming from the client /* even though in theory a connection: close coming from the client
@@ -559,7 +556,6 @@ int ap_proxy_http_handler(request_rec *r, char *url,
* filter chain * filter chain
*/ */
rp = make_fake_req(origin, r); rp = make_fake_req(origin, r);
apr_brigade_destroy(bb); apr_brigade_destroy(bb);

View File

@@ -74,6 +74,7 @@ static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r); static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r);
static int proxy_match_word(struct dirconn_entry *This, request_rec *r); static int proxy_match_word(struct dirconn_entry *This, request_rec *r);
static struct per_thread_data *get_per_thread_data(void); static struct per_thread_data *get_per_thread_data(void);
/* already called in the knowledge that the characters are hex digits */ /* already called in the knowledge that the characters are hex digits */
int ap_proxy_hex2c(const char *x) int ap_proxy_hex2c(const char *x)
{ {
@@ -465,35 +466,6 @@ apr_table_t *ap_proxy_read_headers(request_rec *r, request_rec *rr, char *buffer
return headers_out; return headers_out;
} }
/*
* Sends response line and headers. Uses the client fd and the
* headers_out array from the passed request_rec to talk to the client
* and to properly set the headers it sends for things such as logging.
*
* A timeout should be set before calling this routine.
*/
void ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *t)
{
int i;
apr_socket_t *fp = r->connection->client_socket;
apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(t)->elts;
char *temp = apr_pstrcat(r->pool, respline, CRLF, NULL);
apr_size_t len = strlen(temp);
apr_send(fp, temp, &len);
for (i = 0; i < apr_table_elts(t)->nelts; ++i) {
if (elts[i].key != NULL) {
temp = apr_pstrcat(r->pool, elts[i].key, ": ", elts[i].val, CRLF, NULL);
apr_send(fp, temp, &len);
apr_table_addn(r->headers_out, elts[i].key, elts[i].val);
}
}
len = 2;
apr_send(fp, CRLF, &len);
}
/* /*
* list is a comma-separated list of case-insensitive tokens, with * list is a comma-separated list of case-insensitive tokens, with
@@ -1109,34 +1081,15 @@ int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf,
return OK; return OK;
} }
apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r) /* set up the minimal filter set */
int ap_proxy_pre_http_connection(conn_rec *c)
{ {
apr_status_t rv; ap_add_input_filter("HTTP_IN", NULL, NULL, c);
apr_sockaddr_t *destsa; ap_add_input_filter("CORE_IN", NULL, NULL, c);
ap_add_output_filter("CORE", NULL, NULL, c);
rv = apr_sockaddr_info_get(&destsa, host, AF_INET, port, 0, r->pool); return OK;
if (rv == APR_SUCCESS) {
rv = apr_connect(sock, destsa);
}
else if (rv != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"proxy connect to %s port %d failed", host, port);
}
return rv;
} }
/* This function is called by apr_table_do() for all header lines */
/* (from proxy_http.c and proxy_ftp.c) */
/* It is passed a table_do_args struct pointer and a MIME field and value pair */
int ap_proxy_send_hdr_line(void *p, const char *key, const char *value)
{
struct request_rec *r = (struct request_rec *)p;
if (key == NULL || value == NULL || value[0] == '\0')
return 1;
if (!r->assbackwards)
ap_rvputs(r, key, ": ", value, CRLF, NULL);
return 1; /* tell apr_table_do() to continue calling us for more headers */
}
#if defined WIN32 #if defined WIN32