diff options
author | Makdharma <makarandd@google.com> | 2016-08-26 16:01:20 -0700 |
---|---|---|
committer | Makdharma <makarandd@google.com> | 2016-08-26 16:01:20 -0700 |
commit | 4e520597e54a8b78fddbb91e360d8657468d0a38 (patch) | |
tree | 8b24e92a71f225d69ea2a184f9dc2116d92fa387 | |
parent | b30545299865654835b2b0aeea5a61420f36f189 (diff) |
fixed bug exposed by h2_proxy* test.
-rw-r--r-- | src/core/lib/channel/http_client_filter.c | 2 | ||||
-rw-r--r-- | src/core/lib/channel/http_server_filter.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c index d40bd204d7..0d3f416861 100644 --- a/src/core/lib/channel/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -217,7 +217,7 @@ static void hc_mutate_op(grpc_call_element *elem, op->recv_initial_metadata_ready = &calld->hc_on_recv; } - if (op->on_complete != NULL) { + if (op->on_complete != NULL && op->send_message != NULL) { calld->on_complete = op->on_complete; op->on_complete = &calld->hc_on_complete; } diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index a767af57e9..26a232bd7b 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -251,11 +251,6 @@ static void hs_mutate_op(grpc_call_element *elem, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC); } - if (op->on_complete) { - calld->on_complete = op->on_complete; - op->on_complete = &calld->hs_on_complete; - } - if (op->recv_initial_metadata) { /* substitute our callback for the higher callback */ GPR_ASSERT(op->recv_idempotent_request != NULL); @@ -271,6 +266,10 @@ static void hs_mutate_op(grpc_call_element *elem, if (op->recv_message_ready) { op->recv_message_ready = &calld->hs_recv_message_ready; } + if (op->on_complete) { + calld->on_complete = op->on_complete; + op->on_complete = &calld->hs_on_complete; + } } } |