diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/socket.cpp | 8 | ||||
-rwxr-xr-x | src/svn-rev.sh | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index d4cdb0a18..f4e6a5a6a 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -147,6 +147,7 @@ bool InspSocket::DoResolve() this->Close(); this->state = I_ERROR; this->OnError(I_ERR_RESOLVE); + this->fd = -1; return false; } return this->DoConnect(); @@ -163,6 +164,7 @@ bool InspSocket::DoConnect() log(DEBUG,"Cant socket()"); this->state = I_ERROR; this->OnError(I_ERR_SOCKET); + this->fd = -1; return false; } @@ -184,6 +186,7 @@ bool InspSocket::DoConnect() this->OnError(I_ERR_CONNECT); this->state = I_ERROR; this->Close(); + this->fd = -1; return false; } } @@ -275,6 +278,7 @@ bool InspSocket::FlushWriteBuffer() log(DEBUG,"Write error on socket: %s",strerror(errno)); this->OnError(I_ERR_WRITE); this->state = I_ERROR; + this->fd = -1; return true; } } @@ -295,6 +299,7 @@ bool InspSocket::Timeout(time_t current) this->OnError(I_ERR_TIMEOUT); timeout = true; this->state = I_ERROR; + this->fd = -1; return true; } return this->FlushWriteBuffer(); @@ -305,6 +310,9 @@ bool InspSocket::Poll() int incoming = -1; bool n = true; + if ((fd < 0) || (fd > MAX_DESCRIPTORS)) + return false; + switch (this->state) { case I_RESOLVING: diff --git a/src/svn-rev.sh b/src/svn-rev.sh index 846663619..5e819f84a 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3661 +echo 3664 |