Bug 1735972: reset current channel if that channel is closed r=bwc
authorRandell Jesup <rjesup@wgate.com>
Tue, 19 Oct 2021 23:21:18 +0000
changeset 596431 aadf149cc1c8a35764f3cb3f421437650fbfcb29
parent 596430 f02d7e733e4d0003828d3164a4f7b7338fa2433f
child 596432 4c15bc74e9144b1aa3b74c65533838ebad31940a
push id38898
push userimoraru@mozilla.com
push dateThu, 21 Oct 2021 03:32:00 +0000
treeherdermozilla-central@811f11b91f11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1735972
milestone95.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1735972: reset current channel if that channel is closed r=bwc Differential Revision: https://phabricator.services.mozilla.com/D128739
netwerk/sctp/datachannel/DataChannel.cpp
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -1206,16 +1206,21 @@ uint32_t DataChannelConnection::UpdateCu
     mCurrentStream = 0;
   } else {
     mCurrentStream = channel->mStream;
   }
   return mCurrentStream;
 }
 
 uint32_t DataChannelConnection::GetCurrentStreamIndex() {
+  if (!mChannels.Get(mCurrentStream)) {
+    // The stream muse have been removed, reset
+    DC_DEBUG(("Reset mCurrentChannel"));
+    mCurrentStream = 0;
+  }
   return mCurrentStream;
 }
 
 bool DataChannelConnection::RequestMoreStreams(int32_t aNeeded) {
   struct sctp_status status;
   struct sctp_add_streams sas;
   uint32_t outStreamsNeeded;
   socklen_t len;