From fc603f11cec77fc0633a06efb60fb0bc43e86671 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Tue, 18 Apr 2023 20:00:40 +0300 Subject: [PATCH] in the port busy check, for tcp only the local port is now checked --- client/core/servercontroller.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index e18b11b34..58f1fd3c5 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -662,6 +662,14 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential } if (!stdOut.isEmpty()) { + if (transportProto == "tcp") { + const static QRegularExpression localPortRegExp(".*:(\\d+)->"); + QRegularExpressionMatch localPortMatch = localPortRegExp.match(stdOut); + if (localPortMatch.hasMatch() && localPortMatch.captured(1) != port) { + return ErrorCode::NoError; + } + } + return ErrorCode::ServerPortAlreadyAllocatedError; } return ErrorCode::NoError;