httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1714557 - in /httpd/httpd/trunk/modules/http2: h2_request.c h2_util.c
Date Mon, 16 Nov 2015 11:23:38 GMT
Author: icing
Date: Mon Nov 16 11:23:38 2015
New Revision: 1714557

URL: http://svn.apache.org/viewvc?rev=1714557&view=rev
Log:
fixing h2c scheme/authority initialization

Modified:
    httpd/httpd/trunk/modules/http2/h2_request.c
    httpd/httpd/trunk/modules/http2/h2_util.c

Modified: httpd/httpd/trunk/modules/http2/h2_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_request.c?rev=1714557&r1=1714556&r2=1714557&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_request.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_request.c Mon Nov 16 11:23:38 2015
@@ -19,6 +19,7 @@
 
 #include <httpd.h>
 #include <http_core.h>
+#include <http_protocol.h>
 #include <http_config.h>
 #include <http_log.h>
 
@@ -134,22 +135,28 @@ apr_status_t h2_request_rwrite(h2_reques
     apr_status_t status;
     
     req->method    = r->method;
-    req->authority = r->hostname;
-    req->path      = r->uri;
     req->scheme    = (r->parsed_uri.scheme? r->parsed_uri.scheme
-                      : r->server->server_scheme);
-    
-    if (!ap_strchr_c(req->authority, ':') && r->parsed_uri.port_str) {
-        req->authority = apr_psprintf(r->pool, "%s:%s", req->authority,
-                                      r->parsed_uri.port_str);
+                      : ap_http_scheme(r));
+    req->authority = r->hostname;
+    req->path      = apr_uri_unparse(r->pool, &r->parsed_uri, 
+                                     APR_URI_UNP_OMITSITEPART);
+
+    if (!ap_strchr_c(req->authority, ':') && r->server) {
+        req->authority = apr_psprintf(r->pool, "%s:%d", req->authority,
+                                      (int)r->server->port);
     }
     
+    AP_DEBUG_ASSERT(req->scheme);
+    AP_DEBUG_ASSERT(req->authority);
+    AP_DEBUG_ASSERT(req->path);
+    AP_DEBUG_ASSERT(req->method);
+
     status = add_all_h1_header(req, r->pool, r->headers_in);
 
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
                   "h2_request(%d): rwrite %s host=%s://%s%s",
                   req->id, req->method, req->scheme, req->authority, req->path);
-    
+                  
     return status;
 }
 

Modified: httpd/httpd/trunk/modules/http2/h2_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_util.c?rev=1714557&r1=1714556&r2=1714557&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_util.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_util.c Mon Nov 16 11:23:38 2015
@@ -867,6 +867,10 @@ h2_ngheader *h2_util_ngheader_make_req(a
     size_t n;
     
     AP_DEBUG_ASSERT(req);
+    AP_DEBUG_ASSERT(req->scheme);
+    AP_DEBUG_ASSERT(req->authority);
+    AP_DEBUG_ASSERT(req->path);
+    AP_DEBUG_ASSERT(req->method);
 
     n = 4;
     apr_table_do(count_header, &n, req->headers, NULL);



Mime
View raw message