From c28dac1647cdee4cb1ff2d009551689c1bfd905a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 17 Feb 2019 10:25:40 -0800 Subject: fixes #857 NNG_OPT_REQ_RESENDTIME does not honor NNG_DURATION_INFINITE --- src/protocol/reqrep0/req.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/protocol/reqrep0/req.c') diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c index 69ef27f2..010ee8a6 100644 --- a/src/protocol/reqrep0/req.c +++ b/src/protocol/reqrep0/req.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -515,8 +515,12 @@ req0_run_sendq(req0_sock *s, nni_list *aiolist) // Schedule a resubmit timer. We only do this if we got // a pipe to send to. Otherwise, we should get handled - // the next time that the sendq is run. - nni_timer_schedule(&ctx->timer, nni_clock() + ctx->retry); + // the next time that the sendq is run. We don't do this + // if the retry is "disabled" with NNG_DURATION_INFINITE. + if (ctx->retry > 0) { + nni_timer_schedule( + &ctx->timer, nni_clock() + ctx->retry); + } if (nni_msg_dup(&msg, ctx->reqmsg) != 0) { // Oops. Well, keep trying each context; maybe -- cgit v1.2.3-70-g09d2