diff --git a/mod_http2/h2.h b/mod_http2/h2.h index 4127a734..29a31c1a 100644 --- a/mod_http2/h2.h +++ b/mod_http2/h2.h @@ -49,7 +49,7 @@ struct h2_stream; * The magic PRIamble of RFC 7540 that is always sent when starting * a h2 communication. */ -extern const char *H2_MAGIC_TOKEN; +extern const char *const H2_MAGIC_TOKEN; #define H2_ERR_NO_ERROR (0x00) #define H2_ERR_PROTOCOL_ERROR (0x01) diff --git a/mod_http2/h2_protocol.c b/mod_http2/h2_protocol.c index 874753e4..1d996419 100644 --- a/mod_http2/h2_protocol.c +++ b/mod_http2/h2_protocol.c @@ -45,15 +45,15 @@ #include "h2_protocol.h" #include "mod_http2.h" -const char *h2_protocol_ids_tls[] = { +const char *const h2_protocol_ids_tls[] = { "h2", NULL }; -const char *h2_protocol_ids_clear[] = { +const char *const h2_protocol_ids_clear[] = { "h2c", NULL }; -const char *H2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"; +const char *const H2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"; /******************************************************************************* * HTTP/2 error stuff diff --git a/mod_http2/h2_protocol.h b/mod_http2/h2_protocol.h index ed48e896..6b92fab2 100644 --- a/mod_http2/h2_protocol.h +++ b/mod_http2/h2_protocol.h @@ -21,13 +21,13 @@ * List of protocol identifiers that we support in cleartext * negotiations. NULL terminated. */ -extern const char *h2_protocol_ids_clear[]; +extern const char *const h2_protocol_ids_clear[]; /** * List of protocol identifiers that we support in TLS encrypted * negotiations (ALPN). NULL terminated. */ -extern const char *h2_protocol_ids_tls[]; +extern const char *const h2_protocol_ids_tls[]; /** * Provide a user readable description of the HTTP/2 error code- diff --git a/mod_http2/h2_session.c b/mod_http2/h2_session.c index 066c73ad..b376080b 100644 --- a/mod_http2/h2_session.c +++ b/mod_http2/h2_session.c @@ -1340,7 +1340,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 */ diff --git a/mod_http2/h2_switch.c b/mod_http2/h2_switch.c index 37997017..875dd4f2 100644 --- a/mod_http2/h2_switch.c +++ b/mod_http2/h2_switch.c @@ -56,7 +56,7 @@ static int h2_protocol_propose(conn_rec *c, request_rec *r, { int proposed = 0; int is_tls = ap_ssl_conn_is_ssl(c); - const char **protos = is_tls? h2_protocol_ids_tls : h2_protocol_ids_clear; + const char *const *protos = is_tls? h2_protocol_ids_tls : h2_protocol_ids_clear; if (!h2_mpm_supported()) { return DECLINED; @@ -155,8 +155,8 @@ static int h2_protocol_switch(conn_rec *c, request_rec *r, server_rec *s, const char *protocol) { int found = 0; - const char **protos = ap_ssl_conn_is_ssl(c)? h2_protocol_ids_tls : h2_protocol_ids_clear; - const char **p = protos; + const char *const *protos = ap_ssl_conn_is_ssl(c)? h2_protocol_ids_tls : h2_protocol_ids_clear; + const char *const *p = protos; (void)s; if (!h2_mpm_supported()) {