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

Unified Diff: webrtc/api/datachannel.cc

Issue 2235843003: Fix for data channels perpetually stuck in "closing" state. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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/api/datachannel.h ('k') | webrtc/api/datachannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/datachannel.cc
diff --git a/webrtc/api/datachannel.cc b/webrtc/api/datachannel.cc
index 5bffa03ce96db05c16cf3a99b1c3a7e1c4736793..6b13bf2c705ae7152c9ce4fa6edef00f9ce92340 100644
--- a/webrtc/api/datachannel.cc
+++ b/webrtc/api/datachannel.cc
@@ -297,10 +297,11 @@ void DataChannel::OnTransportChannelCreated() {
}
}
-// The underlying transport channel was destroyed.
-// This function makes sure the DataChannel is disconnected and changes state to
-// kClosed.
void DataChannel::OnTransportChannelDestroyed() {
+ // This method needs to synchronously close the data channel, which means any
+ // queued data needs to be discarded.
+ queued_send_data_.Clear();
+ queued_control_data_.Clear();
DoClose();
}
« no previous file with comments | « webrtc/api/datachannel.h ('k') | webrtc/api/datachannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698