aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/fling
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2017-05-11 23:24:37 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2017-05-11 23:24:37 +0200
commiteb36b8ac7700d43ec9dadfffbfa83d0540cbdb27 (patch)
tree24f8d3bd3640dd95a470c52bd718fc8fcb5b087c /test/core/fling
parent0444d98f17c7e742be1463e5714a24cd2eb6f99e (diff)
parent45b89fb11ca3cd524787aeba7a1270f744a1256c (diff)
Merge branch 'master' of https://github.com/grpc/grpc into import
Diffstat (limited to 'test/core/fling')
-rw-r--r--test/core/fling/client.c6
-rw-r--r--test/core/fling/server.c21
2 files changed, 17 insertions, 10 deletions
diff --git a/test/core/fling/client.c b/test/core/fling/client.c
index 85bab6d431..3c43f4311c 100644
--- a/test/core/fling/client.c
+++ b/test/core/fling/client.c
@@ -99,7 +99,7 @@ static void step_ping_pong_request(void) {
(size_t)(op - ops),
(void *)1, NULL));
grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
- grpc_call_destroy(call);
+ grpc_call_unref(call);
grpc_byte_buffer_destroy(response_payload_recv);
call = NULL;
GPR_TIMER_END("ping_pong", 1);
@@ -208,7 +208,7 @@ int main(int argc, char **argv) {
}
channel = grpc_insecure_channel_create(target, NULL, NULL);
- cq = grpc_completion_queue_create(NULL);
+ cq = grpc_completion_queue_create_for_next(NULL);
the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size);
histogram = gpr_histogram_create(0.01, 60e9);
@@ -233,7 +233,7 @@ int main(int argc, char **argv) {
grpc_profiler_stop();
if (call) {
- grpc_call_destroy(call);
+ grpc_call_unref(call);
}
grpc_channel_destroy(channel);
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
index 7ea54b1167..a927e9014a 100644
--- a/test/core/fling/server.c
+++ b/test/core/fling/server.c
@@ -185,6 +185,7 @@ int main(int argc, char **argv) {
call_state *s;
char *addr_buf = NULL;
gpr_cmdline *cl;
+ grpc_completion_queue *shutdown_cq;
int shutdown_started = 0;
int shutdown_finished = 0;
@@ -214,7 +215,7 @@ int main(int argc, char **argv) {
}
gpr_log(GPR_INFO, "creating server on: %s", addr);
- cq = grpc_completion_queue_create(NULL);
+ cq = grpc_completion_queue_create_for_next(NULL);
if (secure) {
grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
test_server1_cert};
@@ -242,10 +243,16 @@ int main(int argc, char **argv) {
while (!shutdown_finished) {
if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT");
- grpc_server_shutdown_and_notify(server, cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(
- cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL)
- .type == GRPC_OP_COMPLETE);
+
+ shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
+
+ GPR_ASSERT(
+ grpc_completion_queue_pluck(shutdown_cq, tag(1000),
+ grpc_timeout_seconds_to_deadline(5), NULL)
+ .type == GRPC_OP_COMPLETE);
+ grpc_completion_queue_destroy(shutdown_cq);
+
grpc_completion_queue_shutdown(cq);
shutdown_started = 1;
}
@@ -294,7 +301,7 @@ int main(int argc, char **argv) {
break;
case FLING_SERVER_SEND_STATUS_FOR_STREAMING:
/* Send status and close completed at server */
- grpc_call_destroy(call);
+ grpc_call_unref(call);
if (!shutdown_started) request_call();
break;
case FLING_SERVER_READ_FOR_UNARY:
@@ -307,7 +314,7 @@ int main(int argc, char **argv) {
/* Finished unary call. */
grpc_byte_buffer_destroy(payload_buffer);
payload_buffer = NULL;
- grpc_call_destroy(call);
+ grpc_call_unref(call);
if (!shutdown_started) request_call();
break;
}