diff options
author | Jacob Champion <jchampion@apache.org> | 2016-11-10 21:53:21 +0100 |
---|---|---|
committer | Jacob Champion <jchampion@apache.org> | 2016-11-10 21:53:21 +0100 |
commit | 091f96ee10e3963faacd258c3f64417c7ad21e1c (patch) | |
tree | ffd8ec24d41ec9a54cf20c7580aaa0ce3ce673fd /server/util_cookies.c | |
parent | heh... bring memcache up to redis :) (diff) | |
download | apache2-091f96ee10e3963faacd258c3f64417c7ad21e1c.tar.xz apache2-091f96ee10e3963faacd258c3f64417c7ad21e1c.zip |
Remove unnecessary apr_table_do() function casts
Function casts can cause hard-to-debug corruption issues if a
declaration is accidentally changed to be incompatible. Luckily, most of
the function casts for apr_table_do() calls are unnecessary. Remove
them, and adjust the signatures for helpers that weren't taking void* as
the first argument.
The remaining helper that requires a cast is http_filter.c's
form_header_field(), which is probably where many of these casts were
copy-pasted from. I have left it as-is: it has other direct callers
besides apr_table_do(), and it's already documented with warnings not to
change the function signature.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769192 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_cookies.c')
-rw-r--r-- | server/util_cookies.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/util_cookies.c b/server/util_cookies.c index 5139aecd4c..82a514fcc6 100644 --- a/server/util_cookies.c +++ b/server/util_cookies.c @@ -174,8 +174,9 @@ AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2, c * $path or other attributes following our cookie if present. If we end * up with an empty cookie, remove the whole header. */ -static int extract_cookie_line(ap_cookie_do * v, const char *key, const char *val) +static int extract_cookie_line(void *varg, const char *key, const char *val) { + ap_cookie_do *v = varg; char *last1, *last2; char *cookie = apr_pstrdup(v->r->pool, val); const char *name = apr_pstrcat(v->r->pool, v->name ? v->name : "", "=", NULL); @@ -252,8 +253,7 @@ AP_DECLARE(apr_status_t) ap_cookie_read(request_rec * r, const char *name, const v.duplicated = 0; v.name = name; - apr_table_do((int (*) (void *, const char *, const char *)) - extract_cookie_line, (void *) &v, r->headers_in, + apr_table_do(extract_cookie_line, &v, r->headers_in, "Cookie", "Cookie2", NULL); if (v.duplicated) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00011) LOG_PREFIX |