From 5fcc5af0946fa0eb2b03146bb48afa91ceabe73c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 8 Feb 2017 15:22:05 -0800 Subject: [PATCH 1/3] Should only do host-->:authority if there is no :authority --- src/core/lib/channel/http_server_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index 3f992977c08..b475dd6b86d 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -198,10 +198,10 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx, GRPC_ERROR_STR_KEY, ":path")); } - if (b->idx.named.host != NULL) { + if (b->idx.named.host != NULL && b->idx.named.authority == NULL) { add_error( error_name, &error, - grpc_metadata_batch_substitute( + grpc_metadata_batch_add_head( exec_ctx, b, b->idx.named.host, grpc_mdelem_from_slices( exec_ctx, GRPC_MDSTR_AUTHORITY, From c15d25a9dbc44c26b0755bb5078920db57c8afd7 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 9 Feb 2017 21:22:22 -0800 Subject: [PATCH 2/3] Fix substitution --- src/core/lib/channel/http_server_filter.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index b475dd6b86d..bb185351a8e 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -199,13 +199,16 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx, } if (b->idx.named.host != NULL && b->idx.named.authority == NULL) { + grpc_linked_mdelem *el = b->idx.named.host; + grpc_mdelem md = GRPC_MDELEM_REF(el->md); + grpc_metadata_batch_remove(exec_ctx, b, el); add_error( error_name, &error, grpc_metadata_batch_add_head( - exec_ctx, b, b->idx.named.host, - grpc_mdelem_from_slices( - exec_ctx, GRPC_MDSTR_AUTHORITY, - grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.host->md))))); + exec_ctx, b, el, grpc_mdelem_from_slices( + exec_ctx, GRPC_MDSTR_AUTHORITY, + grpc_slice_ref_internal(GRPC_MDVALUE(md))))); + GRPC_MDELEM_UNREF(exec_ctx, md); } if (b->idx.named.authority == NULL) { From 37bfff35eeee1805a88b6ab5bbf91c434c52336e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 14 Feb 2017 22:35:39 -0800 Subject: [PATCH 3/3] Fix port server --- tools/run_tests/python_utils/start_port_server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/python_utils/start_port_server.py b/tools/run_tests/python_utils/start_port_server.py index d521aa6a9d9..8ee7080168a 100644 --- a/tools/run_tests/python_utils/start_port_server.py +++ b/tools/run_tests/python_utils/start_port_server.py @@ -36,6 +36,7 @@ import tempfile import sys import time import jobset +import socket def start_port_server(port_server_port): # check if a compatible port server is running