From 5a0cd0696dc635551b797445bcc625e8e3b80802 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 8 Oct 2007 06:51:48 +0000 Subject: Fixed a bug in the Socket that would throw an exception if there was just too much data in thou outgoing buffer on a write and you need to wait. Instead the write operation returns zero right now if that happens. It should be the only case that it returns zero in when there are bytes to be written and an exception is not triggered. --- src/socket.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/socket.cpp b/src/socket.cpp index 94b4d60..1874fd2 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -202,6 +202,7 @@ size_t Bu::Socket::write( const void *pBuf, size_t nBytes ) int nWrote = TEMP_FAILURE_RETRY( ::write( nSocket, pBuf, nBytes ) ); if( nWrote < 0 ) { + if( errno == EAGAIN ) return 0; throw ConnectionException( excodeWriteError, strerror(errno) ); } return nWrote; -- cgit v1.2.3