mirror of
https://github.com/meganz/MEGAcmd
synced 2025-08-29 21:07:43 +00:00
fix attempt to set invalid value at startup
This commit is contained in:
parent
045a6305d8
commit
21ea5fbbbb
@ -2644,6 +2644,8 @@ int MegaCmdExecuter::actUponLogin(SynchronousRequestListener *srl, int timeout)
|
|||||||
{
|
{
|
||||||
auto megaCmdListener = std::make_unique<MegaCmdListener>(nullptr);
|
auto megaCmdListener = std::make_unique<MegaCmdListener>(nullptr);
|
||||||
auto value = ConfigurationManager::getConfigurationValue(up ? "maxuploadconnections" : "maxdownloadconnections", -1);
|
auto value = ConfigurationManager::getConfigurationValue(up ? "maxuploadconnections" : "maxdownloadconnections", -1);
|
||||||
|
if (value != -1)
|
||||||
|
{
|
||||||
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
||||||
megaCmdListener->wait();
|
megaCmdListener->wait();
|
||||||
if (megaCmdListener->getError()->getErrorCode() != MegaError::API_OK)
|
if (megaCmdListener->getError()->getErrorCode() != MegaError::API_OK)
|
||||||
@ -2652,6 +2654,7 @@ int MegaCmdExecuter::actUponLogin(SynchronousRequestListener *srl, int timeout)
|
|||||||
<< megaCmdListener->getError()->getErrorString();
|
<< megaCmdListener->getError()->getErrorString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
api->useHttpsOnly(ConfigurationManager::getConfigurationValue("https", false));
|
api->useHttpsOnly(ConfigurationManager::getConfigurationValue("https", false));
|
||||||
api->disableGfxFeatures(!ConfigurationManager::getConfigurationValue("graphics", true));
|
api->disableGfxFeatures(!ConfigurationManager::getConfigurationValue("graphics", true));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user