Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: webrtc/base/opensslstreamadapter.cc

Issue 1566023002: Fix bug 574524: DtlsTransportChannel crashes after SSL closes remotely (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: improve comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/bufferqueue.cc ('k') | webrtc/p2p/base/dtlstransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/opensslstreamadapter.cc
diff --git a/webrtc/base/opensslstreamadapter.cc b/webrtc/base/opensslstreamadapter.cc
index 270faa0809f42013c01aeb35854d7c98b3b9cc1f..616914a654530143f16a7947beed26bc13824432 100644
--- a/webrtc/base/opensslstreamadapter.cc
+++ b/webrtc/base/opensslstreamadapter.cc
@@ -618,6 +618,10 @@ StreamResult OpenSSLStreamAdapter::Read(void* data, size_t data_len,
return SR_BLOCK;
case SSL_ERROR_ZERO_RETURN:
LOG(LS_VERBOSE) << " -- remote side closed";
+ // When we're closed at SSL layer, also close the stream level which
+ // performs necessary clean up. Otherwise, a new incoming packet after
+ // this could overflow the stream buffer.
+ this->stream()->Close();
return SR_EOS;
break;
default:
« no previous file with comments | « webrtc/base/bufferqueue.cc ('k') | webrtc/p2p/base/dtlstransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698