mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Log when we would disconnected, but don't actually disconnect for now.
This commit is contained in:
@@ -124,7 +124,10 @@ void LoadManager::canonicalize(LoadSource& source, int now) const
|
||||
{
|
||||
source.mBalance += mCreditRate * (now - source.mLastUpdate);
|
||||
if (source.mBalance > mCreditLimit)
|
||||
{
|
||||
source.mBalance = mCreditLimit;
|
||||
source.mLogged = false;
|
||||
}
|
||||
}
|
||||
source.mLastUpdate = now;
|
||||
}
|
||||
@@ -154,6 +157,9 @@ bool LoadManager::shouldCutoff(LoadSource& source) const
|
||||
canonicalize(source, now);
|
||||
if (source.isPrivileged() || (source.mBalance > mDebitLimit))
|
||||
return false;
|
||||
if (source.mLogged)
|
||||
return true;
|
||||
source.mLogged = true;
|
||||
}
|
||||
logDisconnect(source.getName());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user