From 0f670e10aeda83ac067570cb78aa0ce2c93e8e2b Mon Sep 17 00:00:00 2001 From: Tom Early Date: Thu, 12 Mar 2020 13:41:47 -0700 Subject: [PATCH] fixed return value of get_yrcall_rptr() --- QnetGateway.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/QnetGateway.cpp b/QnetGateway.cpp index c4c56a3..f120eb2 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -554,25 +554,24 @@ int CQnetGateway::get_yrcall_rptr(const std::string &call, std::string &rptr, st return 0; /* at this point, the data is not in cache */ - if (ii[i]->getConnectionState() > 5) { - /* request data from irc server */ + int cstate = ii[i]->getConnectionState(); + if (cstate < 6) { + return 0; + } else { + // we can try a find if (RoU == 'U') { printf("User [%s] not in local cache, try again\n", call.c_str()); /*** YRCALL=KJ4NHFBL ***/ if (((call.at(6) == 'A') || (call.at(6) == 'B') || (call.at(6) == 'C')) && (call.at(7) == 'L')) printf("If this was a gateway link request, that is ok\n"); - - if (!ii[i]->findUser(call)) { + if (!ii[i]->findUser(call)) printf("findUser(%s): Network error\n", call.c_str()); - return 0; - } } else if (RoU == 'R') { printf("Repeater [%s] not in local cache, try again\n", call.c_str()); - if (!ii[i]->findRepeater(call)) { + if (!ii[i]->findRepeater(call)) printf("findRepeater(%s): Network error\n", call.c_str()); - return 0; - } } + return 0; } return i + 1; }