DataChannel: Propagate SCTP transport errors to the channels
When the transport is terminated, if an error has occured, it will
be propagated to the channels.
When such errors can happen at the SCTP level (e.g. out of resources),
RTCError may contain an error code matching the definition at
https://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml#sctp-parameters-24
If the m= line is rejected or removed from SDP, an error will again be sent
to the data channels, signaling their unexpected transition to closed.
Bug: webrtc:12904
Change-Id: Iea3d8aba0a57bbedb5d03f0fb6f7aba292e92fe8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223541
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34386}
diff --git a/pc/sctp_data_channel.h b/pc/sctp_data_channel.h
index 1d7a3c7..b0df487 100644
--- a/pc/sctp_data_channel.h
+++ b/pc/sctp_data_channel.h
@@ -177,8 +177,6 @@
void CloseAbruptlyWithError(RTCError error);
// Specializations of CloseAbruptlyWithError
void CloseAbruptlyWithDataChannelFailure(const std::string& message);
- void CloseAbruptlyWithSctpCauseCode(const std::string& message,
- uint16_t cause_code);
// Slots for provider to connect signals to.
//
@@ -209,7 +207,7 @@
// Called when the transport channel is unusable.
// This method makes sure the DataChannel is disconnected and changes state
// to kClosed.
- void OnTransportChannelClosed();
+ void OnTransportChannelClosed(RTCError error);
DataChannelStats GetStats() const;