]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) Constify static arrays of string constants.
authorJim Jagielski <jim@apache.org>
Thu, 2 Jul 2026 19:54:30 +0000 (19:54 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 2 Jul 2026 19:54:30 +0000 (19:54 +0000)
     trunk patch: https://svn.apache.org/r1933659

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935817 13f79535-47bb-0310-9956-ffa450edef68

14 files changed:
STATUS
modules/cache/mod_cache.c
modules/filters/mod_proxy_html.c
modules/http2/h2_protocol.c
modules/http2/h2_proxy_session.c
modules/http2/h2_session.c
modules/loggers/mod_logio.c
modules/mappers/mod_speling.c
modules/md/md_log.c
modules/md/md_store.c
modules/proxy/ajp_header.c
modules/proxy/mod_proxy_http.c
modules/ssl/mod_ssl.c
server/protocol.c

diff --git a/STATUS b/STATUS
index 183006a7686987cd3f52078b857fab0a6e901508..f0b832b0890d720e02e62144ea4536cce29a0c43 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -163,11 +163,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Constify static arrays of string constants.
-     trunk patch: https://svn.apache.org/r1933659
-     2.4.x patch: svn merge -c 1933659 ^/httpd/httpd/trunk .
-     +1: rjung, jorton, jim
-
   *) include/httpd.h: Define HTTP_EARLY_HINTS (103) per RFC 8297.
      modules/http/http_protocol.c (status_lines): Add 103 response.
      Needed by backport 1934913 below.
index 3b4469ef79c18529504d1feed621ffd12be61903..9392e770435220a06c080f881c879c0719e63df5 100644 (file)
@@ -39,7 +39,7 @@ static ap_filter_rec_t *cache_invalidate_filter_handle;
 /**
  * Entity headers' names
  */
