[icinga-checkins] icinga.org: icinga2/master: Bugfixes for the socket subsystem.

git at icinga.org git at icinga.org
Tue Apr 2 11:08:39 CEST 2013


Module: icinga2
Branch: master
Commit: 8ac0a8010117cf7f73b20eeb9427a726e883cd7b
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=8ac0a8010117cf7f73b20eeb9427a726e883cd7b

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Apr  2 11:08:08 2013 +0200

Bugfixes for the socket subsystem.

---

 lib/base/socket.cpp    |    7 +++++++
 lib/base/tlsstream.cpp |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lib/base/socket.cpp b/lib/base/socket.cpp
index 5f4a070..249bcdc 100644
--- a/lib/base/socket.cpp
+++ b/lib/base/socket.cpp
@@ -538,6 +538,13 @@ void Socket::HandleWritableClient(void)
 
 		rc = send(GetFD(), data, count, 0);
 
+#ifdef _WIN32
+		if (rc < 0 && WSAGetLastError() == WSAEWOULDBLOCK)
+#else /* _WIN32 */
+		if (rc < 0 && errno == EAGAIN)
+#endif /* _WIN32 */
+			break;
+
 		if (rc <= 0) {
 #ifndef _WIN32
 			BOOST_THROW_EXCEPTION(socket_error()
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 2b12155..fa2577c 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -293,5 +293,5 @@ void TlsStream::Write(const void *buffer, size_t count)
 		m_SendQueue->Write(buffer, count);
 	}
 
-	HandleIO();
+	Utility::QueueAsyncCallback(boost::bind(&TlsStream::HandleIO, this));
 }





More information about the icinga-checkins mailing list