mirror of
https://github.com/meganz/MEGAcmd
synced 2025-08-29 12:57:44 +00:00
fix attempt to set invalid value at startup
This commit is contained in:
parent
045a6305d8
commit
21ea5fbbbb
@ -2644,12 +2644,15 @@ 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);
|
||||||
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
if (value != -1)
|
||||||
megaCmdListener->wait();
|
|
||||||
if (megaCmdListener->getError()->getErrorCode() != MegaError::API_OK)
|
|
||||||
{
|
{
|
||||||
LOG_err << "Failed to change max " << (up ? "upload" : "download") << " connections: "
|
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
||||||
<< megaCmdListener->getError()->getErrorString();
|
megaCmdListener->wait();
|
||||||
|
if (megaCmdListener->getError()->getErrorCode() != MegaError::API_OK)
|
||||||
|
{
|
||||||
|
LOG_err << "Failed to change max " << (up ? "upload" : "download") << " connections: "
|
||||||
|
<< megaCmdListener->getError()->getErrorString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user