|
|
|
@ -246,9 +246,8 @@ static int fill_send_ops(grpc_call *call, grpc_transport_op *op); |
|
|
|
|
static void execute_op(grpc_call *call, grpc_transport_op *op); |
|
|
|
|
static void recv_metadata(grpc_call *call, grpc_metadata_batch *metadata); |
|
|
|
|
static void finish_read_ops(grpc_call *call); |
|
|
|
|
static grpc_call_error grpc_call_cancel_with_status_internal(grpc_call *c, |
|
|
|
|
grpc_status_code status, |
|
|
|
|
const char *description, |
|
|
|
|
static grpc_call_error grpc_call_cancel_with_status_internal( |
|
|
|
|
grpc_call *c, grpc_status_code status, const char *description, |
|
|
|
|
gpr_uint8 locked); |
|
|
|
|
|
|
|
|
|
grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq, |
|
|
|
@ -631,7 +630,8 @@ static int begin_message(grpc_call *call, grpc_begin_message msg) { |
|
|
|
|
gpr_asprintf( |
|
|
|
|
&message, "Message terminated early; read %d bytes, expected %d", |
|
|
|
|
(int)call->incoming_message.length, (int)call->incoming_message_length); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, |
|
|
|
|
message, 1); |
|
|
|
|
gpr_free(message); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -642,7 +642,8 @@ static int begin_message(grpc_call *call, grpc_begin_message msg) { |
|
|
|
|
&message, |
|
|
|
|
"Maximum message length of %d exceeded by a message of length %d", |
|
|
|
|
grpc_channel_get_max_message_length(call->channel), msg.length); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, |
|
|
|
|
message, 1); |
|
|
|
|
gpr_free(message); |
|
|
|
|
return 0; |
|
|
|
|
} else if (msg.length > 0) { |
|
|
|
@ -675,7 +676,8 @@ static int add_slice_to_message(grpc_call *call, gpr_slice slice) { |
|
|
|
|
gpr_asprintf( |
|
|
|
|
&message, "Receiving message overflow; read %d bytes, expected %d", |
|
|
|
|
(int)call->incoming_message.length, (int)call->incoming_message_length); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1); |
|
|
|
|
grpc_call_cancel_with_status_internal(call, GRPC_STATUS_INVALID_ARGUMENT, |
|
|
|
|
message, 1); |
|
|
|
|
gpr_free(message); |
|
|
|
|
return 0; |
|
|
|
|
} else if (call->incoming_message.length == call->incoming_message_length) { |
|
|
|
@ -1003,9 +1005,8 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call *c, |
|
|
|
|
return grpc_call_cancel_with_status_internal(c, status, description, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static grpc_call_error grpc_call_cancel_with_status_internal(grpc_call *c, |
|
|
|
|
grpc_status_code status, |
|
|
|
|
const char *description, |
|
|
|
|
static grpc_call_error grpc_call_cancel_with_status_internal( |
|
|
|
|
grpc_call *c, grpc_status_code status, const char *description, |
|
|
|
|
gpr_uint8 locked) { |
|
|
|
|
grpc_transport_op op; |
|
|
|
|
grpc_mdstr *details = |
|
|
|
|