Use LiStringifyPortFlags() instead of coding it ourselves
This commit is contained in:
parent
c414e1a168
commit
0b56b1685a
1 changed files with 3 additions and 20 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue