Fix bug 574524: DtlsTransportChannel crashes after SSL closes remotely

When remote side closes, opensslstreamadapter could return SR_EOS which will not trigger upper layer to clean up what's left in the StreamInterfaceChannel. The result of this is when there are more packets coming in, the Write on the StreamInterfaceChannel will overflow the buffer.

The fix here is that when receiving the remote side close signal, we also close the underneath StreamInterfaceChannel which will clean up the queue to prevent overflow.

BUG=574524
TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1566023002

Cr-Commit-Position: refs/heads/master@{#11751}
This commit is contained in:
guoweis
2016-02-24 11:10:06 -08:00
committed by Commit bot
parent 615fabb661
commit 4cc9f98e4c
5 changed files with 21 additions and 1 deletions

View File

@ -28,6 +28,9 @@ class BufferQueue {
// Return number of queued buffers.
size_t size() const;
// Clear the BufferQueue by moving all Buffers from |queue_| to |free_list_|.
void Clear();
// ReadFront will only read one buffer at a time and will truncate buffers
// that don't fit in the passed memory.
// Returns true unless no data could be returned.