]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Missing referece for pthread_kill
[user/henk/code/inspircd.git] / src / users.cpp
index 60072ed0c1c255a1ab73e20927aebdbece1699ac..6418274282b8380fcce10e26e3a716d2e3562758 100644 (file)
@@ -18,9 +18,12 @@ using namespace std;
 
 #include "inspircd_config.h" 
 #include "channels.h"
+#include "connection.h"
 #include "users.h"
 #include "inspircd.h"
 #include <stdio.h>
+#include <pthread.h>
+#include <signal.h>
 #include "inspstring.h"
 #include "helperfuncs.h"
 
@@ -59,6 +62,11 @@ userrec::userrec()
        invites.clear();
 }
 
+userrec::~userrec()
+{
+       pthread_kill(this->dnsthread,9);
+}
+
 void userrec::CloseSocket()
 {
        shutdown(this->fd,2);
@@ -76,6 +84,7 @@ int userrec::ReadData(void* buffer, size_t size)
 {
        if (this->fd > -1)
        {
+               log(DEBUG,"userrec::ReadData on fd %d",this->fd);
                return read(this->fd, buffer, size);
        }
        else return 0;
@@ -192,20 +201,20 @@ bool userrec::HasPermission(char* command)
 bool userrec::AddBuffer(std::string a)
 {
         std::string b = "";
-        for (int i = 0; i < a.length(); i++)
+        for (unsigned int i = 0; i < a.length(); i++)
                 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
                         b = b + a[i];
         std::stringstream stream(recvq);
         stream << b;
         recvq = stream.str();
-       int i = 0;
+       unsigned int i = 0;
        // count the size of the first line in the buffer.
        while (i < recvq.length())
        {
                if (recvq[i++] == '\n')
                        break;
        }
-       if (recvq.length() > this->recvqmax)
+       if (recvq.length() > (unsigned)this->recvqmax)
        {
                this->SetWriteError("RecvQ exceeded");
                WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax);
@@ -217,7 +226,7 @@ bool userrec::AddBuffer(std::string a)
 
 bool userrec::BufferIsReady()
 {
-        for (int i = 0; i < recvq.length(); i++)
+        for (unsigned int i = 0; i < recvq.length(); i++)
                if (recvq[i] == '\n')
                        return true;
         return false;
@@ -249,7 +258,7 @@ void userrec::AddWriteBuf(std::string data)
 {
        if (this->GetWriteError() != "")
                return;
-       if (sendq.length() + data.length() > this->sendqmax)
+       if (sendq.length() + data.length() > (unsigned)this->sendqmax)
        {
                WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
                this->SetWriteError("SendQ exceeded");