diff options
Diffstat (limited to 'test/core/end2end/bad_server_response_test.c')
-rw-r--r-- | test/core/end2end/bad_server_response_test.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index 9a3e1301f9..1c4a17fda8 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -40,13 +40,14 @@ #include <string.h> #include <grpc/grpc.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/host_port.h> #include <grpc/support/log.h> -#include <grpc/support/slice.h> #include <grpc/support/thd.h> -// #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/util/port.h" @@ -88,8 +89,8 @@ struct rpc_state { grpc_channel *channel; grpc_call *call; size_t incoming_data_length; - gpr_slice_buffer temp_incoming_buffer; - gpr_slice_buffer outgoing_buffer; + grpc_slice_buffer temp_incoming_buffer; + grpc_slice_buffer outgoing_buffer; grpc_endpoint *tcp; gpr_atm done_atm; bool write_done; @@ -111,11 +112,11 @@ static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { } static void handle_write(grpc_exec_ctx *exec_ctx) { - gpr_slice slice = gpr_slice_from_copied_buffer(state.response_payload, - state.response_payload_length); + grpc_slice slice = grpc_slice_from_copied_buffer( + state.response_payload, state.response_payload_length); - gpr_slice_buffer_reset_and_unref(&state.outgoing_buffer); - gpr_slice_buffer_add(&state.outgoing_buffer, slice); + grpc_slice_buffer_reset_and_unref(&state.outgoing_buffer); + grpc_slice_buffer_add(&state.outgoing_buffer, slice); grpc_endpoint_write(exec_ctx, state.tcp, &state.outgoing_buffer, &on_write); } @@ -125,8 +126,8 @@ static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { size_t i; for (i = 0; i < state.temp_incoming_buffer.count; i++) { - char *dump = gpr_dump_slice(state.temp_incoming_buffer.slices[i], - GPR_DUMP_HEX | GPR_DUMP_ASCII); + char *dump = grpc_dump_slice(state.temp_incoming_buffer.slices[i], + GPR_DUMP_HEX | GPR_DUMP_ASCII); gpr_log(GPR_DEBUG, "Server received: %s", dump); gpr_free(dump); } @@ -147,8 +148,8 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, test_tcp_server *server = arg; grpc_closure_init(&on_read, handle_read, NULL); grpc_closure_init(&on_write, done_write, NULL); - gpr_slice_buffer_init(&state.temp_incoming_buffer); - gpr_slice_buffer_init(&state.outgoing_buffer); + grpc_slice_buffer_init(&state.temp_incoming_buffer); + grpc_slice_buffer_init(&state.outgoing_buffer); state.tcp = tcp; state.incoming_data_length = 0; grpc_endpoint_add_to_pollset(exec_ctx, tcp, server->pollset); @@ -227,8 +228,8 @@ static void start_rpc(int target_port, grpc_status_code expected_status, static void cleanup_rpc(void) { grpc_event ev; - gpr_slice_buffer_destroy(&state.temp_incoming_buffer); - gpr_slice_buffer_destroy(&state.outgoing_buffer); + grpc_slice_buffer_destroy(&state.temp_incoming_buffer); + grpc_slice_buffer_destroy(&state.outgoing_buffer); grpc_call_destroy(state.call); grpc_completion_queue_shutdown(state.cq); do { |