mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Remove ap_proxy_removestr(). It has been unused for a decade and has quadratic
memory usage. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180654 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -434,51 +434,6 @@ PROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* list is a comma-separated list of case-insensitive tokens, with
|
||||
* optional whitespace around the tokens.
|
||||
* if val appears on the list of tokens, it is removed from the list,
|
||||
* and the new list is returned.
|
||||
*/
|
||||
PROXY_DECLARE(char *)ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val)
|
||||
{
|
||||
int len, i;
|
||||
const char *p;
|
||||
char *new = NULL;
|
||||
|
||||
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) {
|
||||
/* do nothing */
|
||||
}
|
||||
else {
|
||||
if (new) {
|
||||
new = apr_pstrcat(pool, new, ",", apr_pstrndup(pool, list, i), NULL);
|
||||
}
|
||||
else {
|
||||
new = apr_pstrndup(pool, list, i);
|
||||
}
|
||||
}
|
||||
list = p;
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts 8 hex digits to a time integer
|
||||
*/
|
||||
|
Reference in New Issue
Block a user