Bug 1290948 - Part 8: Don't cause ICE to fail if there's no streams to establish. r+drno r=drno

MozReview-Commit-ID: 4wxlK9w3sL6

--HG--
extra : rebase_source : 06a01ef64beb1352cee503349a287a511de50053
This commit is contained in:
Byron Campen [:bwc] 2017-09-29 09:16:14 -05:00
parent f7f959c4f1
commit b2254c16eb
2 changed files with 15 additions and 0 deletions

View File

@ -1043,8 +1043,21 @@ nsresult NrIceCtx::ParseGlobalAttributes(std::vector<std::string> attrs) {
return NS_OK;
}
bool NrIceCtx::HasStreamsToConnect() const {
for (auto& stream : streams_) {
if (stream && stream->state() != NrIceMediaStream::ICE_CLOSED) {
return true;
}
}
return false;
}
nsresult NrIceCtx::StartChecks(bool offerer) {
int r;
if (!HasStreamsToConnect()) {
// Nothing to do
return NS_OK;
}
offerer_ = offerer;
ice_start_time_ = TimeStamp::Now();

View File

@ -272,6 +272,8 @@ class NrIceCtx {
return streams_.size();
}
bool HasStreamsToConnect() const;
// The name of the ctx
const std::string& name() const { return name_; }