1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fallback to IPv4 if IPv6 fails

Fixes #181
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-09 22:07:32 +02:00
parent f957aa3181
commit ee184a558c

View File

@ -96,11 +96,24 @@ void Core::start()
qWarning() << "Core starting with IPv6 disabled. LAN discovery may not work properly.";
tox = tox_new(enableIPv6);
if (tox == nullptr)
{
if (enableIPv6) // Fallback to IPv4
{
tox = tox_new(false);
if (tox == nullptr)
{
qCritical() << "Tox core failed to start";
emit failedToStart();
return;
}
}
else
{
qCritical() << "Tox core failed to start";
emit failedToStart();
return;
}
}
toxav = toxav_new(tox, TOXAV_MAX_CALLS);
if (toxav == nullptr)