From 04f875e2730265261347b2ced210ba08870817ad Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 10 Sep 2014 21:45:08 +0900 Subject: [PATCH] WinTLS: Return 0 if eof_ is true and decBuf_ is empty --- src/WinTLSSession.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/WinTLSSession.cc b/src/WinTLSSession.cc index d63f6a22..b5d2f94d 100644 --- a/src/WinTLSSession.cc +++ b/src/WinTLSSession.cc @@ -559,6 +559,10 @@ ssize_t WinTLSSession::readData(void* data, size_t len) len = std::min(decBuf_.size(), len); if (len == 0) { + if (eof_) { + return 0; + } + return TLS_ERR_WOULDBLOCK; } memcpy(data, decBuf_.data(), len);