When DefaultApply() adds a hit to the BanCache it uses the X-line
duration to set a duration on the entry. This can result in an
entry lasting longer than the X-line itself. Fix this by setting
the entry duration to the time left on the X-line.
{
ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString());
if (this->duration > 0)
- ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, this->duration);
+ ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, (this->expiry - ServerInstance->Time()));
else
ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason);
}