]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Tweaks to closed socket detection
[user/henk/code/inspircd.git] / src / socket.cpp
index 1af2b51ffc542111245114bee30e006f7052eccd..fe6516bb5c94548daf1b62def6e48afc44563c8c 100644 (file)
@@ -59,7 +59,7 @@ InspSocket::InspSocket(int newfd, char* ip)
        socket_ref[this->fd] = this;
 }
 
-InspSocket::InspSocket(std::string ahost, int port, bool listening, unsigned long maxtime)
+InspSocket::InspSocket(std::string ahost, int aport, bool listening, unsigned long maxtime)
 {
        this->fd = -1;
        this->host = ahost;
@@ -74,7 +74,7 @@ InspSocket::InspSocket(std::string ahost, int port, bool listening, unsigned lon
                }
                else
                {
-                       if (BindSocket(this->fd,this->client,this->server,port,(char*)ahost.c_str()) == ERROR)
+                       if (BindSocket(this->fd,this->client,this->server,aport,(char*)ahost.c_str()) == ERROR)
                        {
                                this->Close();
                                this->fd = -1;
@@ -95,8 +95,8 @@ InspSocket::InspSocket(std::string ahost, int port, bool listening, unsigned lon
        }
        else
        {
-               this->host = host;
-               this->port = port;
+               this->host = ahost;
+               this->port = aport;
 
                if (!inet_aton(host.c_str(),&addy))
                {
@@ -303,8 +303,6 @@ bool InspSocket::Poll()
        int incoming = -1;
        bool n = true;
 
-       log(DEBUG,"InspSocket::Poll()");
-       
        switch (this->state)
        {
                case I_RESOLVING:
@@ -312,7 +310,7 @@ bool InspSocket::Poll()
                        return this->DoResolve();
                break;
                case I_CONNECTING:
-                       log(DEBUG,"State = I_CONNECTED");
+                       log(DEBUG,"State = I_CONNECTING");
                        this->SetState(I_CONNECTED);
                        /* Our socket was in write-state, so delete it and re-add it
                         * in read-state.
@@ -329,9 +327,7 @@ bool InspSocket::Poll()
                        return true;
                break;
                case I_CONNECTED:
-                       log(DEBUG,"State = I_CONNECTED");
                        n = this->OnDataReady();
-                       log(DEBUG,"State return: %d",(int)n);
                        /* Flush any pending, but not till after theyre done with the event
                         * so there are less write calls involved. */
                        this->FlushWriteBuffer();