aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-10-08 06:51:48 +0000
committerMike Buland <eichlan@xagasoft.com>2007-10-08 06:51:48 +0000
commit5a0cd0696dc635551b797445bcc625e8e3b80802 (patch)
tree2873b47e15d1d3107d0b96c1f1bc711c715c0ee9 /src
parent724ed6c46b13a5a511d1dbe1fc0f557189f9c798 (diff)
downloadlibbu++-5a0cd0696dc635551b797445bcc625e8e3b80802.tar.gz
libbu++-5a0cd0696dc635551b797445bcc625e8e3b80802.tar.bz2
libbu++-5a0cd0696dc635551b797445bcc625e8e3b80802.tar.xz
libbu++-5a0cd0696dc635551b797445bcc625e8e3b80802.zip
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.
Diffstat (limited to '')
-rw-r--r--src/socket.cpp1
1 files changed, 1 insertions, 0 deletions
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 )
202 int nWrote = TEMP_FAILURE_RETRY( ::write( nSocket, pBuf, nBytes ) ); 202 int nWrote = TEMP_FAILURE_RETRY( ::write( nSocket, pBuf, nBytes ) );
203 if( nWrote < 0 ) 203 if( nWrote < 0 )
204 { 204 {
205 if( errno == EAGAIN ) return 0;
205 throw ConnectionException( excodeWriteError, strerror(errno) ); 206 throw ConnectionException( excodeWriteError, strerror(errno) );
206 } 207 }
207 return nWrote; 208 return nWrote;