summaryrefslogtreecommitdiff
path: root/src/LibsslTLSSession.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-01-30 00:17:54 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-01-30 00:17:54 +0900
commitcf2fa33fe0d73f7001d262beee5e8aba03544126 (patch)
tree338c442bac72e4ea7920970de6bc122b3485ad68 /src/LibsslTLSSession.h
parent96247475315f6373c31f53bb658c7d59f48e8171 (diff)
WinTLS: Fix hang because of buffered received data
WinTLSSession buffers received decrypted data into its own buffer. If read is requested, it copies the data from its buffer. But if requested buffer size is less than decrypted buffer, some of the data is left in the buffer. Previously, we had no facility to check the existence of this pending data. If this data is the last requested data from remote server, we may end up waiting for read event even if we have already data in our buffer, which may cause hang. This commit fixes this issue by introducing function to return the buffered length in TLSSession. SocketCore also provides the same function, which delegates to TLSSession object.
Diffstat (limited to 'src/LibsslTLSSession.h')
-rw-r--r--src/LibsslTLSSession.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/LibsslTLSSession.h b/src/LibsslTLSSession.h
index ccb1c2e2..5964aa21 100644
--- a/src/LibsslTLSSession.h
+++ b/src/LibsslTLSSession.h
@@ -59,6 +59,7 @@ public:
std::string& handshakeErr) CXX11_OVERRIDE;
virtual int tlsAccept(TLSVersion& version) CXX11_OVERRIDE;
virtual std::string getLastErrorString() CXX11_OVERRIDE;
+ virtual size_t getRecvBufferedLength() CXX11_OVERRIDE { return 0; }
private:
int handshake(TLSVersion& version);