mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-04 00:36:36 +00:00
Use LiStringifyPortFlags() instead of coding it ourselves
This commit is contained in:
parent
c414e1a168
commit
0b56b1685a
@ -158,26 +158,9 @@ public:
|
|||||||
emit connectionTestCompleted(-1, QString());
|
emit connectionTestCompleted(-1, QString());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString blockedPorts;
|
char blockedPorts[512];
|
||||||
|
LiStringifyPortFlags(portTestResult, "\n", blockedPorts, sizeof(blockedPorts));
|
||||||
for (int i = 0; i < 32; i++) {
|
emit connectionTestCompleted(portTestResult, QString(blockedPorts));
|
||||||
if (portTestResult & (1 << i)) {
|
|
||||||
if (!blockedPorts.isEmpty()) {
|
|
||||||
blockedPorts += "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LiGetProtocolFromPortFlagIndex(i) == 17 /* IPPROTO_UDP */) {
|
|
||||||
blockedPorts += "UDP ";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
blockedPorts += "TCP ";
|
|
||||||
}
|
|
||||||
|
|
||||||
blockedPorts += QString::number(LiGetPortFromPortFlagIndex(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
emit connectionTestCompleted(portTestResult, blockedPorts);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user