提交 0efec5f2 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

C++: add missing { } in if() conditions

上级 88a399d4
...@@ -57,11 +57,15 @@ namespace RTC ...@@ -57,11 +57,15 @@ namespace RTC
for (auto it = this->streamIdTable.begin(); it != this->streamIdTable.end();) for (auto it = this->streamIdTable.begin(); it != this->streamIdTable.end();)
{ {
if (it->second == dataProducer) if (it->second == dataProducer)
{
it = this->streamIdTable.erase(it); it = this->streamIdTable.erase(it);
}
else else
{
++it; ++it;
} }
} }
}
RTC::DataProducer* SctpListener::GetDataProducer(uint16_t streamId) RTC::DataProducer* SctpListener::GetDataProducer(uint16_t streamId)
{ {
......
...@@ -60,13 +60,17 @@ namespace RTC ...@@ -60,13 +60,17 @@ namespace RTC
// a DTLS Close Alert this would be closed (Close() called) so we cannot call // a DTLS Close Alert this would be closed (Close() called) so we cannot call
// our listeners anymore. // our listeners anymore.
if (IsClosed()) if (IsClosed())
{
return; return;
}
const size_t dataLen = this->bufferDataLen - this->frameStart; const size_t dataLen = this->bufferDataLen - this->frameStart;
size_t packetLen; size_t packetLen;
if (dataLen >= 2) if (dataLen >= 2)
{
packetLen = size_t{ Utils::Byte::Get2Bytes(this->buffer + this->frameStart, 0) }; packetLen = size_t{ Utils::Byte::Get2Bytes(this->buffer + this->frameStart, 0) };
}
// We have packetLen bytes. // We have packetLen bytes.
if (dataLen >= 2 && dataLen >= 2 + packetLen) if (dataLen >= 2 && dataLen >= 2 + packetLen)
......
...@@ -336,21 +336,35 @@ namespace RTC ...@@ -336,21 +336,35 @@ namespace RTC
switch (this->sctpAssociation->GetState()) switch (this->sctpAssociation->GetState())
{ {
case RTC::SctpAssociation::SctpState::NEW: case RTC::SctpAssociation::SctpState::NEW:
{
sctpState = FBS::SctpAssociation::SctpState::NEW; sctpState = FBS::SctpAssociation::SctpState::NEW;
break; break;
}
case RTC::SctpAssociation::SctpState::CONNECTING: case RTC::SctpAssociation::SctpState::CONNECTING:
{
sctpState = FBS::SctpAssociation::SctpState::CONNECTING; sctpState = FBS::SctpAssociation::SctpState::CONNECTING;
break; break;
}
case RTC::SctpAssociation::SctpState::CONNECTED: case RTC::SctpAssociation::SctpState::CONNECTED:
{
sctpState = FBS::SctpAssociation::SctpState::CONNECTED; sctpState = FBS::SctpAssociation::SctpState::CONNECTED;
break; break;
}
case RTC::SctpAssociation::SctpState::FAILED: case RTC::SctpAssociation::SctpState::FAILED:
{
sctpState = FBS::SctpAssociation::SctpState::FAILED; sctpState = FBS::SctpAssociation::SctpState::FAILED;
break; break;
}
case RTC::SctpAssociation::SctpState::CLOSED: case RTC::SctpAssociation::SctpState::CLOSED:
{
sctpState = FBS::SctpAssociation::SctpState::CLOSED; sctpState = FBS::SctpAssociation::SctpState::CLOSED;
break; break;
} }
}
sctpListener = this->sctpListener.FillBuffer(builder); sctpListener = this->sctpListener.FillBuffer(builder);
} }
...@@ -403,22 +417,36 @@ namespace RTC ...@@ -403,22 +417,36 @@ namespace RTC
switch (this->sctpAssociation->GetState()) switch (this->sctpAssociation->GetState())
{ {
case RTC::SctpAssociation::SctpState::NEW: case RTC::SctpAssociation::SctpState::NEW:
{
sctpState = FBS::SctpAssociation::SctpState::NEW; sctpState = FBS::SctpAssociation::SctpState::NEW;
break; break;
}
case RTC::SctpAssociation::SctpState::CONNECTING: case RTC::SctpAssociation::SctpState::CONNECTING:
{
sctpState = FBS::SctpAssociation::SctpState::CONNECTING; sctpState = FBS::SctpAssociation::SctpState::CONNECTING;
break; break;
}
case RTC::SctpAssociation::SctpState::CONNECTED: case RTC::SctpAssociation::SctpState::CONNECTED:
{
sctpState = FBS::SctpAssociation::SctpState::CONNECTED; sctpState = FBS::SctpAssociation::SctpState::CONNECTED;
break; break;
}
case RTC::SctpAssociation::SctpState::FAILED: case RTC::SctpAssociation::SctpState::FAILED:
{
sctpState = FBS::SctpAssociation::SctpState::FAILED; sctpState = FBS::SctpAssociation::SctpState::FAILED;
break; break;
}
case RTC::SctpAssociation::SctpState::CLOSED: case RTC::SctpAssociation::SctpState::CLOSED:
{
sctpState = FBS::SctpAssociation::SctpState::CLOSED; sctpState = FBS::SctpAssociation::SctpState::CLOSED;
break; break;
} }
} }
}
return FBS::Transport::CreateStatsDirect( return FBS::Transport::CreateStatsDirect(
builder, builder,
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论