Revert mid check in SdpOfferAnswerHandler::CreateDataChannel.

This check was added here:
  https://webrtc-review.googlesource.com/c/src/+/300544

When createOffer is used before createAnswer, this check would cause
SetupDataChannelTransport_n to not be called for the remote channel.

Bug: webrtc:15258
Change-Id: Ifdab35d1b0260ff03fef4beff13acf8090d59d8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310460
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40357}
This commit is contained in:
Tommi 2023-06-26 21:11:35 +02:00 committed by WebRTC LUCI CQ
parent 365a5717ae
commit 299cdc9057

View File

@ -5169,11 +5169,7 @@ RTCError SdpOfferAnswerHandler::CreateChannels(const SessionDescription& desc) {
bool SdpOfferAnswerHandler::CreateDataChannel(const std::string& mid) {
RTC_DCHECK_RUN_ON(signaling_thread());
if (pc_->sctp_mid().has_value()) {
RTC_DCHECK_EQ(mid, *pc_->sctp_mid());
return true; // data channel already created.
}
RTC_DCHECK(!pc_->sctp_mid().has_value() || mid == pc_->sctp_mid().value());
RTC_LOG(LS_INFO) << "Creating data channel, mid=" << mid;
absl::optional<std::string> transport_name =