summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-03-28 18:56:27 +0000
committerGravatar brain2006-03-28 18:56:27 +0000
commit5aef3587c290fcf38acfd98bdf169b3fc94690dc (patch)
tree54eaa3e7eb92b6579960679abaab4ffd04292208 /src/socket.cpp
parentSame fix to 1.0 stable, im quickly getting fed up of doing the same thing twice. (diff)
Possible fix for 'connection refused' 100% cpu bug
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@3786 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 1449b3c8d..02af72a63 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -69,6 +69,7 @@ InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsi
if ((this->fd = OpenTCPSocket()) == ERROR)
{
this->fd = -1;
+ this->ClosePending = true;
this->state = I_ERROR;
this->OnError(I_ERR_SOCKET);
log(DEBUG,"OpenTCPSocket() error");
@@ -80,6 +81,7 @@ InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsi
{
this->Close();
this->fd = -1;
+ this->ClosePending = true;
this->state = I_ERROR;
this->OnError(I_ERR_BIND);
log(DEBUG,"BindSocket() error %s",strerror(errno));
@@ -147,6 +149,7 @@ bool InspSocket::DoResolve()
this->Close();
this->state = I_ERROR;
this->OnError(I_ERR_RESOLVE);
+ this->ClosePending = true;
this->fd = -1;
return false;
}
@@ -164,6 +167,7 @@ bool InspSocket::DoConnect()
log(DEBUG,"Cant socket()");
this->state = I_ERROR;
this->OnError(I_ERR_SOCKET);
+ this->ClosePending = true;
this->fd = -1;
return false;
}
@@ -187,6 +191,7 @@ bool InspSocket::DoConnect()
this->state = I_ERROR;
this->Close();
this->fd = -1;
+ this->ClosePending = true;
return false;
}
}
@@ -207,6 +212,7 @@ void InspSocket::Close()
shutdown(this->fd,2);
close(this->fd);
socket_ref[this->fd] = NULL;
+ this->ClosePending = true;
this->fd = -1;
}
}