You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2016/08/30 19:23:57 UTC

svn commit: r1758446 - /httpd/httpd/trunk/modules/http2/h2_request.c

Author: jim
Date: Tue Aug 30 19:23:56 2016
New Revision: 1758446

URL: http://svn.apache.org/viewvc?rev=1758446&view=rev
Log:
Without AP_DEBUG_ASSERT, these could still be NULL during runtime

Modified:
    httpd/httpd/trunk/modules/http2/h2_request.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=1758446&r1=1758445&r2=1758446&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_request.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_request.c Tue Aug 30 19:23:56 2016
@@ -50,7 +50,7 @@ apr_status_t h2_request_rwrite(h2_reques
     
     scheme = apr_pstrdup(pool, r->parsed_uri.scheme? r->parsed_uri.scheme
               : ap_http_scheme(r));
-    authority = apr_pstrdup(pool, r->hostname);
+    authority = (r->hostname ? apr_pstrdup(pool, r->hostname) : "");
     if (!ap_strchr_c(authority, ':') && r->server && r->server->port) {
         apr_port_t defport = apr_uri_port_of_scheme(scheme);
         if (defport != r->server->port) {
@@ -248,6 +248,7 @@ request_rec *h2_request_create_rec(const
 {
     int access_status = HTTP_OK;    
     const char *expect;
+    const char *rpath;
 
     request_rec *r = ap_create_request(c);
 
@@ -264,12 +265,13 @@ request_rec *h2_request_create_rec(const
         r->header_only = 1;
     }
 
-    ap_parse_uri(r, req->path);
+    rpath = (req->path ? req->path : "");
+    ap_parse_uri(r, rpath);
     r->protocol = "HTTP/2.0";
     r->proto_num = HTTP_VERSION(2, 0);
 
     r->the_request = apr_psprintf(r->pool, "%s %s %s", 
-                                  r->method, req->path, r->protocol);
+                                  r->method, rpath, r->protocol);
     
     /* update what we think the virtual host is based on the headers we've
      * now read. may update status.