From f6fe4e2f09ea7712a4e947e44f3d79d75b5ebed4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 5 Jun 2026 16:54:38 +0000 Subject: [PATCH] * modules/proxy/mod_proxy_beacon.c (beacon_resolve, beacon_parse_url, beacon_verify): Use ap_strstr_c and ap_strchr_c for const-correct string searches, fixing -Werror=discarded-qualifiers errors. Assisted-by: Claude Opus 4.6 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935040 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy_beacon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/proxy/mod_proxy_beacon.c b/modules/proxy/mod_proxy_beacon.c index a0c9567ca5..3cbbd0dd35 100644 --- a/modules/proxy/mod_proxy_beacon.c +++ b/modules/proxy/mod_proxy_beacon.c @@ -415,7 +415,7 @@ static apr_status_t beacon_resolve(apr_pool_t *p, const char *url, if (url && *url) { const char *hostport = url, *sep; - if ((sep = strstr(url, "://")) != NULL) { + if ((sep = ap_strstr_c(url, "://")) != NULL) { hostport = sep + 3; } rv = apr_parse_addr_port(&host, &scope, &port, hostport, p); @@ -877,7 +877,7 @@ static int beacon_parse_url(const char *msg, char *buf, apr_size_t buflen) return (i > 0); } /* advance to the next space-separated token */ - p = strchr(p, ' '); + p = ap_strchr_c(p, ' '); if (p) { p++; } @@ -940,7 +940,7 @@ static int beacon_verify(beacon_ctx_t *ctx, const char *msg, apr_time_t now, apr_int64_t ts, skew, delta; /* Locate the last " mac=" -- the MAC covers everything before it. */ - for (p = msg; (p = strstr(p, " mac=")) != NULL; p += 5) { + for (p = msg; (p = ap_strstr_c(p, " mac=")) != NULL; p += 5) { macp = p; } if (!macp) { @@ -971,7 +971,7 @@ static int beacon_verify(beacon_ctx_t *ctx, const char *msg, apr_time_t now, * less than a second apart still have strictly-increasing timestamps for * the caller's per-url check. */ tsp = NULL; - for (p = msg; (p = strstr(p, "ts=")) != NULL && p < macp; p += 3) { + for (p = msg; (p = ap_strstr_c(p, "ts=")) != NULL && p < macp; p += 3) { /* token-start: beginning of message or preceded by a space */ if (p == msg || *(p - 1) == ' ') { tsp = p; -- 2.47.3