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

Unified Diff: webrtc/p2p/base/dtlstransportchannel.cc

Issue 2140283002: Fixing issue with DTLS channel when using "presume writable" flag. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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
Index: webrtc/p2p/base/dtlstransportchannel.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index d25de260f380693a3c8bd25312e42c1fbc3b53b7..2880200fefee9451929bbe9da237487451becb88 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -247,6 +247,10 @@ bool DtlsTransportChannelWrapper::SetRemoteFingerprint(
if (reconnect) {
Reconnect();
+ } else {
+ // If the underlying channel is already writable by the time we receive
+ // a remote fingerprint, we may be able to start DTLS right away.
+ MaybeStartDtls();
skvlad 2016/07/12 21:53:52 The other two calls wrap this in VERIFY() - do you
pthatcher1 2016/07/13 00:04:19 If the other call is inlined, then there would jus
Taylor Brandstetter 2016/07/13 16:17:41 If we always want to DCHECK that this succeeds, I'
}
return true;
@@ -675,9 +679,7 @@ void DtlsTransportChannelWrapper::OnChannelStateChanged(
void DtlsTransportChannelWrapper::Reconnect() {
set_dtls_state(DTLS_TRANSPORT_NEW);
pthatcher1 2016/07/13 00:04:19 Maybe have a DCHECK(dtls_active_);
Taylor Brandstetter 2016/07/13 16:17:41 No longer necessary. This is inlined in SetRemoteF
set_writable(false);
- if (channel_->writable()) {
- OnWritableState(channel_);
- }
+ VERIFY(MaybeStartDtls());
pthatcher1 2016/07/13 00:04:19 Can we inline this?
Taylor Brandstetter 2016/07/13 16:17:41 Done.
}
} // namespace cricket
« no previous file with comments | « no previous file | webrtc/p2p/base/dtlstransportchannel_unittest.cc » ('j') | webrtc/p2p/base/dtlstransportchannel_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698