Skip to content

Commit

Permalink
Fix for bug #605 reported by MacGuyver, if a line is expired when we …
Browse files Browse the repository at this point in the history
…are adding another with the same hostmask, replace the existing line with the new one

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10589 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
braindigitalis committed Sep 22, 2008
1 parent f242305 commit 243d8c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/m_spanningtree/addline.cpp
Expand Up @@ -58,7 +58,7 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
return true;
}
xl->SetCreateTime(atoi(params[3].c_str()));
if (ServerInstance->XLines->AddLine(xl,NULL))
if (ServerInstance->XLines->AddLine(xl, NULL))
{
if (xl->duration)
{
Expand Down
11 changes: 10 additions & 1 deletion src/xline.cpp
Expand Up @@ -170,7 +170,16 @@ bool XLineManager::AddLine(XLine* line, User* user)
ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?

if (DelLine(line->Displayable(), line->type, user, true))
return false;
{
/* Line exists, check if its an expired line */
ContainerIter x = lookup_lines.find(line->type);
LookupIter i = x->second.find(line->Displayable());

if (i->second->duration && ServerInstance->Time() > i->second->expiry)
ExpireLine(x, i);
else
return false;
}

/*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
XLineFactory* xlf = GetFactory(line->type);
Expand Down

0 comments on commit 243d8c2

Please sign in to comment.