]> granicus.if.org Git - apache/commitdiff
eliminating some stricter compiler warnings in mod_h2
authorStefan Eissing <icing@apache.org>
Wed, 2 Sep 2015 12:01:05 +0000 (12:01 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 2 Sep 2015 12:01:05 +0000 (12:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1700777 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_config.c
modules/http2/h2_io.c
modules/http2/h2_response.c
modules/http2/h2_session.c
modules/http2/h2_switch.c
modules/http2/h2_task.c
modules/http2/h2_task_output.c
modules/http2/h2_to_h1.c
modules/http2/h2_util.c

index 470f8c0fe4cf8bf6fbb99c192d7c07e3cecae252..883f273a38fe6c14d48b395ed4c5faeafdd93dbb 100644 (file)
@@ -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,
index 09fe5055a0cae0bfa39349f2de48ea7e9fbcb203..24d2a9feecddd2f233720ea173d34d55522946a4 100644 (file)
@@ -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)
index 502b376ef4b626b7e6fa9e62439cc90fbf70b8a9..9cedd855615549cf80e1c86d5f58cc13c7b5e34d 100644 (file)
@@ -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)
index 5b46838d94dd46145916ed9ebdc1a84d748c6cbb..26430e8869c96105cbeb5e7018445fd38be00e24 100644 (file)
@@ -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,
index 2b74debd3440832e4379f92c5cf8871c33fe5dc7..4f774959e17d7ef23a9b331caae1f38708b063ce 100644 (file)
@@ -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;
index e28dd25a3379d43922590dcc5c25ed2364d1d18a..26b8c6e40e84ac5e80a410a7a99d912c8789f74a 100644 (file)
@@ -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);
         
index 3b34490ff1936cc4fa110225bf0c9359d9ba5582..879cb5fa21b6f3358c108cbb06a15a4142a20eea 100644 (file)
@@ -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;
index bb913d5bb2246466e7c6907376f71b93d737b572..1e39aa6d80a1048bfbad4b003ae0624633b5d7f9 100644 (file)
@@ -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;
         }
index af0da706ba455938ad285f91f8aa65756bf33c82..c0c383797b466dce2720b53ecd1b383f6d4f2f24 100644 (file)
@@ -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);