Skip to content

Commit

Permalink
[core] Minor fixes: warn, formatting, trace, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Feb 8, 2021
1 parent 2872939 commit 28f2021
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8776,10 +8776,7 @@ void CUDT::processCtrl(const CPacket &ctrlpkt)
case UMSG_ACKACK: // 110 - Acknowledgement of Acknowledgement
{
int32_t ack = 0;
int rtt = -1;

// update RTT
rtt = m_ACKWindow.acknowledge(ctrlpkt.getAckSeqNo(), ack);
const int rtt = m_ACKWindow.acknowledge(ctrlpkt.getAckSeqNo(), ack);
if (rtt <= 0)
{
LOGC(inlog.Error,
Expand Down
4 changes: 2 additions & 2 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ class StabilityTracer
return;

std::string str_tnow = srt::sync::FormatTimeSys(srt::sync::steady_clock::now());
str_tnow.resize(str_tnow.size() - 6); // remove trailing ' [SYS]' part
str_tnow.resize(str_tnow.size() - 7); // remove trailing ' [SYST]' part
while (str_tnow.find(':') != std::string::npos) {
str_tnow.replace(str_tnow.find(':'), 1, 1, '_');
}
Expand All @@ -3051,7 +3051,7 @@ StabilityTracer s_stab_trace;
/// @retval 1 - link is identified as stable
/// @retval 0 - link state remains unchanged (too early to identify, still in activation phase)
/// @retval -1 - link is identified as unstable
static int sendBackup_CheckRunningLinkStable(const CUDT& u, const srt::sync::steady_clock::time_point& currtime, uint16_t weight)
static int sendBackup_CheckRunningLinkStable(const CUDT& u, const srt::sync::steady_clock::time_point& currtime, uint16_t weight ATR_UNUSED)
{
const uint32_t latency_us = u.peerLatency_us();
const int32_t min_stability_us = 60000; // Minimum Link Stability Timeout: 60ms.
Expand Down
2 changes: 1 addition & 1 deletion srtcore/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int acknowledge(Seq* r_aSeq, const size_t size, int& r_iHead, int& r_iTail, int3

for (int i = r_iTail, n = r_iHead; i < n; ++ i)
{
// looking for indentical ACK Seq. No.
// looking for identical ACK Seq. No.
if (seq == r_aSeq[i].iACKSeqNo)
{
// return the Data ACK it carried
Expand Down

0 comments on commit 28f2021

Please sign in to comment.