Skip to content

Commit

Permalink
[core] Fixed pre-initialization of the last sample time for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki authored and maxsharabayko committed Feb 10, 2021
1 parent 28f2021 commit 94077c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,10 @@ SRTSOCKET CUDTUnited::accept(const SRTSOCKET listen, sockaddr* pw_addr, int* pw_
{
u = s->m_GroupOf->m_GroupID;
s->core().m_OPT_GroupConnect = 1; // should be derived from ls, but make sure

// Mark the beginning of the connection at the moment
// when the group ID is returned to the app caller
s->m_GroupOf->m_stats.tsLastSampleTime = steady_clock::now();
}
else
{
Expand Down Expand Up @@ -1616,6 +1620,8 @@ int CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, int ar
// should block always if the group doesn't have neither 1 conencted link
g.m_bOpened = true;

g.m_stats.tsLastSampleTime = steady_clock::now();

f->laststatus = st;
// Check the socket status and update it.
// Turn the group state of the socket to IDLE only if
Expand Down

0 comments on commit 94077c3

Please sign in to comment.