aboutsummaryrefslogtreecommitdiff
path: root/src/connection.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-01-24 22:18:51 +0000
committerMike Buland <eichlan@xagasoft.com>2007-01-24 22:18:51 +0000
commitf587852db92f3a74f16cab04a983158f9baa2c0f (patch)
treeed80a871bb3ec8b446dc81809f87fe85ea769c07 /src/connection.cpp
parent4e55acc667bbadc104f71e1ee3a50b0fab38aea6 (diff)
downloadlibbu++-f587852db92f3a74f16cab04a983158f9baa2c0f.tar.gz
libbu++-f587852db92f3a74f16cab04a983158f9baa2c0f.tar.bz2
libbu++-f587852db92f3a74f16cab04a983158f9baa2c0f.tar.xz
libbu++-f587852db92f3a74f16cab04a983158f9baa2c0f.zip
Fixed a bug?
Diffstat (limited to 'src/connection.cpp')
-rw-r--r--src/connection.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index cb3c724..dbf2761 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -228,6 +228,24 @@ int Connection::readInput()
228 { 228 {
229 break; 229 break;
230 } 230 }
231
232 /* New test, if data is divisible by 2048 bytes on some libs the
233 * read could block, this keeps it from happening.
234 */
235 {
236 fd_set rfds;
237 FD_ZERO(&rfds);
238 FD_SET(nSocket, &rfds);
239 int retval = select( nSocket+1, &rfds, NULL, NULL, NULL );
240 if( retval == -1 )
241 throw ConnectionException(
242 excodeBadReadError,
243 "Bad Read error"
244 );
245 if( !FD_ISSET( nSocket, &rfds ) )
246 break;
247 }
248
231 } 249 }
232 } 250 }
233 251