File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,16 @@ namespace transport
152152
153153 void UpdateBandwidth ()
154154 {
155- uint64_t interval = m_LastActivityTimestamp - m_LastBandwidthUpdateTimestamp;
156- if (interval > TRANSPORT_SESSION_BANDWIDTH_UPDATE_MIN_INTERVAL)
155+ int64_t interval = m_LastActivityTimestamp - m_LastBandwidthUpdateTimestamp;
156+ if (interval < 0 || interval > 60 *10 ) // 10 minutes
157+ {
158+ // clock was adjusted, copy new values
159+ m_LastBandWidthUpdateNumSentBytes = m_NumSentBytes;
160+ m_LastBandWidthUpdateNumReceivedBytes = m_NumReceivedBytes;
161+ m_LastBandwidthUpdateTimestamp = m_LastActivityTimestamp;
162+ return ;
163+ }
164+ if ((uint64_t )interval > TRANSPORT_SESSION_BANDWIDTH_UPDATE_MIN_INTERVAL)
157165 {
158166 m_OutBandwidth = (m_NumSentBytes - m_LastBandWidthUpdateNumSentBytes)/interval;
159167 m_LastBandWidthUpdateNumSentBytes = m_NumSentBytes;
You can’t perform that action at this time.
0 commit comments