diff options
-rw-r--r-- | modules/http/http_filters.c | 3 | ||||
-rw-r--r-- | modules/http2/h2_from_h1.c | 9 | ||||
-rw-r--r-- | modules/metadata/mod_headers.c | 11 | ||||
-rw-r--r-- | modules/session/mod_session.c | 13 | ||||
-rw-r--r-- | server/util_cookies.c | 6 |
5 files changed, 19 insertions, 23 deletions
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index b0ed5b009b..a583f3c1be 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -826,8 +826,7 @@ static void fixup_vary(request_rec *r) * its comma-separated fieldname values, and then add them to varies * if not already present in the array. */ - apr_table_do((int (*)(void *, const char *, const char *))uniq_field_values, - (void *) varies, r->headers_out, "Vary", NULL); + apr_table_do(uniq_field_values, varies, r->headers_out, "Vary", NULL); /* If we found any, replace old Vary fields with unique-ified value */ diff --git a/modules/http2/h2_from_h1.c b/modules/http2/h2_from_h1.c index cdb444650b..f1ea12de2f 100644 --- a/modules/http2/h2_from_h1.c +++ b/modules/http2/h2_from_h1.c @@ -103,8 +103,7 @@ static void fix_vary(request_rec *r) * its comma-separated fieldname values, and then add them to varies * if not already present in the array. */ - apr_table_do((int (*)(void *, const char *, const char *))uniq_field_values, - (void *) varies, r->headers_out, "Vary", NULL); + apr_table_do(uniq_field_values, varies, r->headers_out, "Vary", NULL); /* If we found any, replace old Vary fields with unique-ified value */ @@ -275,8 +274,7 @@ static h2_headers *create_response(h2_task *task, request_rec *r) set_basic_http_header(headers, r, r->pool); if (r->status == HTTP_NOT_MODIFIED) { - apr_table_do((int (*)(void *, const char *, const char *)) copy_header, - (void *) headers, r->headers_out, + apr_table_do(copy_header, headers, r->headers_out, "ETag", "Content-Location", "Expires", @@ -290,8 +288,7 @@ static h2_headers *create_response(h2_task *task, request_rec *r) NULL); } else { - apr_table_do((int (*)(void *, const char *, const char *)) copy_header, - (void *) headers, r->headers_out, NULL); + apr_table_do(copy_header, headers, r->headers_out, NULL); } return h2_headers_rcreate(r, r->status, headers, r->pool); diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 3fd9804227..4b4c606886 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -666,13 +666,15 @@ static const char *process_regexp(header_entry *hdr, const char *value, return ret; } -static int echo_header(echo_do *v, const char *key, const char *val) +static int echo_header(void *v, const char *key, const char *val) { + edit_do *ed = v; + /* If the input header (key) matches the regex, echo it intact to * r->headers_out. */ - if (!ap_regexec(v->hdr->regex, key, 0, NULL, 0)) { - apr_table_add(v->r->headers_out, key, val); + if (!ap_regexec(ed->hdr->regex, key, 0, NULL, 0)) { + apr_table_add(ed->r->headers_out, key, val); } return 1; @@ -808,8 +810,7 @@ static int do_headers_fixup(request_rec *r, apr_table_t *headers, case hdr_echo: v.r = r; v.hdr = hdr; - apr_table_do((int (*) (void *, const char *, const char *)) - echo_header, (void *) &v, r->headers_in, NULL); + apr_table_do(echo_header, &v, r->headers_in, NULL); break; case hdr_edit: case hdr_edit_r: diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c index 9761e50669..c573f981a7 100644 --- a/modules/session/mod_session.c +++ b/modules/session/mod_session.c @@ -311,15 +311,16 @@ static apr_status_t ap_session_set(request_rec * r, session_rec * z, return APR_SUCCESS; } -static int identity_count(int *count, const char *key, const char *val) +static int identity_count(void *v, const char *key, const char *val) { + int *count = v; *count += strlen(key) * 3 + strlen(val) * 3 + 1; return 1; } -static int identity_concat(char *buffer, const char *key, const char *val) +static int identity_concat(void *v, const char *key, const char *val) { - char *slider = buffer; + char *slider = v; int length = strlen(slider); slider += length; if (length) { @@ -356,11 +357,9 @@ static apr_status_t session_identity_encode(request_rec * r, session_rec * z) char *expiry = apr_psprintf(z->pool, "%" APR_INT64_T_FMT, z->expiry); apr_table_setn(z->entries, SESSION_EXPIRY, expiry); } - apr_table_do((int (*) (void *, const char *, const char *)) - identity_count, &length, z->entries, NULL); + apr_table_do(identity_count, &length, z->entries, NULL); buffer = apr_pcalloc(r->pool, length + 1); - apr_table_do((int (*) (void *, const char *, const char *)) - identity_concat, buffer, z->entries, NULL); + apr_table_do(identity_concat, buffer, z->entries, NULL); z->encoded = buffer; return OK; 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 |