fix(Core/Warden): Fix buffer not being handled during interrupt. (#15258)
This commit is contained in:
@@ -154,6 +154,11 @@ bool Warden::IsValidCheckSum(uint32 checksum, const uint8* data, const uint16 le
|
||||
}
|
||||
}
|
||||
|
||||
bool Warden::IsInitialized()
|
||||
{
|
||||
return _initialized;
|
||||
}
|
||||
|
||||
union keyData
|
||||
{
|
||||
std::array<uint8, 20> bytes;
|
||||
|
||||
@@ -115,6 +115,7 @@ public:
|
||||
virtual void RequestHash() = 0;
|
||||
virtual void HandleHashResult(ByteBuffer &buff) = 0;
|
||||
virtual bool IsCheckInProgress() = 0;
|
||||
virtual bool IsInitialized();
|
||||
virtual void ForceChecks() = 0;
|
||||
virtual void RequestChecks() = 0;
|
||||
virtual void HandleData(ByteBuffer &buff) = 0;
|
||||
|
||||
@@ -560,8 +560,6 @@ void WardenWin::RequestChecks()
|
||||
}
|
||||
|
||||
void WardenWin::HandleData(ByteBuffer& buff)
|
||||
{
|
||||
if (!_interrupted)
|
||||
{
|
||||
LOG_DEBUG("warden", "Handle data");
|
||||
|
||||
@@ -576,7 +574,12 @@ void WardenWin::HandleData(ByteBuffer& buff)
|
||||
if (Length != (buff.size() - buff.rpos()))
|
||||
{
|
||||
buff.rfinish();
|
||||
|
||||
if (!_interrupted)
|
||||
{
|
||||
ApplyPenalty(0, "Failed size checks in HandleData");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -584,7 +587,12 @@ void WardenWin::HandleData(ByteBuffer& buff)
|
||||
{
|
||||
buff.rpos(buff.wpos());
|
||||
LOG_DEBUG("warden", "CHECKSUM FAIL");
|
||||
|
||||
if (!_interrupted)
|
||||
{
|
||||
ApplyPenalty(0, "Failed checksum in HandleData");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -738,12 +746,12 @@ void WardenWin::HandleData(ByteBuffer& buff)
|
||||
}
|
||||
}
|
||||
|
||||
if (checkFailed > 0)
|
||||
if (checkFailed > 0 && !_interrupted)
|
||||
{
|
||||
ApplyPenalty(checkFailed, "");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (_interrupted)
|
||||
{
|
||||
LOG_DEBUG("warden", "Warden was interrupted by ForceChecks, ignoring results.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user