diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-22 08:28:56 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-22 08:28:56 -0700 |
commit | 466458745c690537528a619e4d39157159fa3d43 (patch) | |
tree | 283a4649a2aecf3cd610900280015e2757542bee /src/core/channel | |
parent | f9dd54c2ebd1eeba572d3264a41c352884608e8e (diff) | |
parent | 13a71120f7cc1c1bc2811dc269bceff2f1f93047 (diff) |
Merge pull request #3387 from dgquintas/content_type_filtering
Client now swallows content-type on receive
Diffstat (limited to 'src/core/channel')
-rw-r--r-- | src/core/channel/http_client_filter.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/channel/http_client_filter.c b/src/core/channel/http_client_filter.c index ec832a0367..5f20f8c16d 100644 --- a/src/core/channel/http_client_filter.c +++ b/src/core/channel/http_client_filter.c @@ -70,7 +70,7 @@ typedef struct channel_data { /* used to silence 'variable not used' warnings */ static void ignore_unused(void *ignored) {} -static grpc_mdelem *client_filter(void *user_data, grpc_mdelem *md) { +static grpc_mdelem *client_recv_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; channel_data *channeld = elem->channel_data; if (md == channeld->status) { @@ -78,6 +78,8 @@ static grpc_mdelem *client_filter(void *user_data, grpc_mdelem *md) { } else if (md->key == channeld->status->key) { grpc_call_element_send_cancel(elem); return NULL; + } else if (md->key == channeld->content_type->key) { + return NULL; } return md; } @@ -92,11 +94,13 @@ static void hc_on_recv(void *user_data, int success) { grpc_stream_op *op = &ops[i]; if (op->type != GRPC_OP_METADATA) continue; calld->got_initial_metadata = 1; - grpc_metadata_batch_filter(&op->data.metadata, client_filter, elem); + grpc_metadata_batch_filter(&op->data.metadata, client_recv_filter, elem); } calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); } + + static grpc_mdelem *client_strip_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; channel_data *channeld = elem->channel_data; |