mirror of
https://github.com/meganz/MEGAcmd
synced 2025-08-22 01:47:24 +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 value = ConfigurationManager::getConfigurationValue(up ? "maxuploadconnections" : "maxdownloadconnections", -1);
|
||||
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
||||
megaCmdListener->wait();
|
||||
if (megaCmdListener->getError()->getErrorCode() != MegaError::API_OK)
|
||||
if (value != -1)
|
||||
{
|
||||
LOG_err << "Failed to change max " << (up ? "upload" : "download") << " connections: "
|
||||
<< megaCmdListener->getError()->getErrorString();
|
||||
api->setMaxConnections(up ? 1 : 0, value, megaCmdListener.get());
|
||||
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