]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Log some internal errors on DEFAULT loglevel instead of DEBUG, log detected errors...
authorattilamolnar <attilamolnar@hush.com>
Sun, 21 Apr 2013 15:20:28 +0000 (17:20 +0200)
committerattilamolnar <attilamolnar@hush.com>
Sun, 21 Apr 2013 15:20:28 +0000 (17:20 +0200)
src/modules/m_callerid.cpp
src/usermanager.cpp
src/users.cpp

index 4b167f2db20fbdc18dfb84ed93f453adaf0d8fc5..37787b525ee5e1a504dca701b96cba852cc835cd 100644 (file)
@@ -116,11 +116,16 @@ struct CallerIDExtInfo : public ExtensionItem
                        callerid_data *targ = this->get(*it, false);
 
                        if (!targ)
+                       {
+                               ServerInstance->Logs->Log("m_callerid", DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (1)");
                                continue; // shouldn't happen, but oh well.
+                       }
 
                        std::list<callerid_data*>::iterator it2 = std::find(targ->wholistsme.begin(), targ->wholistsme.end(), dat);
                        if (it2 != targ->wholistsme.end())
                                targ->wholistsme.erase(it2);
+                       else
+                               ServerInstance->Logs->Log("m_callerid", DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (2)");
                }
                delete dat;
        }
@@ -280,6 +285,7 @@ public:
                if (!dat2)
                {
                        // How the fuck is this possible.
+                       ServerInstance->Logs->Log("m_callerid", DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (3)");
                        return false;
                }
 
@@ -287,6 +293,9 @@ public:
                if (it != dat2->wholistsme.end())
                        // Found me!
                        dat2->wholistsme.erase(it);
+               else
+                       ServerInstance->Logs->Log("m_callerid", DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (4)");
+
 
                user->WriteServ("NOTICE %s :%s is no longer on your accept list", user->nick.c_str(), whotoremove->nick.c_str());
                return true;
@@ -324,6 +333,8 @@ private:
 
                        if (it2 != dat->accepting.end())
                                dat->accepting.erase(it2);
+                       else
+                               ServerInstance->Logs->Log("m_callerid", DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (5)");
                }
 
                userdata->wholistsme.clear();
index 2f2eeb6ddeaceb5f7299b71e50cd3ffab3bcd449..e3ddfc9f2b1c07e84783719ab12d82cd9695ca18 100644 (file)
@@ -167,13 +167,13 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
 {
        if (user->quitting)
        {
-               ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick.c_str());
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: Tried to quit quitting user: " + user->nick);
                return;
        }
 
        if (IS_SERVER(user))
        {
-               ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a fake user (%s)", user->nick.c_str());
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: Tried to quit server user: " + user->nick);
                return;
        }
 
@@ -239,7 +239,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
        if (iter != this->clientlist->end())
                this->clientlist->erase(iter);
        else
-               ServerInstance->Logs->Log("USERS", DEBUG, "iter == clientlist->end, can't remove them from hash... problematic..");
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: Nick not found in clientlist, cannot remove: " + user->nick);
 
        ServerInstance->Users->uuidlist->erase(user->uuid);
 }
index dbc3ea444a97b162d221bfbcb4f09717b12b6ea7..f48e3642fb463e01416db85e20745513693c30f0 100644 (file)
@@ -546,6 +546,8 @@ CullResult LocalUser::cull()
        // is only a precaution currently.
        if (localuseriter != ServerInstance->Users->local_users.end())
                ServerInstance->Users->local_users.erase(localuseriter);
+       else
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: LocalUserIter does not point to a valid entry for " + this->nick);
 
        ClearInvites();
        eh.cull();
@@ -840,6 +842,12 @@ void User::InvalidateCache()
 
 bool User::ChangeNick(const std::string& newnick, bool force)
 {
+       if (quitting)
+       {
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: Attempted to change nick of a quitting user: " + this->nick);
+               return false;
+       }
+
        ModResult MOD_RESULT;
 
        if (force)