]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Apparently to catch descendent classes we need to catch a reference to the parent...
[user/henk/code/inspircd.git] / src / users.cpp
index 7513fa27332c5fcf70cd9d7d286c1f8857d1c8c2..c892862730c7a826435030f40225da81ab7a491c 100644 (file)
@@ -211,7 +211,7 @@ bool userrec::HasPermission(std::string &command)
                return true;
        
        // are they even an oper at all?
-       if (strchr(this->modes,'o'))
+       if (*this->oper)
        {
                for (int j =0; j < Config->ConfValueEnum("type",&Config->config_f); j++)
                {
@@ -276,7 +276,8 @@ bool userrec::AddBuffer(std::string a)
 
 bool userrec::BufferIsReady()
 {
-        for (unsigned int i = 0; i < recvq.length(); i++)
+       unsigned int t = recvq.length();
+        for (unsigned int i = 0; i < t; i++)
                if (recvq[i] == '\n')
                        return true;
         return false;
@@ -293,7 +294,7 @@ std::string userrec::GetBuffer()
                return "";
         char* line = (char*)recvq.c_str();
         std::string ret = "";
-        while ((*line != '\n') && (strlen(line)))
+        while ((*line != '\n') && (*line))
         {
                 ret = ret + *line;
                 line++;
@@ -408,7 +409,14 @@ void kill_link(userrec *user,const char* r)
         {
                if (Config->GetIOHook(user->port))
                {
-                       Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
+                       try
+                       {
+                               Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
+                       }
+                        catch (ModuleException& modexcept)
+                        {
+                                log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
+                        }
                }
                 ServerInstance->SE->DelFd(user->fd);
                 user->CloseSocket();
@@ -471,7 +479,14 @@ void kill_link_silent(userrec *user,const char* r)
         {
                if (Config->GetIOHook(user->port))
                {
-                       Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
+                       try
+                       {
+                               Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
+                       }
+                        catch (ModuleException& modexcept)
+                        {
+                                log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
+                        }
                }
                 ServerInstance->SE->DelFd(user->fd);
                 user->CloseSocket();