Improve DTLS logging.

See b/142641135.

Bug: None
Change-Id: I59d74b0d6c53a421d8104cc5455bab2e8dcf27d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166048
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30280}
This commit is contained in:
Henrik Boström
2020-01-16 12:41:50 +01:00
committed by Commit Bot
parent c7bce99540
commit e2747b8e0d

View File

@ -419,8 +419,16 @@ int DtlsTransport::SendPacket(const char* data,
: -1;
}
case DTLS_TRANSPORT_FAILED:
// Can't send anything when we're failed.
RTC_LOG(LS_ERROR)
<< ToString()
<< ": Couldn't send packet due to DTLS_TRANSPORT_FAILED.";
return -1;
case DTLS_TRANSPORT_CLOSED:
// Can't send anything when we're closed.
RTC_LOG(LS_ERROR)
<< ToString()
<< ": Couldn't send packet due to DTLS_TRANSPORT_CLOSED.";
return -1;
default:
RTC_NOTREACHED();
@ -510,8 +518,16 @@ void DtlsTransport::OnWritableState(rtc::PacketTransportInternal* transport) {
// Do nothing.
break;
case DTLS_TRANSPORT_FAILED:
// Should not happen. Do nothing.
RTC_LOG(LS_ERROR)
<< ToString()
<< ": OnWritableState() called in state DTLS_TRANSPORT_FAILED.";
break;
case DTLS_TRANSPORT_CLOSED:
// Should not happen. Do nothing.
RTC_LOG(LS_ERROR)
<< ToString()
<< ": OnWritableState() called in state DTLS_TRANSPORT_CLOSED.";
break;
}
}