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

Make clang-tidy happier

上级 ddb1f3e0
......@@ -28,9 +28,9 @@ namespace RTC
private:
void RollbackProducer(
RTC::Producer* producer,
std::vector<uint32_t>& previousSsrcs,
std::string& previousMuxId,
std::string& previousRid);
const std::vector<uint32_t>& previousSsrcs,
const std::string& previousMuxId,
const std::string& previousRid);
public:
// Table of SSRC / Producer pairs.
......
......@@ -57,7 +57,7 @@ private:
static void SetRtcIPv6(const std::string& ip);
static void SetRtcPorts();
static void SetDtlsCertificateAndPrivateKeyFiles();
static void SetLogTags(std::vector<std::string>& tags);
static void SetLogTags(const std::vector<std::string>& tags);
static void SetLogTags(Json::Value& json);
public:
......
......@@ -50,7 +50,7 @@ namespace RTC
{
/* Static. */
static constexpr int dtlsMtu{ 1350 };
static constexpr int DtlsMtu{ 1350 };
static constexpr int SslReadBufferSize{ 65536 };
// NOTE: Those values are hardcoded as we just use AES_CM_128_HMAC_SHA1_80 and
// AES_CM_128_HMAC_SHA1_32 which share same length values for key and salt.
......@@ -551,8 +551,8 @@ namespace RTC
SSL_set_bio(this->ssl, this->sslBioFromNetwork, this->sslBioToNetwork);
// Set the MTU so that we don't send packets that are too large with no fragmentation.
SSL_set_mtu(this->ssl, dtlsMtu);
DTLS_set_link_mtu(this->ssl, dtlsMtu);
SSL_set_mtu(this->ssl, DtlsMtu);
DTLS_set_link_mtu(this->ssl, DtlsMtu);
/* Set the DTLS timer. */
......@@ -873,8 +873,8 @@ namespace RTC
// Process the handshake just once (ignore if DTLS renegotiation).
if (!wasHandshakeDone && this->remoteFingerprint.algorithm != FingerprintAlgorithm::NONE)
return ProcessHandshake();
else
return true;
return true;
}
// Check if the peer sent close alert or a fatal error happened.
else if (((SSL_get_shutdown(this->ssl) & SSL_RECEIVED_SHUTDOWN) != 0) || err == SSL_ERROR_SSL || err == SSL_ERROR_SYSCALL)
......@@ -1008,20 +1008,18 @@ namespace RTC
return true;
}
else
{
// NOTE: We assume that "use_srtp" DTLS extension is required even if
// there is no audio/video.
MS_WARN_TAG(dtls, "SRTP profile not negotiated");
Reset();
// NOTE: We assume that "use_srtp" DTLS extension is required even if
// there is no audio/video.
MS_WARN_TAG(dtls, "SRTP profile not negotiated");
// Set state and notify the listener.
this->state = DtlsState::FAILED;
this->listener->OnDtlsFailed(this);
Reset();
return false;
}
// Set state and notify the listener.
this->state = DtlsState::FAILED;
this->listener->OnDtlsFailed(this);
return false;
}
inline bool DtlsTransport::CheckRemoteFingerprint()
......
......@@ -83,8 +83,7 @@ namespace RTC
{
MS_TRACE();
if (this->tuple != nullptr)
delete this->tuple;
delete this->tuple;
if (this->udpSocket != nullptr)
this->udpSocket->Destroy();
......@@ -224,7 +223,7 @@ namespace RTC
bool PlainRtpTransport::IsConnected() const
{
return this->tuple ? true : false;
return this->tuple != nullptr;
}
void PlainRtpTransport::SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet)
......
......@@ -328,9 +328,9 @@ namespace RTC
void RtpListener::RollbackProducer(
RTC::Producer* producer,
std::vector<uint32_t>& previousSsrcs,
std::string& previousMuxId,
std::string& previousRid)
const std::vector<uint32_t>& previousSsrcs,
const std::string& previousMuxId,
const std::string& previousRid)
{
MS_TRACE();
......
......@@ -364,7 +364,7 @@ namespace RTC
{
MS_TRACE();
static const std::string type("transport");
static const std::string Type("transport");
static const Json::StaticString JsonStringType{ "type" };
static const Json::StaticString JsonStringTimestamp{ "timestamp" };
static const Json::StaticString JsonStringId{ "id" };
......@@ -393,7 +393,7 @@ namespace RTC
Json::Value json(Json::objectValue);
json[JsonStringType] = type;
json[JsonStringType] = Type;
json[JsonStringTimestamp] = Json::UInt64{ DepLibUV::GetTime() };
json[JsonStringId] = Json::UInt{ this->transportId };
......
......@@ -543,7 +543,7 @@ void Settings::SetDtlsCertificateAndPrivateKeyFiles()
Settings::configuration.dtlsPrivateKeyFile = dtlsPrivateKeyFile;
}
void Settings::SetLogTags(std::vector<std::string>& tags)
void Settings::SetLogTags(const std::vector<std::string>& tags)
{
MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论