You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2015/07/22 16:44:06 UTC

svn commit: r1692285 - in /httpd/httpd/trunk/modules/http2: h2_config.c h2_from_h1.c h2_from_h1.h h2_h2.c h2_task_output.c h2_task_output.h

Author: icing
Date: Wed Jul 22 14:44:06 2015
New Revision: 1692285

URL: http://svn.apache.org/r1692285
Log:
renamed H2InitialWindowSize to H2WindowSize, fixed post_read registration to be really first to install necessary response parsing filters

Modified:
    httpd/httpd/trunk/modules/http2/h2_config.c
    httpd/httpd/trunk/modules/http2/h2_from_h1.c
    httpd/httpd/trunk/modules/http2/h2_from_h1.h
    httpd/httpd/trunk/modules/http2/h2_h2.c
    httpd/httpd/trunk/modules/http2/h2_task_output.c
    httpd/httpd/trunk/modules/http2/h2_task_output.h

Modified: httpd/httpd/trunk/modules/http2/h2_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_config.c?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_config.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_config.c Wed Jul 22 14:44:06 2015
@@ -429,8 +429,8 @@ const command_rec h2_cmds[] = {
                   RSRC_CONF, "on to enable HTTP/2 protocol handling"),
     AP_INIT_TAKE1("H2MaxSessionStreams", h2_conf_set_max_streams, NULL,
                   RSRC_CONF, "maximum number of open streams per session"),
-    AP_INIT_TAKE1("H2InitialWindowSize", h2_conf_set_window_size, NULL,
-                  RSRC_CONF, "initial window size on client DATA"),
+    AP_INIT_TAKE1("H2WindowSize", h2_conf_set_window_size, NULL,
+                  RSRC_CONF, "window size on client DATA"),
     AP_INIT_TAKE1("H2MaxHeaderListSize", h2_conf_set_max_hl_size, NULL, 
                   RSRC_CONF, "maximum acceptable size of request headers"),
     AP_INIT_TAKE1("H2MinWorkers", h2_conf_set_min_workers, NULL,

Modified: httpd/httpd/trunk/modules/http2/h2_from_h1.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_from_h1.c?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_from_h1.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_from_h1.c Wed Jul 22 14:44:06 2015
@@ -648,9 +648,3 @@ apr_status_t h2_response_output_filter(a
     }
     return ap_pass_brigade(f->next, bb);
 }
-
-void h2_from_h1_die(h2_from_h1 *from_h1, int status, request_rec *r)
-{
-    r->status = status;
-    from_h1->response = create_response(from_h1, r);
-}

Modified: httpd/httpd/trunk/modules/http2/h2_from_h1.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_from_h1.h?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_from_h1.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_from_h1.h Wed Jul 22 14:44:06 2015
@@ -75,8 +75,6 @@ apr_status_t h2_from_h1_read_response(h2
 
 struct h2_response *h2_from_h1_get_response(h2_from_h1 *from_h1);
 
-void h2_from_h1_die(h2_from_h1 *from_h1, int status, request_rec *r);
-
 h2_from_h1_state_t h2_from_h1_get_state(h2_from_h1 *from_h1);
 
 apr_status_t h2_response_output_filter(ap_filter_t *f, apr_bucket_brigade *bb);

Modified: httpd/httpd/trunk/modules/http2/h2_h2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_h2.c?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_h2.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_h2.c Wed Jul 22 14:44:06 2015
@@ -117,6 +117,12 @@ void h2_h2_register_hooks(void)
                                mod_reqtimeout, NULL, APR_HOOK_LAST);
     
     ap_hook_post_read_request(h2_h2_post_read_req, NULL, NULL, APR_HOOK_MIDDLE);
+    /* With "H2SerializeHeaders On", we install the filter in this hook
+     * that parses the response. This needs to happen before any other post
+     * read function terminates the request with an error. Otherwise we will
+     * never see the response.
+     */
+    ap_hook_post_read_request(h2_h2_post_read_req, NULL, NULL, APR_HOOK_REALLY_FIRST);
 }
 
 int h2_h2_remove_timeout(conn_rec* c)
@@ -214,12 +220,14 @@ static int h2_h2_post_read_req(request_r
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                       "adding h1_to_h2_resp output filter");
         if (env->serialize_headers) {
+            ap_remove_output_filter_byhandle(r->output_filters, "H1_TO_H2_RESP");
             ap_add_output_filter("H1_TO_H2_RESP", env, r, r->connection);
         }
         else {
             /* replace the core http filter that formats response headers
              * in HTTP/1 with our own that collects status and headers */
             ap_remove_output_filter_byhandle(r->output_filters, "HTTP_HEADER");
+            ap_remove_output_filter_byhandle(r->output_filters, "H2_RESPONSE");
             ap_add_output_filter("H2_RESPONSE", env, r, r->connection);
         }
     }

Modified: httpd/httpd/trunk/modules/http2/h2_task_output.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_output.c?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_output.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_output.c Wed Jul 22 14:44:06 2015
@@ -128,7 +128,3 @@ apr_status_t h2_task_output_write(h2_tas
                              f, bb, output->env->io);
 }
 
-void h2_task_output_die(h2_task_output *output, int status, request_rec *r)
-{
-    h2_from_h1_die(output->from_h1, status, r);
-}

Modified: httpd/httpd/trunk/modules/http2/h2_task_output.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_output.h?rev=1692285&r1=1692284&r2=1692285&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_output.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_output.h Wed Jul 22 14:44:06 2015
@@ -53,6 +53,4 @@ void h2_task_output_close(h2_task_output
 
 int h2_task_output_has_started(h2_task_output *output);
 
-void h2_task_output_die(h2_task_output *output, int status, request_rec *r);
-
 #endif /* defined(__mod_h2__h2_task_output__) */