Don't allow trailing metadata from the client.

Change on 2014/12/19 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82527952
pull/1/merge
ctiller 10 years ago committed by Michael Lumish
parent 7d4ec77c17
commit 186cdab82e
  1. 10
      src/core/surface/call.c

@ -296,8 +296,14 @@ grpc_call_error grpc_call_add_metadata(grpc_call *call, grpc_metadata *metadata,
grpc_call_element *elem;
grpc_call_op op;
if (call->state >= CALL_FINISHED) {
return GRPC_CALL_ERROR_ALREADY_FINISHED;
if (call->is_client) {
if (call->state >= CALL_STARTED) {
return GRPC_CALL_ERROR_ALREADY_INVOKED;
}
} else {
if (call->state >= CALL_FINISHED) {
return GRPC_CALL_ERROR_ALREADY_FINISHED;
}
}
op.type = GRPC_SEND_METADATA;

Loading…
Cancel
Save