diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-13 20:47:37 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-13 20:47:37 -0700 |
commit | f4cc2f8fe42e4275cad7c29152e4a962647bef67 (patch) | |
tree | ee972396ba1b10898309136733e9c30d661f5e99 | |
parent | 317f68e5b28a62c30f176d991bc190210133c2a0 (diff) |
Fix inf loop
-rw-r--r-- | test/core/end2end/fuzzers/api_fuzzer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index ab3e42fe5a..1268260b59 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; |