diff options
-rw-r--r-- | src/server.cpp | 1 | ||||
-rw-r--r-- | src/socket.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp index b7dec41..bfa7880 100644 --- a/src/server.cpp +++ b/src/server.cpp | |||
@@ -92,6 +92,7 @@ void Bu::Server::scan() | |||
92 | if( !pClient->isOpen() ) | 92 | if( !pClient->isOpen() ) |
93 | { | 93 | { |
94 | onClosedConnection( pClient ); | 94 | onClosedConnection( pClient ); |
95 | pClient->close(); | ||
95 | hClients.erase( j ); | 96 | hClients.erase( j ); |
96 | FD_CLR( j, &fdActive ); | 97 | FD_CLR( j, &fdActive ); |
97 | } | 98 | } |
diff --git a/src/socket.cpp b/src/socket.cpp index 46e6cd7..3ddc492 100644 --- a/src/socket.cpp +++ b/src/socket.cpp | |||
@@ -159,7 +159,7 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes ) | |||
159 | bu_recv( nSocket, (char *) pBuf, nBytes, 0 ) ); | 159 | bu_recv( nSocket, (char *) pBuf, nBytes, 0 ) ); |
160 | if( nRead == 0 ) | 160 | if( nRead == 0 ) |
161 | { | 161 | { |
162 | bActive = false; | 162 | close(); |
163 | throw SocketException( SocketException::cClosed, "Socket closed."); | 163 | throw SocketException( SocketException::cClosed, "Socket closed."); |
164 | } | 164 | } |
165 | if( nRead < 0 ) | 165 | if( nRead < 0 ) |
@@ -171,7 +171,7 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes ) | |||
171 | #else | 171 | #else |
172 | if( errno == ENETRESET || errno == ECONNRESET ) | 172 | if( errno == ENETRESET || errno == ECONNRESET ) |
173 | { | 173 | { |
174 | bActive = false; | 174 | close(); |
175 | throw SocketException( SocketException::cClosed, | 175 | throw SocketException( SocketException::cClosed, |
176 | strerror(errno) ); | 176 | strerror(errno) ); |
177 | } | 177 | } |