TaskTasix: Don't process empty response.

This commit is contained in:
Nodir Temirkhodjaev 2017-10-03 13:26:16 +05:00
parent 2ba6e58675
commit 708d7fd989

View File

@ -106,13 +106,6 @@ QString TaskTasix::parseBufer(const QByteArray &buffer)
{ {
QStringList list; QStringList list;
// Include local networks
list.append("10.0.0.0/8");
list.append("127.0.0.0/8");
list.append("169.254.0.0/16");
list.append("172.16.0.0/12");
list.append("192.168.0.0/16");
// Parse lines // Parse lines
const QString text(buffer); const QString text(buffer);
foreach (const QStringRef &line, text.splitRef('\n')) { foreach (const QStringRef &line, text.splitRef('\n')) {
@ -132,6 +125,16 @@ QString TaskTasix::parseBufer(const QByteArray &buffer)
list.append(addrStr.toString()); list.append(addrStr.toString());
} }
if (list.isEmpty())
return QString();
// Include local networks
list.append("10.0.0.0/8");
list.append("127.0.0.0/8");
list.append("169.254.0.0/16");
list.append("172.16.0.0/12");
list.append("192.168.0.0/16");
// Merge lines // Merge lines
Ip4Range ip4Range; Ip4Range ip4Range;
if (!ip4Range.fromText(list.join('\n'))) if (!ip4Range.fromText(list.join('\n')))