From f4cc2f8fe42e4275cad7c29152e4a962647bef67 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 13 Apr 2016 20:47:37 -0700 Subject: [PATCH] Fix inf loop --- test/core/end2end/fuzzers/api_fuzzer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index ab3e42fe5aa..1268260b595 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -199,7 +199,10 @@ typedef struct { static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, bool success) { future_connect *fc = arg; - if (g_server) { + if (!success) { + *fc->ep = NULL; + grpc_exec_ctx_enqueue(exec_ctx, fc->closure, false, NULL); + } else if (g_server != NULL) { abort(); } else { sched_connect(exec_ctx, fc->closure, fc->ep, fc->deadline); @@ -208,7 +211,7 @@ static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, bool success) { } static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep, gpr_timespec deadline) { - if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0) { + if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) <= 0) { *ep = NULL; grpc_exec_ctx_enqueue(exec_ctx, closure, false, NULL); return;