]> granicus.if.org Git - apache/commitdiff
fix for handling invalid proxy uris and code cleanup provided by Evgeny Kotkov
authorStefan Eissing <icing@apache.org>
Thu, 12 May 2016 15:12:59 +0000 (15:12 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 12 May 2016 15:12:59 +0000 (15:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1743517 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_proxy_session.c
modules/http2/mod_proxy_http2.c

index 28332456c2424c8b1661f9b556a6482de7b4be95..d78e3eb5e3d11ef52bf3371e09d8ab3c74dd2f13 100644 (file)
@@ -581,6 +581,7 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
     h2_proxy_stream *stream;
     apr_uri_t puri;
     const char *authority, *scheme, *path;
+    apr_status_t status;
 
     stream = apr_pcalloc(r->pool, sizeof(*stream));
 
@@ -595,7 +596,10 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
     
     stream->req = h2_req_create(1, stream->pool, 0);
 
-    apr_uri_parse(stream->pool, url, &puri);
+    status = apr_uri_parse(stream->pool, url, &puri);
+    if (status != APR_SUCCESS)
+        return status;
+
     scheme = (strcmp(puri.scheme, "h2")? "http" : "https");
     authority = puri.hostname;
     if (!ap_strchr_c(authority, ':') && puri.port
@@ -763,7 +767,7 @@ apr_status_t h2_proxy_session_submit(h2_proxy_session *session,
     apr_status_t status;
     
     status = open_stream(session, url, r, &stream);
-    if (status == OK) {
+    if (status == APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03381)
                       "process stream(%d): %s %s%s, original: %s", 
                       stream->id, stream->req->method, 
index 381b31a881961190ddaaadbee27ff43215a2722a..73a87a5d45fd43042e50117611e425dd2a011358 100644 (file)
@@ -259,7 +259,7 @@ static apr_status_t add_request(h2_proxy_session *session, request_rec *r)
     apr_table_setn(r->notes, "proxy-source-port", apr_psprintf(r->pool, "%hu",
                    ctx->p_conn->connection->local_addr->port));
     status = h2_proxy_session_submit(session, url, r);
-    if (status != OK) {
+    if (status != APR_SUCCESS) {
         ap_log_cerror(APLOG_MARK, APLOG_ERR, status, r->connection, APLOGNO(03351)
                       "pass request body failed to %pI (%s) from %s (%s)",
                       ctx->p_conn->addr, ctx->p_conn->hostname ?