Merge pull request #223 from amnezia-vpn/bugfix/tcp-port-busy-check
in the port busy check, for tcp only the local port is now checked
This commit is contained in:
commit
97e322ba22
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue