summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-06-28 13:16:55 -0400
committerAdam <Adam@anope.org>2010-06-28 13:16:55 -0400
commit147c58bd321b6361ccda5c51fe9c3664a8450a12 (patch)
tree74536ab1a63cb739906c24bf0373a7c7db627da3
parent77ec1f2fa774ac213638d2e317c3d731b42f12ef (diff)
Delete all of our known users when we lose connection to the uplink
-rw-r--r--src/main.c9
-rw-r--r--src/servers.c3
-rw-r--r--src/users.c11
-rw-r--r--version.log2
4 files changed, 15 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 8ffc8df13..32896282d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -557,6 +557,15 @@ int main(int ac, char **av, char **envp)
{
FOREACH_MOD(I_OnServerDisconnect, OnServerDisconnect());
+ /* Clear all of our users */
+ User *u = firstuser();
+ while (u)
+ {
+ User *unext = nextuser();
+ delete u;
+ u = unext;
+ }
+
unsigned j = 0;
for (; j < (Config.MaxRetries ? Config.MaxRetries : j + 1); ++j)
{
diff --git a/src/servers.c b/src/servers.c
index be75625de..e39c7d1f1 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -219,9 +219,6 @@ static void delete_server(Server * serv, const char *quitreason)
delete [] na->last_quit;
na->last_quit = (quitreason ? sstrdup(quitreason) : NULL);
}
- if (Config.LimitSessions && !is_ulined(u->server->name)) {
- del_session(u->host);
- }
delete u;
}
u = unext;
diff --git a/src/users.c b/src/users.c
index 2c00a3480..a281ac713 100644
--- a/src/users.c
+++ b/src/users.c
@@ -251,6 +251,11 @@ User::~User()
this->chans.front()->chan->DeleteUser(this);
}
+ if (Config.LimitSessions && !is_ulined(this->server->name))
+ {
+ del_session(this->host);
+ }
+
if (this->prev)
this->prev->next = this->next;
else
@@ -1059,9 +1064,6 @@ void do_quit(const char *source, int ac, const char **av)
delete [] na->last_quit;
na->last_quit = *av[0] ? sstrdup(av[0]) : NULL;
}
- if (Config.LimitSessions && !is_ulined(user->server->name)) {
- del_session(user->host);
- }
FOREACH_MOD(I_OnUserQuit, OnUserQuit(user, *av[0] ? av[0] : ""));
delete user;
}
@@ -1092,9 +1094,6 @@ void do_kill(const std::string &nick, const std::string &msg)
delete [] na->last_quit;
na->last_quit = !msg.empty() ? sstrdup(msg.c_str()) : NULL;
}
- if (Config.LimitSessions && !is_ulined(user->server->name)) {
- del_session(user->host);
- }
delete user;
}
diff --git a/version.log b/version.log
index 8bbfaae9c..4cb2c26c8 100644
--- a/version.log
+++ b/version.log
@@ -8,7 +8,7 @@
VERSION_MAJOR="1"
VERSION_MINOR="9"
VERSION_PATCH="2"
-VERSION_EXTRA="-p1"
+VERSION_EXTRA="-p2"
VERSION_BUILD="1"