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

@ -97,9 +97,22 @@ void Core::start()
tox = tox_new(enableIPv6);
if (tox == nullptr)
{
qCritical() << "Tox core failed to start";
emit failedToStart();
return;
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);