WinTLS: Return 0 if eof_ is true and decBuf_ is empty

pull/287/head
Tatsuhiro Tsujikawa 2014-09-10 21:45:08 +09:00
parent 83c78c497b
commit 04f875e273
1 changed files with 4 additions and 0 deletions

View File

@ -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);