]> granicus.if.org Git - apache/commitdiff
mod_h2 compiles warning free in maintainer-mode
authorStefan Eissing <icing@apache.org>
Wed, 19 Aug 2015 14:13:49 +0000 (14:13 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 19 Aug 2015 14:13:49 +0000 (14:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1696592 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_alt_svc.c
modules/http2/h2_conn.c
modules/http2/h2_from_h1.c
modules/http2/h2_request.c
modules/http2/h2_switch.c

index 9db208149e90359eb148ec492cf6a5199f6cf225..ab1d726484ddddc1133725e08803ed6d4ed1f0f3 100644 (file)
@@ -42,13 +42,13 @@ void h2_alt_svc_register_hooks(void)
  * - do not use quotation marks
  */
 h2_alt_svc *h2_alt_svc_parse(const char *s, apr_pool_t *pool) {
-    const char *sep = strchr(s, '=');
+    const char *sep = strchr((char *)s, '=');
     if (sep) {
         const char *alpn = apr_pstrndup(pool, s, sep - s);
         const char *host = NULL;
         int port = 0;
         s = sep + 1;
-        sep = strchr(s, ':');  /* mandatory : */
+        sep = strchr((char *)s, ':');  /* mandatory : */
         if (sep) {
             if (sep != s) {    /* optional host */
                 host = apr_pstrndup(pool, s, sep - s);
index 1d4d704ecc7207435936c2dc37214672640b1bf7..df1de9e7d33ee5b1c956ccfc1b0640c89f0123e1 100644 (file)
@@ -132,7 +132,7 @@ h2_mpm_type_t h2_conn_mpm_type(void) {
     return mpm_type;
 }
 
-module *h2_conn_mpm_module(void) {
+static module *h2_conn_mpm_module(void) {
     check_modules();
     return mpm_module;
 }
@@ -366,7 +366,6 @@ conn_rec *h2_conn_create(conn_rec *master, apr_pool_t *pool)
 apr_status_t h2_conn_setup(h2_task_env *env, struct h2_worker *worker)
 {
     conn_rec *master = env->mplx->c;
-    h2_config *cfg = h2_config_get(master);
     
     ap_log_perror(APLOG_MARK, APLOG_TRACE3, 0, env->pool,
                   "h2_conn(%ld): created from master", master->id);
index a382f3311ad071fac452ecf9d40f11b8fd84d8b2..be11f5c317e9f742809aadbf320e715e6f5ab576 100644 (file)
@@ -313,86 +313,6 @@ static void fix_vary(request_rec *r)
     }
 }
 
-/* Confirm that the status line is well-formed and matches r->status.
- * If they don't match, a filter may have negated the status line set by a
- * handler.
- * Zap r->status_line if bad.
- */
-static apr_status_t validate_status_line(request_rec *r)
-{
-    char *end;
-    
-    if (r->status_line) {
-        apr_size_t len = strlen(r->status_line);
-        if (len < 3
-            || apr_strtoi64(r->status_line, &end, 10) != r->status
-            || (end - 3) != r->status_line
-            || (len >= 4 && ! apr_isspace(r->status_line[3]))) {
-            r->status_line = NULL;
-            return APR_EGENERAL;
-        }
-        /* Since we passed the above check, we know that length three
-         * is equivalent to only a 3 digit numeric http status.
-         * RFC2616 mandates a trailing space, let's add it.
-         */
-        if (len == 3) {
-            r->status_line = apr_pstrcat(r->pool, r->status_line, " ", NULL);
-            return APR_EGENERAL;
-        }
-        return APR_SUCCESS;
-    }
-    return APR_EGENERAL;
-}
-
-/*
- * Determine the protocol to use for the response. Potentially downgrade
- * to HTTP/1.0 in some situations and/or turn off keepalives.
- *
- * also prepare r->status_line.
- */
-static void basic_http_header_check(request_rec *r,
-                                    const char **protocol)
-{
-    apr_status_t rv;
-    
-    if (r->assbackwards) {
-        /* no such thing as a response protocol */
-        return;
-    }
-    
-    rv = validate_status_line(r);
-    
-    if (!r->status_line) {
-        r->status_line = ap_get_status_line(r->status);
-    } else if (rv != APR_SUCCESS) {
-        /* Status line is OK but our own reason phrase
-         * would be preferred if defined
-         */
-        const char *tmp = ap_get_status_line(r->status);
-        if (!strncmp(tmp, r->status_line, 3)) {
-            r->status_line = tmp;
-        }
-    }
-    
-    /* Note that we must downgrade before checking for force responses. */
-    if (r->proto_num > HTTP_VERSION(1,0)
-        && apr_table_get(r->subprocess_env, "downgrade-1.0")) {
-        r->proto_num = HTTP_VERSION(1,0);
-    }
-    
-    /* kludge around broken browsers when indicated by force-response-1.0
-     */
-    if (r->proto_num == HTTP_VERSION(1,0)
-        && apr_table_get(r->subprocess_env, "force-response-1.0")) {
-        *protocol = "HTTP/1.0";
-        r->connection->keepalive = AP_CONN_CLOSE;
-    }
-    else {
-        *protocol = AP_SERVER_PROTOCOL;
-    }
-    
-}
-
 static void set_basic_http_header(request_rec *r, apr_table_t *headers)
 {
     char *date = NULL;
@@ -444,7 +364,6 @@ static int copy_header(void *ctx, const char *name, const char *value)
 
 static h2_response *create_response(h2_from_h1 *from_h1, request_rec *r)
 {
-    apr_status_t status = APR_SUCCESS;
     const char *clheader;
     const char *ctype;
     apr_table_t *headers;
index 5653a40233ed32c5ea3a3c3698387897d9cf4ca3..83fa08560003dfcff65e07c06d31afbca8793fbe 100644 (file)
@@ -58,7 +58,7 @@ apr_status_t h2_request_rwrite(h2_request *req, request_rec *r, h2_mplx *m)
     req->method = r->method;
     req->authority = r->hostname;
     req->path = r->uri;
-    if (!strchr(req->authority, ':') && r->parsed_uri.port_str) {
+    if (!strchr((char *)req->authority, ':') && r->parsed_uri.port_str) {
         req->authority = apr_psprintf(req->pool, "%s:%s", req->authority,
                                       r->parsed_uri.port_str);
     }
index ae138ace44fb0fc227c7ef57276b3a9c0475825e..68db770adff177b66c0408b5e98dcac37f73b78b 100644 (file)
@@ -57,9 +57,6 @@ apr_status_t h2_switch_init(apr_pool_t *pool, server_rec *s)
     return APR_SUCCESS;
 }
 
-static const char *const mod_ssl[]        = { "mod_ssl.c", NULL};
-static const char *const mod_core[]       = { "core.c", NULL};
-
 static int h2_protocol_propose(conn_rec *c, request_rec *r,
                                server_rec *s,
                                const apr_array_header_t *offers,