diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-30 00:17:54 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-30 00:17:54 +0900 |
| commit | cf2fa33fe0d73f7001d262beee5e8aba03544126 (patch) | |
| tree | 338c442bac72e4ea7920970de6bc122b3485ad68 /src/WinTLSSession.cc | |
| parent | 96247475315f6373c31f53bb658c7d59f48e8171 (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/WinTLSSession.cc')
| -rw-r--r-- | src/WinTLSSession.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/WinTLSSession.cc b/src/WinTLSSession.cc index 45e61a8d..8f916657 100644 --- a/src/WinTLSSession.cc +++ b/src/WinTLSSession.cc @@ -832,4 +832,6 @@ std::string WinTLSSession::getLastErrorString() return ss.str(); } +size_t WinTLSSession::getRecvBufferedLength() { return decBuf_.size(); } + } // namespace aria2 |
