svn commit: r1935040 - httpd/httpd/trunk/modules/proxy

[email protected] Fri, 05 Jun 2026 16:54:38 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178067847888.3206763.14990665188959319991@svn03-he-fi>
Author: jorton
Date: Fri Jun  5 16:54:38 2026
New Revision: 1935040

Log:
* 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 <[email protected]>

Modified:
   httpd/httpd/trunk/modules/proxy/mod_proxy_beacon.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_beacon.c
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_beacon.c	Fri Jun  5 16:38:04 2026	(r1935039)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_beacon.c	Fri Jun  5 16:54:38 2026	(r1935040)
@@ -415,7 +415,7 @@ static apr_status_t beacon_resolve(apr_p
 
     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 *
             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 *c
     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 *c
      * 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;