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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 bool reconnect = (dtls_ != nullptr); 241 bool reconnect = (dtls_ != nullptr);
242 242
243 if (!SetupDtls()) { 243 if (!SetupDtls()) {
244 set_dtls_state(DTLS_TRANSPORT_FAILED); 244 set_dtls_state(DTLS_TRANSPORT_FAILED);
245 return false; 245 return false;
246 } 246 }
247 247
248 if (reconnect) { 248 if (reconnect) {
249 Reconnect(); 249 Reconnect();
250 } else {
251 // If the underlying channel is already writable by the time we receive
252 // a remote fingerprint, we may be able to start DTLS right away.
253 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'
250 } 254 }
251 255
252 return true; 256 return true;
253 } 257 }
254 258
255 std::unique_ptr<rtc::SSLCertificate> 259 std::unique_ptr<rtc::SSLCertificate>
256 DtlsTransportChannelWrapper::GetRemoteSSLCertificate() const { 260 DtlsTransportChannelWrapper::GetRemoteSSLCertificate() const {
257 if (!dtls_) { 261 if (!dtls_) {
258 return nullptr; 262 return nullptr;
259 } 263 }
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 last_sent_packet_id, ready_to_send); 670 last_sent_packet_id, ready_to_send);
667 } 671 }
668 672
669 void DtlsTransportChannelWrapper::OnChannelStateChanged( 673 void DtlsTransportChannelWrapper::OnChannelStateChanged(
670 TransportChannelImpl* channel) { 674 TransportChannelImpl* channel) {
671 ASSERT(channel == channel_); 675 ASSERT(channel == channel_);
672 SignalStateChanged(this); 676 SignalStateChanged(this);
673 } 677 }
674 678
675 void DtlsTransportChannelWrapper::Reconnect() { 679 void DtlsTransportChannelWrapper::Reconnect() {
676 set_dtls_state(DTLS_TRANSPORT_NEW); 680 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
677 set_writable(false); 681 set_writable(false);
678 if (channel_->writable()) { 682 VERIFY(MaybeStartDtls());
pthatcher1 2016/07/13 00:04:19 Can we inline this?
Taylor Brandstetter 2016/07/13 16:17:41 Done.
679 OnWritableState(channel_);
680 }
681 } 683 }
682 684
683 } // namespace cricket 685 } // namespace cricket
OLDNEW
« 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