-static const char *MOD_CACHE_ENTITY_HEADERS[] = {
+static const char *const MOD_CACHE_ENTITY_HEADERS[] = {
     "Allow",
     "Content-Encoding",
     "Content-Language",
@@ -819,7 +819,7 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
     apr_time_t exp, date, lastmod, now;
     apr_off_t size = -1;
     cache_info *info = NULL;
-    const char *reason, **eh;
+    const char *reason, *const *eh;
     apr_pool_t *p;
     apr_bucket *e;
     apr_table_t *headers;
index f05ba1e158e04de233022178989c921cc083875a..c629614037ad53e45ada74e862072cce1f11447f 100644 (file)
@@ -1304,7 +1304,7 @@ static void proxy_html_insert(request_rec *r)
 }
 static void proxy_html_hooks(apr_pool_t *p)
 {
-    static const char *aszSucc[] = { "mod_filter.c", NULL };
+    static const char *const aszSucc[] = { "mod_filter.c", NULL };
     ap_register_output_filter_protocol("proxy-html", proxy_html_filter,
                                        NULL, AP_FTYPE_RESOURCE,
                           AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH);
index 874753e4983e1aba8326136574e4d98b6b11222f..84a17ef8948d1d00c0a9d5299a7e8c3bca6d00a6 100644 (file)
@@ -58,7 +58,7 @@ const char *H2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
 /*******************************************************************************
  * HTTP/2 error stuff
  */
-static const char *h2_err_descr[] = {
+static const char *const h2_err_descr[] = {
     "no error",                    /* 0x0 */
     "protocol error",
     "internal error",
@@ -91,7 +91,7 @@ const char *h2_protocol_err_description(unsigned int h2_error)
  * Black Listed Ciphers from RFC 7549 Appendix A
  *
  */
-static const char *RFC7540_names[] = {
+static const char *const RFC7540_names[] = {
     /* ciphers with NULL encrpytion */
     "NULL-MD5",                         /* TLS_NULL_WITH_NULL_NULL */
     /* same */                          /* TLS_RSA_WITH_NULL_MD5 */
index 3561c241e1beef7614db07a0ad4d084332f8879d..166b6468f1da9cae6e0b865757c862052b352ec3 100644 (file)
@@ -1188,7 +1188,7 @@ static apr_status_t session_shutdown(h2_proxy_session *session, int reason,
 }
 
 
-static const char *StateNames[] = {
+static const char *const StateNames[] = {
     "INIT",      /* H2_PROXYS_ST_INIT */
     "DONE",      /* H2_PROXYS_ST_DONE */
     "IDLE",      /* H2_PROXYS_ST_IDLE */
index dda6c77178b89437bb89ca97525ced273bcdf090..3affaf2a206b61adc3401c66a910dac1d5aa6810 100644 (file)
@@ -1416,7 +1416,7 @@ static void on_stream_output(void *ctx, h2_stream *stream)
 }
 
 
-static const char *StateNames[] = {
+static const char *const StateNames[] = {
     "INIT",      /* H2_SESSION_ST_INIT */
     "DONE",      /* H2_SESSION_ST_DONE */
     "IDLE",      /* H2_SESSION_ST_IDLE */
index b609f7f270fadfcf78d3d0d70dcfd3d5f6887acd..4c764ed3f3789439a874421daac08766a74df623 100644 (file)
@@ -254,7 +254,7 @@ static const command_rec logio_cmds[] = {
 
 static void register_hooks(apr_pool_t *p)
 {
-    static const char *pre[] = { "mod_log_config.c", NULL };
+    static const char *const pre[] = { "mod_log_config.c", NULL };
 
     ap_hook_pre_connection(logio_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_pre_config(logio_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
index 2ed65eb81015265cfb58e04ba9fdfe417c367d42..99b8765416aa0718f57fe1a2313500a46056046c 100644 (file)
@@ -125,7 +125,7 @@ typedef enum {
     SP_VERYDIFFERENT = 6
 } sp_reason;
 
-static const char *sp_reason_str[] =
+static const char *const sp_reason_str[] =
 {
     "identical",
     "miscapitalized",
index d236e0f08825e13f1850ace0091ae2cbc2b74e77..1b85b3db1663216aa9da5530ac3121cd5f877553 100644 (file)
@@ -22,7 +22,7 @@
 
 #define LOG_BUFFER_LEN  1024
 
-static const char *level_names[] = {
+static const char *const level_names[] = {
     "emergency",
     "alert",
     "crit",
index 5ed0848f991c0df3946862cd8ee7db11d6b610c2..381bbbc4a2f5a3370834168e4256314fa4a5bb82 100644 (file)
@@ -47,7 +47,7 @@
 #define GNAME_STAGING      
 #define GNAME_ARCHIVE      
 
-static const char *GROUP_NAME[] = {
+static const char *const GROUP_NAME[] = {
     "none",
     "accounts",
     "challenges",
index 334d0aebb12b4b6bdd57cb5f48b4a098712f8484..af2f27b24153e63e1e56a086b08aa56599c46666 100644 (file)
@@ -21,7 +21,7 @@
 
 APLOG_USE_MODULE(proxy_ajp);
 
-static const char *response_trans_headers[] = {
+static const char *const response_trans_headers[] = {
     "Content-Type",
     "Content-Language",
     "Content-Length",
index bd57b4d9363b9852b01175937e497b75b2fbf623..9ab7147a65611537ce424b511159567c546e1e18 100644 (file)
@@ -772,7 +772,7 @@ static request_rec *make_fake_req(conn_rec *c, request_rec *r)
 static void process_proxy_header(request_rec *r, proxy_dir_conf *c,
                                  const char *key, const char *value)
 {
-    static const char *date_hdrs[]
+    static const char *const date_hdrs[]
         = { "Date", "Expires", "Last-Modified", NULL };
     static const struct {
         const char *name;
@@ -1038,7 +1038,7 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
     int pread_len = 0;
     apr_table_t *save_table;
     int backend_broke = 0;
-    static const char *hop_by_hop_hdrs[] =
+    static const char *const hop_by_hop_hdrs[] =
         {"Keep-Alive", "Proxy-Authenticate", "TE", "Trailer", "Upgrade", NULL};
     int i;
     const char *te = NULL;
index c0fdafd58213ca6bfd6837a5ea73350fb5744c18..c04cc148c923a96cdce3d6b7c42f0e9584ecd195 100644 (file)
@@ -714,12 +714,12 @@ static void ssl_register_hooks(apr_pool_t *p)
 {
     /* ssl_hook_ReadReq needs to use the BrowserMatch settings so must
      * run after mod_setenvif's post_read_request hook. */
-    static const char *pre_prr[] = { "mod_setenvif.c", NULL };
+    static const char *const pre_prr[] = { "mod_setenvif.c", NULL };
     /* The ssl_init_Module post_config hook should run before mod_proxy's
      * for the ssl proxy main configs to be merged with vhosts' before being
      * themselves merged with mod_proxy's in proxy_hook_section_post_config.
      */
-    static const char *b_pc[] = { "mod_proxy.c", NULL};
+    static const char *const b_pc[] = { "mod_proxy.c", NULL};
 
 
     ssl_io_filter_register(p);
index 6f9540ad1de34aedc4458580296febe71d6288b5..3a989cfb04fd77271e73374f43e13d5730b5c761 100644 (file)
@@ -76,7 +76,7 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_old_write_func = NULL;
 
 
 /* Patterns to match in ap_make_content_type() */
-static const char *needcset[] = {
+static const char *const needcset[] = {
     "text/plain",
     "text/html",
     NULL