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

Unified Diff: webrtc/base/opensslstreamadapter.cc

Issue 2670113002: Pick the DTLS handshake timeout based on the ICE RTT estimate (Closed)
Patch Set: Rename InitialHandshakeRetransmissionTimeout -> InitialRetransmissionTimeout. Created 3 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/opensslstreamadapter.h ('k') | webrtc/base/sslstreamadapter.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 83efdc8bc0579493018eb7604ba99fb965e25d1a..0057ce1bf5bc3a9c0ed62c6516dc7516b63e6b99 100644
--- a/webrtc/base/opensslstreamadapter.cc
+++ b/webrtc/base/opensslstreamadapter.cc
@@ -523,6 +523,12 @@ void OpenSSLStreamAdapter::SetMaxProtocolVersion(SSLProtocolVersion version) {
ssl_max_version_ = version;
}
+void OpenSSLStreamAdapter::SetInitialRetransmissionTimeout(
+ int timeout_ms) {
+ RTC_DCHECK(ssl_ctx_ == NULL);
+ dtls_handshake_timeout_ms_ = timeout_ms;
+}
+
//
// StreamInterface Implementation
//
@@ -800,11 +806,7 @@ int OpenSSLStreamAdapter::BeginSSL() {
SSL_set_bio(ssl_, bio, bio); // the SSL object owns the bio now.
if (ssl_mode_ == SSL_MODE_DTLS) {
#ifdef OPENSSL_IS_BORINGSSL
- // Change the initial retransmission timer from 1 second to 50ms.
- // This will likely result in some spurious retransmissions, but
- // it's useful for ensuring a timely handshake when there's packet
- // loss.
- DTLSv1_set_initial_timeout_duration(ssl_, 50);
+ DTLSv1_set_initial_timeout_duration(ssl_, dtls_handshake_timeout_ms_);
#else
// Enable read-ahead for DTLS so whole packets are read from internal BIO
// before parsing. This is done internally by BoringSSL for DTLS.
« no previous file with comments | « webrtc/base/opensslstreamadapter.h ('k') | webrtc/base/sslstreamadapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698