aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-14 15:01:29 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-14 15:01:29 -0800
commit38edec66067fc737ffd61f66972dc29ccd68fce3 (patch)
treed28220df38a892bb8fdeb2114390d5313155ad0d /src/core/surface
parent6cb69172c1dff9c772997c7baa45bf44a8bc5299 (diff)
Fix server side handling of incoming partial requests in core
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/call.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index f857b66e5e..d170dbf68e 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -974,11 +974,19 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
batch_control *bctl = bctlp;
grpc_call *call = bctl->call;
- GPR_ASSERT(success);
- gpr_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
- call->receiving_slice);
-
- continue_receiving_slices(exec_ctx, bctl);
+ if (success) {
+ gpr_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
+ call->receiving_slice);
+ continue_receiving_slices(exec_ctx, bctl);
+ } else {
+ grpc_byte_stream_destroy(call->receiving_stream);
+ call->receiving_stream = NULL;
+ grpc_byte_buffer_destroy(*call->receiving_buffer);
+ *call->receiving_buffer = NULL;
+ if (gpr_unref(&bctl->steps_to_complete)) {
+ post_batch_completion(exec_ctx, bctl);
+ }
+ }
}
static void finish_batch(grpc_exec_ctx *exec_ctx, void *bctlp, int success) {