summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-06-09 07:15:06 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-06-09 07:15:06 +0000
commit8818d5a97f36420d53b51d400f1d3decd7e5fedf (patch)
tree3ad43bcf697b2fd89530b19b72b12bb621e12235
parentff09f58daef77ccab1b10180feee257926da1c80 (diff)
downloadcryptopp-8818d5a97f36420d53b51d400f1d3decd7e5fedf.tar.gz
fix SocketSender::EofSent
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk@224 57ff6487-cd31-0410-9ec3-f628ee90f5f0
-rw-r--r--c5/socketft.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/c5/socketft.cpp b/c5/socketft.cpp
index 5790502..6c5a8ff 100644
--- a/c5/socketft.cpp
+++ b/c5/socketft.cpp
@@ -442,7 +442,10 @@ bool SocketSender::EofSent()
{
WSANETWORKEVENTS events;
m_s.CheckAndHandleError_int("WSAEnumNetworkEvents", WSAEnumNetworkEvents(m_s, m_event, &events));
- m_lastResult = (events.lNetworkEvents & FD_CLOSE) ? 1 : 0;
+ if ((events.lNetworkEvents & FD_CLOSE) != FD_CLOSE)
+ throw Socket::Err(m_s, "WSAEnumNetworkEvents (FD_CLOSE not present)", E_FAIL);
+ if (events.iErrorCode[FD_CLOSE_BIT] != 0)
+ throw Socket::Err(m_s, "FD_CLOSE (via WSAEnumNetworkEvents)", events.iErrorCode[FD_CLOSE_BIT]);
m_resultPending = false;
}
return m_lastResult != 0;