From: Stefan Eissing Date: Wed, 2 Sep 2015 12:01:05 +0000 (+0000) Subject: eliminating some stricter compiler warnings in mod_h2 X-Git-Tag: 2.5.0-alpha~2879 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab08a1563a5fb967592ac0db0bf876059ec13710;p=apache eliminating some stricter compiler warnings in mod_h2 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1700777 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_config.c b/modules/http2/h2_config.c index 470f8c0fe4..883f273a38 100644 --- a/modules/http2/h2_config.c +++ b/modules/http2/h2_config.c @@ -332,7 +332,8 @@ static const char *h2_conf_set_direct(cmd_parms *parms, return "value must be On or Off"; } -#define AP_END_CMD { NULL } +#define AP_END_CMD AP_INIT_TAKE1(NULL, NULL, NULL, RSRC_CONF, NULL) + const command_rec h2_cmds[] = { AP_INIT_TAKE1("H2MaxSessionStreams", h2_conf_set_max_streams, NULL, diff --git a/modules/http2/h2_io.c b/modules/http2/h2_io.c index 09fe5055a0..24d2a9feec 100644 --- a/modules/http2/h2_io.c +++ b/modules/http2/h2_io.c @@ -40,6 +40,7 @@ h2_io *h2_io_create(int id, apr_pool_t *pool, apr_bucket_alloc_t *bucket_alloc) static void h2_io_cleanup(h2_io *io) { + (void)io; } void h2_io_destroy(h2_io *io) diff --git a/modules/http2/h2_response.c b/modules/http2/h2_response.c index 502b376ef4..9cedd85561 100644 --- a/modules/http2/h2_response.c +++ b/modules/http2/h2_response.c @@ -118,6 +118,7 @@ h2_response *h2_response_rcreate(int stream_id, request_rec *r, void h2_response_destroy(h2_response *response) { + (void)response; } h2_response *h2_response_copy(apr_pool_t *pool, h2_response *from) diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c index 5b46838d94..26430e8869 100644 --- a/modules/http2/h2_session.c +++ b/modules/http2/h2_session.c @@ -99,6 +99,8 @@ static ssize_t send_cb(nghttp2_session *ngh2, h2_session *session = (h2_session *)userp; apr_status_t status = send_data(session, (const char *)data, length); + (void)ngh2; + (void)flags; if (status == APR_SUCCESS) { return length; } @@ -140,6 +142,7 @@ static int on_data_chunk_recv_cb(nghttp2_session *ngh2, uint8_t flags, h2_stream * stream; apr_status_t status; + (void)flags; if (session->aborted) { return NGHTTP2_ERR_CALLBACK_FAILURE; } @@ -234,6 +237,7 @@ static int on_stream_close_cb(nghttp2_session *ngh2, int32_t stream_id, h2_session *session = (h2_session *)userp; h2_stream *stream; + (void)ngh2; if (session->aborted) { return NGHTTP2_ERR_CALLBACK_FAILURE; } @@ -255,6 +259,7 @@ static int on_begin_headers_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, void *userp) { /* This starts a new stream. */ + (void)ngh2; int rv = stream_open((h2_session *)userp, frame->hd.stream_id); if (rv != NGHTTP2_ERR_CALLBACK_FAILURE) { /* on_header_cb or on_frame_recv_cb will dectect that stream @@ -274,6 +279,8 @@ static int on_header_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, h2_stream * stream; apr_status_t status; + (void)ngh2; + (void)flags; if (session->aborted) { return NGHTTP2_ERR_CALLBACK_FAILURE; } @@ -1018,6 +1025,9 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s, h2_stream *stream; AP_DEBUG_ASSERT(session); + (void)ng2s; + (void)buf; + (void)source; stream = h2_stream_set_get(session->streams, stream_id); if (!stream) { ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_NOTFOUND, session->c, diff --git a/modules/http2/h2_switch.c b/modules/http2/h2_switch.c index 2b74debd34..4f774959e1 100644 --- a/modules/http2/h2_switch.c +++ b/modules/http2/h2_switch.c @@ -65,6 +65,7 @@ static int h2_protocol_propose(conn_rec *c, request_rec *r, int proposed = 0; const char **protos = h2_h2_is_tls(c)? h2_tls_protos : h2_clear_protos; + (void)s; if (strcmp(AP_PROTOCOL_HTTP1, ap_get_protocol(c))) { /* We do not know how to switch from anything else but http/1.1. */ @@ -125,6 +126,7 @@ static int h2_protocol_switch(conn_rec *c, request_rec *r, server_rec *s, const char **protos = h2_h2_is_tls(c)? h2_tls_protos : h2_clear_protos; const char **p = protos; + (void)s; while (*p) { if (!strcmp(*p, protocol)) { found = 1; diff --git a/modules/http2/h2_task.c b/modules/http2/h2_task.c index e28dd25a33..26b8c6e40e 100644 --- a/modules/http2/h2_task.c +++ b/modules/http2/h2_task.c @@ -116,6 +116,8 @@ static int h2_task_pre_conn(conn_rec* c, void *arg) { h2_ctx *ctx = h2_ctx_get(c); + + (void)arg; if (h2_ctx_is_task(ctx)) { h2_task_env *env = h2_ctx_get_task(ctx); diff --git a/modules/http2/h2_task_output.c b/modules/http2/h2_task_output.c index 3b34490ff1..879cb5fa21 100644 --- a/modules/http2/h2_task_output.c +++ b/modules/http2/h2_task_output.c @@ -37,6 +37,8 @@ h2_task_output *h2_task_output_create(h2_task_env *env, apr_pool_t *pool, apr_bucket_alloc_t *bucket_alloc) { h2_task_output *output = apr_pcalloc(pool, sizeof(h2_task_output)); + + (void)bucket_alloc; if (output) { output->env = env; output->state = H2_TASK_OUT_INIT; diff --git a/modules/http2/h2_to_h1.c b/modules/http2/h2_to_h1.c index bb913d5bb2..1e39aa6d80 100644 --- a/modules/http2/h2_to_h1.c +++ b/modules/http2/h2_to_h1.c @@ -120,11 +120,13 @@ apr_status_t h2_to_h1_add_header(h2_to_h1 *to_h1, else if (H2_HD_MATCH_LIT("cookie", name, nlen)) { const char *existing = apr_table_get(to_h1->headers, "cookie"); if (existing) { + char *nval; + /* Cookie headers come separately in HTTP/2, but need * to be merged by "; " (instead of default ", ") */ - char *hvalue = apr_pstrndup(to_h1->pool, value, vlen); - char *nval = apr_psprintf(to_h1->pool, "%s; %s", existing, hvalue); + hvalue = apr_pstrndup(to_h1->pool, value, vlen); + nval = apr_psprintf(to_h1->pool, "%s; %s", existing, hvalue); apr_table_setn(to_h1->headers, "Cookie", nval); return APR_SUCCESS; } diff --git a/modules/http2/h2_util.c b/modules/http2/h2_util.c index af0da706ba..c0c383797b 100644 --- a/modules/http2/h2_util.c +++ b/modules/http2/h2_util.c @@ -410,7 +410,8 @@ apr_status_t h2_util_copy(apr_bucket_brigade *to, apr_bucket_brigade *from, { apr_status_t status = APR_SUCCESS; int same_alloc; - + + (void)msg; AP_DEBUG_ASSERT(to); AP_DEBUG_ASSERT(from); same_alloc = (to->bucket_alloc == from->bucket_alloc);