From 3b66ab9f9e16dae7d006e3abac947e11a45d9002 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 9 Dec 2015 19:42:22 -0800 Subject: Window overflow test --- src/core/surface/call.c | 8 ++++---- src/core/transport/byte_stream.c | 6 +++--- src/core/transport/byte_stream.h | 4 ++-- src/core/transport/chttp2/frame_data.c | 2 +- src/core/transport/chttp2_transport.c | 24 +++++++++++++----------- 5 files changed, 23 insertions(+), 21 deletions(-) (limited to 'src/core') diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 84b9daaa28..79295ae0ff 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -367,7 +367,7 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, int success) { &c->metadata_batch[1 /* is_receiving */][i /* is_initial */]); } if (c->receiving_stream != NULL) { - grpc_byte_stream_destroy(c->receiving_stream); + grpc_byte_stream_destroy(exec_ctx, c->receiving_stream); } grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c)); GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, c->channel, "call"); @@ -951,7 +951,7 @@ static void continue_receiving_slices(grpc_exec_ctx *exec_ctx, (*call->receiving_buffer)->data.raw.slice_buffer.length; if (remaining == 0) { call->receiving_message = 0; - grpc_byte_stream_destroy(call->receiving_stream); + grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); call->receiving_stream = NULL; if (gpr_unref(&bctl->steps_to_complete)) { post_batch_completion(exec_ctx, bctl); @@ -1067,7 +1067,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, grpc_channel_get_max_message_length(call->channel)) { cancel_with_status(exec_ctx, call, GRPC_STATUS_INTERNAL, "Max message size exceeded"); - grpc_byte_stream_destroy(call->receiving_stream); + grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); call->receiving_stream = NULL; *call->receiving_buffer = NULL; if (gpr_unref(&bctl->steps_to_complete)) { @@ -1356,7 +1356,7 @@ done_with_error: } if (bctl->send_message) { call->sending_message = 0; - grpc_byte_stream_destroy(&call->sending_stream.base); + grpc_byte_stream_destroy(exec_ctx, &call->sending_stream.base); } if (bctl->send_final_op) { call->sent_final_op = 0; diff --git a/src/core/transport/byte_stream.c b/src/core/transport/byte_stream.c index 81e8e77ccb..4e8f589623 100644 --- a/src/core/transport/byte_stream.c +++ b/src/core/transport/byte_stream.c @@ -44,8 +44,8 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, on_complete); } -void grpc_byte_stream_destroy(grpc_byte_stream *byte_stream) { - byte_stream->destroy(byte_stream); +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { + byte_stream->destroy(exec_ctx, byte_stream); } /* slice_buffer_stream */ @@ -61,7 +61,7 @@ static int slice_buffer_stream_next(grpc_exec_ctx *exec_ctx, return 1; } -static void slice_buffer_stream_destroy(grpc_byte_stream *byte_stream) {} +static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) {} void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream, gpr_slice_buffer *slice_buffer, diff --git a/src/core/transport/byte_stream.h b/src/core/transport/byte_stream.h index c94d8ff275..558147f6f0 100644 --- a/src/core/transport/byte_stream.h +++ b/src/core/transport/byte_stream.h @@ -52,7 +52,7 @@ struct grpc_byte_stream { int (*next)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, gpr_slice *slice, size_t max_size_hint, grpc_closure *on_complete); - void (*destroy)(grpc_byte_stream *byte_stream); + void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); }; /* returns 1 if the bytes are available immediately (in which case @@ -72,7 +72,7 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, gpr_slice *slice, size_t max_size_hint, grpc_closure *on_complete); -void grpc_byte_stream_destroy(grpc_byte_stream *byte_stream); +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); /* grpc_byte_stream that wraps a slice buffer */ typedef struct grpc_slice_buffer_stream { diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c index 38fa990758..08cc760aba 100644 --- a/src/core/transport/chttp2/frame_data.c +++ b/src/core/transport/chttp2/frame_data.c @@ -57,7 +57,7 @@ void grpc_chttp2_data_parser_destroy(grpc_exec_ctx *exec_ctx, } while ( (bs = grpc_chttp2_incoming_frame_queue_pop(&parser->incoming_frames))) { - grpc_byte_stream_destroy(bs); + grpc_byte_stream_destroy(exec_ctx, bs); } } diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 3e88f69abf..cfaa96772c 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -529,7 +529,7 @@ static void destroy_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt, while ( (bs = grpc_chttp2_incoming_frame_queue_pop(&s->global.incoming_frames))) { - grpc_byte_stream_destroy(bs); + grpc_byte_stream_destroy(exec_ctx, bs); } GPR_ASSERT(s->global.send_initial_metadata_finished == NULL); @@ -992,7 +992,7 @@ static void check_read_ops(grpc_exec_ctx *exec_ctx, while (stream_global->seen_error && (bs = grpc_chttp2_incoming_frame_queue_pop( &stream_global->incoming_frames)) != NULL) { - grpc_byte_stream_destroy(bs); + grpc_byte_stream_destroy(exec_ctx, bs); } if (stream_global->incoming_frames.head == NULL) { grpc_chttp2_incoming_metadata_buffer_publish( @@ -1474,8 +1474,17 @@ static void incoming_byte_stream_unref(grpc_chttp2_incoming_byte_stream *bs) { } } -static void incoming_byte_stream_destroy(grpc_byte_stream *byte_stream) { - incoming_byte_stream_unref((grpc_chttp2_incoming_byte_stream *)byte_stream); +static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { + grpc_chttp2_incoming_byte_stream *incoming_byte_stream = + (grpc_chttp2_incoming_byte_stream *)byte_stream; + if (incoming_byte_stream->base.length == 0 && incoming_byte_stream->is_tail) { + lock(incoming_byte_stream->transport); + incoming_byte_stream_update_flow_control( + &incoming_byte_stream->transport->global, + &incoming_byte_stream->stream->global, 0, 0); + unlock(exec_ctx, incoming_byte_stream->transport); + } + incoming_byte_stream_unref(incoming_byte_stream); } void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx, @@ -1521,13 +1530,6 @@ grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create( add_to_queue->tail->next_message = incoming_byte_stream; } add_to_queue->tail = incoming_byte_stream; - if (frame_size == 0) { - lock(TRANSPORT_FROM_PARSING(transport_parsing)); - incoming_byte_stream_update_flow_control( - &TRANSPORT_FROM_PARSING(transport_parsing)->global, - &STREAM_FROM_PARSING(stream_parsing)->global, 0, 0); - unlock(exec_ctx, TRANSPORT_FROM_PARSING(transport_parsing)); - } return incoming_byte_stream; } -- cgit v1.2.3 From c8b7013be30f003e501e743cec856c739db3e160 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 9 Dec 2015 20:49:09 -0800 Subject: Fix flow control bug --- src/core/security/server_auth_filter.c | 2 +- src/core/transport/chttp2_transport.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/core') diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c index 5cfee6d139..d5c8c54369 100644 --- a/src/core/security/server_auth_filter.c +++ b/src/core/security/server_auth_filter.c @@ -140,7 +140,7 @@ static void on_md_processing_done( message = gpr_slice_from_copied_string(error_details); calld->transport_op.send_initial_metadata = NULL; if (calld->transport_op.send_message != NULL) { - grpc_byte_stream_destroy(calld->transport_op.send_message); + grpc_byte_stream_destroy(&exec_ctx, calld->transport_op.send_message); calld->transport_op.send_message = NULL; } calld->transport_op.send_trailing_metadata = NULL; diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index cfaa96772c..deb903324e 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -134,6 +134,11 @@ static void connectivity_state_set( static void check_read_ops(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global); +static void incoming_byte_stream_update_flow_control( + grpc_chttp2_transport_global *transport_global, + grpc_chttp2_stream_global *stream_global, size_t max_size_hint, + size_t have_already); + /* * CONSTRUCTION/DESTRUCTION/REFCOUNTING */ @@ -858,6 +863,9 @@ static void perform_stream_op_locked( GPR_ASSERT(stream_global->recv_message_ready == NULL); stream_global->recv_message_ready = op->recv_message_ready; stream_global->recv_message = op->recv_message; + if (stream_global->incoming_frames.head != NULL) { + incoming_byte_stream_update_flow_control(transport_global, stream_global, 5, 0); + } grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); } @@ -1475,16 +1483,7 @@ static void incoming_byte_stream_unref(grpc_chttp2_incoming_byte_stream *bs) { } static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { - grpc_chttp2_incoming_byte_stream *incoming_byte_stream = - (grpc_chttp2_incoming_byte_stream *)byte_stream; - if (incoming_byte_stream->base.length == 0 && incoming_byte_stream->is_tail) { - lock(incoming_byte_stream->transport); - incoming_byte_stream_update_flow_control( - &incoming_byte_stream->transport->global, - &incoming_byte_stream->stream->global, 0, 0); - unlock(exec_ctx, incoming_byte_stream->transport); - } - incoming_byte_stream_unref(incoming_byte_stream); + incoming_byte_stream_unref((grpc_chttp2_incoming_byte_stream *)byte_stream); } void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx, -- cgit v1.2.3 From e81ada40ce6d29333b3b1ba26c34a549f8db5c79 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 10 Dec 2015 08:40:52 -0800 Subject: Fix bugs? --- src/core/transport/chttp2_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index deb903324e..e5b0fa9f89 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -863,8 +863,8 @@ static void perform_stream_op_locked( GPR_ASSERT(stream_global->recv_message_ready == NULL); stream_global->recv_message_ready = op->recv_message_ready; stream_global->recv_message = op->recv_message; - if (stream_global->incoming_frames.head != NULL) { - incoming_byte_stream_update_flow_control(transport_global, stream_global, 5, 0); + if (stream_global->incoming_frames.head == NULL || stream_global->incoming_frames.head->is_tail) { + incoming_byte_stream_update_flow_control(transport_global, stream_global, transport_global->stream_lookahead, 0); } grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); } -- cgit v1.2.3 From e1b8c2b07bbf9fa0fae269bd0fe4d1e2ef451f1f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 16 Dec 2015 19:27:52 -0800 Subject: Fix merge --- src/core/surface/call.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/surface/call.c b/src/core/surface/call.c index b999ecd37c..e3fd7d564a 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -979,7 +979,7 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp, call->receiving_slice); continue_receiving_slices(exec_ctx, bctl); } else { - grpc_byte_stream_destroy(call->receiving_stream); + grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); call->receiving_stream = NULL; grpc_byte_buffer_destroy(*call->receiving_buffer); *call->receiving_buffer = NULL; -- cgit v1.2.3 From 8a09593639e797e609d7044e8230c2c2a73fcdcc Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 16 Dec 2015 19:40:49 -0800 Subject: Fix flow control for unstarted streams --- src/core/transport/chttp2_transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index fd6fbe1c21..4d1a5d9bcf 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -872,7 +872,9 @@ static void perform_stream_op_locked( GPR_ASSERT(stream_global->recv_message_ready == NULL); stream_global->recv_message_ready = op->recv_message_ready; stream_global->recv_message = op->recv_message; - if (stream_global->incoming_frames.head == NULL || stream_global->incoming_frames.head->is_tail) { + if (stream_global->id != 0 && + (stream_global->incoming_frames.head == NULL || + stream_global->incoming_frames.head->is_tail)) { incoming_byte_stream_update_flow_control(transport_global, stream_global, transport_global->stream_lookahead, 0); } grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); -- cgit v1.2.3 From a3f298ff67e8ee3ada117de136ea2469a146dc5e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 16 Dec 2015 19:42:09 -0800 Subject: clang-format --- src/core/surface/call.c | 4 ++-- src/core/transport/byte_stream.c | 6 ++++-- src/core/transport/byte_stream.h | 3 ++- src/core/transport/chttp2_transport.c | 14 +++++++++----- test/core/bad_client/tests/window_overflow.c | 28 +++++++++++----------------- test/core/bad_ssl/bad_ssl_test.c | 2 +- test/core/bad_ssl/server.c | 7 +++---- test/core/client_config/lb_policies_test.c | 21 +++++++++++---------- 8 files changed, 43 insertions(+), 42 deletions(-) (limited to 'src/core') diff --git a/src/core/surface/call.c b/src/core/surface/call.c index e3fd7d564a..73c1996908 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -1068,7 +1068,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, if (call->receiving_stream == NULL) { *call->receiving_buffer = NULL; - call->receiving_message = 0; + call->receiving_message = 0; if (gpr_unref(&bctl->steps_to_complete)) { post_batch_completion(exec_ctx, bctl); } @@ -1079,7 +1079,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); call->receiving_stream = NULL; *call->receiving_buffer = NULL; - call->receiving_message = 0; + call->receiving_message = 0; if (gpr_unref(&bctl->steps_to_complete)) { post_batch_completion(exec_ctx, bctl); } diff --git a/src/core/transport/byte_stream.c b/src/core/transport/byte_stream.c index 4e8f589623..89e20489e7 100644 --- a/src/core/transport/byte_stream.c +++ b/src/core/transport/byte_stream.c @@ -44,7 +44,8 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, on_complete); } -void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) { byte_stream->destroy(exec_ctx, byte_stream); } @@ -61,7 +62,8 @@ static int slice_buffer_stream_next(grpc_exec_ctx *exec_ctx, return 1; } -static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) {} +static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) {} void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream, gpr_slice_buffer *slice_buffer, diff --git a/src/core/transport/byte_stream.h b/src/core/transport/byte_stream.h index 558147f6f0..5f2fe573e8 100644 --- a/src/core/transport/byte_stream.h +++ b/src/core/transport/byte_stream.h @@ -72,7 +72,8 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, gpr_slice *slice, size_t max_size_hint, grpc_closure *on_complete); -void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream); /* grpc_byte_stream that wraps a slice buffer */ typedef struct grpc_slice_buffer_stream { diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 4d1a5d9bcf..3bb23ff03f 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -139,7 +139,7 @@ static void incoming_byte_stream_update_flow_control( grpc_chttp2_stream_global *stream_global, size_t max_size_hint, size_t have_already); -static void fail_pending_writes(grpc_exec_ctx *exec_ctx, +static void fail_pending_writes(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream_global *stream_global); /* @@ -647,7 +647,8 @@ void grpc_chttp2_terminate_writing(grpc_exec_ctx *exec_ctx, grpc_chttp2_cleanup_writing(exec_ctx, &t->global, &t->writing); - while (grpc_chttp2_list_pop_closed_waiting_for_writing(&t->global, &stream_global)) { + while (grpc_chttp2_list_pop_closed_waiting_for_writing(&t->global, + &stream_global)) { fail_pending_writes(exec_ctx, stream_global); GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream_global, "finish_writes"); } @@ -875,7 +876,9 @@ static void perform_stream_op_locked( if (stream_global->id != 0 && (stream_global->incoming_frames.head == NULL || stream_global->incoming_frames.head->is_tail)) { - incoming_byte_stream_update_flow_control(transport_global, stream_global, transport_global->stream_lookahead, 0); + incoming_byte_stream_update_flow_control( + transport_global, stream_global, transport_global->stream_lookahead, + 0); } grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); } @@ -1132,7 +1135,7 @@ void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, } } -static void fail_pending_writes(grpc_exec_ctx *exec_ctx, +static void fail_pending_writes(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream_global *stream_global) { grpc_chttp2_complete_closure_step( exec_ctx, &stream_global->send_initial_metadata_finished, 0); @@ -1538,7 +1541,8 @@ static void incoming_byte_stream_unref(grpc_chttp2_incoming_byte_stream *bs) { } } -static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { +static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) { incoming_byte_stream_unref((grpc_chttp2_incoming_byte_stream *)byte_stream); } diff --git a/test/core/bad_client/tests/window_overflow.c b/test/core/bad_client/tests/window_overflow.c index 37a3228285..1c898f352d 100644 --- a/test/core/bad_client/tests/window_overflow.c +++ b/test/core/bad_client/tests/window_overflow.c @@ -52,11 +52,13 @@ "\x10\x0c" \ "content-type\x10" \ "application/grpc" \ - "\x10\x14grpc-accept-encoding\x15""deflate,identity,gzip" \ + "\x10\x14grpc-accept-encoding\x15" \ + "deflate,identity,gzip" \ "\x10\x02te\x08trailers" \ "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" -static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { +static void verifier(grpc_server *server, grpc_completion_queue *cq, + void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), @@ -80,28 +82,20 @@ static void addbuf(const void *data, size_t len) { int main(int argc, char **argv) { int i, j; #define MAX_FRAME_SIZE 16384 -#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE/5) -#define FRAME_SIZE (MESSAGES_PER_FRAME*5) -#define SEND_SIZE (100*1024) +#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE / 5) +#define FRAME_SIZE (MESSAGES_PER_FRAME * 5) +#define SEND_SIZE (100 * 1024) #define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1) grpc_test_init(argc, argv); addbuf(PFX_STR, sizeof(PFX_STR) - 1); for (i = 0; i < NUM_FRAMES; i++) { - gpr_uint8 hdr[9] = { - (gpr_uint8)(FRAME_SIZE >> 16), - (gpr_uint8)(FRAME_SIZE >> 8), - (gpr_uint8)FRAME_SIZE, - 0, - 0, - 0, - 0, - 0, - 1 - }; + gpr_uint8 hdr[9] = {(gpr_uint8)(FRAME_SIZE >> 16), + (gpr_uint8)(FRAME_SIZE >> 8), (gpr_uint8)FRAME_SIZE, 0, + 0, 0, 0, 0, 1}; addbuf(hdr, sizeof(hdr)); for (j = 0; j < MESSAGES_PER_FRAME; j++) { - gpr_uint8 message[5] = {0,0,0,0,0}; + gpr_uint8 message[5] = {0, 0, 0, 0, 0}; addbuf(message, sizeof(message)); } } diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index 54ac6d0e1c..08ab482c58 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) { grpc_shutdown(); } gpr_free(args[2]); - + gpr_subprocess_interrupt(svr); status = gpr_subprocess_join(svr); gpr_subprocess_destroy(svr); diff --git a/test/core/bad_ssl/server.c b/test/core/bad_ssl/server.c index 2ed94de099..6113d364c9 100644 --- a/test/core/bad_ssl/server.c +++ b/test/core/bad_ssl/server.c @@ -74,9 +74,8 @@ void bad_ssl_run(grpc_server *server) { grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); - error = - grpc_server_request_call(server, &s, &call_details, - &request_metadata_recv, cq, cq, (void*)1); + error = grpc_server_request_call(server, &s, &call_details, + &request_metadata_recv, cq, cq, (void *)1); GPR_ASSERT(GRPC_CALL_OK == error); signal(SIGINT, sigint_handler); @@ -96,7 +95,7 @@ void bad_ssl_run(grpc_server *server) { NULL); switch (ev.type) { case GRPC_OP_COMPLETE: - GPR_ASSERT(ev.tag == (void*)1); + GPR_ASSERT(ev.tag == (void *)1); GPR_ASSERT(ev.success == 0); break; case GRPC_QUEUE_SHUTDOWN: diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index c088fe2c09..5f6166cbb5 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -137,9 +137,8 @@ static void kill_server(const servers_fixture *f, size_t i) { gpr_log(GPR_INFO, "KILLING SERVER %d", i); GPR_ASSERT(f->servers[i] != NULL); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); - GPR_ASSERT( - grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) - .type == GRPC_OP_COMPLETE); + GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), + NULL).type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); f->servers[i] = NULL; } @@ -205,8 +204,8 @@ static void teardown_servers(servers_fixture *f) { if (f->servers[i] == NULL) continue; grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), - n_millis_time(5000), NULL) - .type == GRPC_OP_COMPLETE); + n_millis_time(5000), + NULL).type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); } grpc_completion_queue_shutdown(f->cq); @@ -304,8 +303,8 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, s_idx = -1; while ((ev = grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)) - .type != GRPC_QUEUE_TIMEOUT) { + f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)).type != + GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(gpr_intptr)ev.tag); gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d", @@ -377,8 +376,9 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, } } - GPR_ASSERT(grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(200), NULL).type == GRPC_QUEUE_TIMEOUT); + GPR_ASSERT(grpc_completion_queue_next(f->cq, + GRPC_TIMEOUT_MILLIS_TO_DEADLINE(200), + NULL).type == GRPC_QUEUE_TIMEOUT); grpc_metadata_array_destroy(&rdata->initial_metadata_recv); grpc_metadata_array_destroy(&rdata->trailing_metadata_recv); @@ -800,7 +800,8 @@ static void verify_rebirth_round_robin(const servers_fixture *f, const size_t expected_seq_length = f->num_servers; int *seen_elements; - dump_array("actual_connection_sequence", actual_connection_sequence, num_iters); + dump_array("actual_connection_sequence", actual_connection_sequence, + num_iters); /* verify conn. seq. expectation */ /* get the first unique run of length "num_servers". */ -- cgit v1.2.3