From 951971881165fad65f99f7b0ca821eea0ce25d23 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Tue, 29 Aug 2017 11:31:00 -0700 Subject: [PATCH] Documentation change + e2e test fix --- src/core/lib/transport/byte_stream.h | 4 +++- test/core/end2end/tests/cancel_after_round_trip.c | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h index 1e1e8310b83..be2a35213e3 100644 --- a/src/core/lib/transport/byte_stream.h +++ b/src/core/lib/transport/byte_stream.h @@ -81,7 +81,9 @@ void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, // grpc_slice_buffer_stream // -// A grpc_byte_stream that wraps a slice buffer. +// A grpc_byte_stream that wraps a slice buffer. The stream takes +// ownership of the slices in the buffer, and on destruction will +// reset the contents of the buffer. typedef struct grpc_slice_buffer_stream { grpc_byte_stream base; diff --git a/test/core/end2end/tests/cancel_after_round_trip.c b/test/core/end2end/tests/cancel_after_round_trip.c index 0fc8b95ef72..ad24b4e5387 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.c +++ b/test/core/end2end/tests/cancel_after_round_trip.c @@ -114,7 +114,9 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer *response_payload1 = + grpc_raw_byte_buffer_create(&response_payload_slice, 1); + grpc_byte_buffer *response_payload2 = grpc_raw_byte_buffer_create(&response_payload_slice, 1); int was_cancelled = 2; @@ -199,7 +201,7 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message.send_message = response_payload; + op->data.send_message.send_message = response_payload1; op->flags = 0; op->reserved = NULL; op++; @@ -242,7 +244,7 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message.send_message = response_payload; + op->data.send_message.send_message = response_payload2; op->flags = 0; op->reserved = NULL; op++; @@ -262,7 +264,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, grpc_call_details_destroy(&call_details); grpc_byte_buffer_destroy(request_payload); - grpc_byte_buffer_destroy(response_payload); + grpc_byte_buffer_destroy(response_payload1); + grpc_byte_buffer_destroy(response_payload2); grpc_byte_buffer_destroy(request_payload_recv); grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details);