From: Graham Leggett Date: Sat, 3 Dec 2011 00:30:06 +0000 (+0000) Subject: mod_proxy: Remove ap_proxy_liststr(), it duplicates ap_find_token(). X-Git-Tag: 2.5.0-alpha~7745 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9abaf845ca04840170d1fc547c6c8edba5cfb224;p=apache mod_proxy: Remove ap_proxy_liststr(), it duplicates ap_find_token(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209797 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index 9c4a12adc6..c222bc1138 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -538,7 +538,6 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, en PROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp, char **passwordp, char **hostp, apr_port_t *port); PROXY_DECLARE(const char *)ap_proxy_date_canon(apr_pool_t *p, const char *x); -PROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val); PROXY_DECLARE(int) ap_proxy_hex2sec(const char *x); PROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y); PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message); diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 98451efd02..9a49899c64 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1646,9 +1646,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, */ te = apr_table_get(r->headers_out, "Transfer-Encoding"); /* strip connection listed hop-by-hop headers from response */ - backend->close += ap_proxy_liststr(apr_table_get(r->headers_out, - "Connection"), - "close"); + backend->close += ap_find_token(p, + apr_table_get(r->headers_out, "Connection"), "close"); ap_proxy_clear_connection(p, r->headers_out); if ((buf = apr_table_get(r->headers_out, "Content-Type"))) { ap_set_content_type(r, apr_pstrdup(p, buf)); diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 9e91460ec7..cba4ceb0f0 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -413,43 +413,6 @@ PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r) return rp; } - -/* - * list is a comma-separated list of case-insensitive tokens, with - * optional whitespace around the tokens. - * The return returns 1 if the token val is found in the list, or 0 - * otherwise. - */ -PROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val) -{ - int len, i; - const char *p; - - len = strlen(val); - - while (list != NULL) { - p = ap_strchr_c(list, ','); - if (p != NULL) { - i = p - list; - do { - p++; - } while (apr_isspace(*p)); - } - else { - i = strlen(list); - } - - while (i > 0 && apr_isspace(list[i - 1])) { - i--; - } - if (i == len && strncasecmp(list, val, len) == 0) { - return 1; - } - list = p; - } - return 0; -} - /* * Converts 8 hex digits to a time integer */