From 808f49428fd53cfd21cfa427c16cdb72e3342f6d Mon Sep 17 00:00:00 2001 From: Jonas Oreland Date: Wed, 16 Jun 2021 13:42:20 +0200 Subject: [PATCH] LOG DTLS (failed) handshake retransmission Add logging of DTLS handshake retransmission, either when it happens or when it fails. Note that is only for the handshake messages, which are retransmitted with exponential back off. This patch aim to help rare DTLS hanging problems. BUG=None Change-Id: Iae808190711dd80dd8a43ff22757dd69919d63ef Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222647 Reviewed-by: Harald Alvestrand Commit-Queue: Jonas Oreland Cr-Commit-Position: refs/heads/master@{#34304} --- rtc_base/openssl_stream_adapter.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc index ab2289b1f3..aa0bc3d40c 100644 --- a/rtc_base/openssl_stream_adapter.cc +++ b/rtc_base/openssl_stream_adapter.cc @@ -834,7 +834,12 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { if (flag->alive()) { RTC_DLOG(LS_INFO) << "DTLS timeout expired"; timeout_task_.Stop(); - DTLSv1_handle_timeout(ssl_); + int res = DTLSv1_handle_timeout(ssl_); + if (res > 0) { + RTC_LOG(LS_INFO) << "DTLS retransmission"; + } else if (res < 0) { + RTC_LOG(LS_INFO) << "DTLSv1_handle_timeout() return -1"; + } ContinueSSL(); } else { RTC_NOTREACHED();