+47
-18
lines changedFilter options
+47
-18
lines changed Original file line number Diff line number Diff line change
@@ -200,6 +200,15 @@ int CRcvBufferNew::dropUpTo(int32_t seqno)
200
200
return iDropCnt;
201
201
}
202
202
203
+
int CRcvBufferNew::dropAll()
204
+
{
205
+
if (empty())
206
+
return 0;
207
+
208
+
const int end_seqno = CSeqNo::incseq(m_iStartSeqNo, m_iMaxPosInc);
209
+
return dropUpTo(end_seqno);
210
+
}
211
+
203
212
int CRcvBufferNew::dropMessage(int32_t seqnolo, int32_t seqnohi, int32_t msgno)
204
213
{
205
214
IF_RCVBUF_DEBUG(ScopedLog scoped_log);
Original file line number Diff line number Diff line change
@@ -70,9 +70,13 @@ class CRcvBufferNew
70
70
/// Drop packets in the receiver buffer from the current position up to the seqno (excluding seqno).
71
71
/// @param [in] seqno drop units up to this sequence number
72
72
/// @return number of dropped packets.
73
-
///
74
73
int dropUpTo(int32_t seqno);
75
74
75
+
/// @brief Drop all the packets in the receiver buffer.
76
+
/// The starting position and seqno are shifted right after the last packet in the buffer.
77
+
/// @return the number of dropped packets.
78
+
int dropAll();
79
+
76
80
/// @brief Drop the whole message from the buffer.
77
81
/// If message number is 0, then use sequence numbers to locate sequence range to drop [seqnolo, seqnohi].
78
82
/// When one packet of the message is in the range of dropping, the whole message is to be dropped.
@@ -109,6 +113,10 @@ class CRcvBufferNew
109
113
/// Get the starting position of the buffer as a packet sequence number.
110
114
int getStartSeqNo() const { return m_iStartSeqNo; }
111
115
116
+
/// Sets the start seqno of the buffer.
117
+
/// Must be used with caution and only when the buffer is empty.
118
+
void setStartSeqNo(int seqno) { m_iStartSeqNo = seqno; }
119
+
112
120
/// Given the sequence number of the first unacknowledged packet
113
121
/// tells the size of the buffer available for packets.
114
122
/// Effective returns capacity of the buffer minus acknowledged packet still kept in it.
@@ -325,8 +333,6 @@ class CRcvBufferNew
325
333
326
334
void setPeerRexmitFlag(bool flag) { m_bPeerRexmitFlag = flag; }
327
335
328
-
void applyGroupISN(int rcv_isn) { m_iStartSeqNo = rcv_isn; }
329
-
330
336
void applyGroupTime(const time_point& timebase, bool wrp, uint32_t delay, const duration& udrift);
331
337
332
338
void applyGroupDrift(const time_point& timebase, bool wrp, const duration& udrift);
Original file line number Diff line number Diff line change
@@ -3333,11 +3333,6 @@ void srt::CUDT::synchronizeWithGroup(CUDTGroup* gp)
3333
3333
<< " (shift by " << CSeqNo::seqcmp(snd_isn, m_iSndLastAck) << ")");
3334
3334
setInitialRcvSeq(rcv_isn);
3335
3335
setInitialSndSeq(snd_isn);
3336
-
#if ENABLE_NEW_RCVBUFFER
3337
-
enterCS(m_RecvLock);
3338
-
m_pRcvBuffer->applyGroupISN(rcv_isn);
3339
-
leaveCS(m_RecvLock);
3340
-
#endif
3341
3336
}
3342
3337
else
3343
3338
{
@@ -5327,6 +5322,34 @@ void * srt::CUDT::tsbpd(void* param)
5327
5322
return NULL;
5328
5323
}
5329
5324
5325
+
void srt::CUDT::setInitialRcvSeq(int32_t isn)
5326
+
{
5327
+
m_iRcvLastAck = isn;
5328
+
#ifdef ENABLE_LOGGING
5329
+
m_iDebugPrevLastAck = m_iRcvLastAck;
5330
+
#endif
5331
+
m_iRcvLastSkipAck = m_iRcvLastAck;
5332
+
m_iRcvLastAckAck = isn;
5333
+
m_iRcvCurrSeqNo = CSeqNo::decseq(isn);
5334
+
5335
+
#if ENABLE_NEW_RCVBUFFER
5336
+
sync::ScopedLock rb(m_RcvBufferLock);
5337
+
if (m_pRcvBuffer)
5338
+
{
5339
+
if (!m_pRcvBuffer->empty())
5340
+
{
5341
+
LOGC(cnlog.Error, log << "IPE: setInitialRcvSeq expected empty RCV buffer. Dropping all.");
5342
+
const int iDropCnt = m_pRcvBuffer->dropAll();
5343
+
const uint64_t avgpayloadsz = m_pRcvBuffer->getRcvAvgPayloadSize();
5344
+
sync::ScopedLock sl(m_StatsLock);
5345
+
m_stats.rcvr.dropped.count(stats::BytesPackets(iDropCnt * avgpayloadsz, (size_t)iDropCnt));
5346
+
}
5347
+
5348
+
m_pRcvBuffer->setStartSeqNo(m_iRcvLastSkipAck);
5349
+
}
5350
+
#endif
5351
+
}
5352
+
5330
5353
int srt::CUDT::rcvDropTooLateUpTo(int seqno)
5331
5354
{
5332
5355
const int seq_gap_len = CSeqNo::seqoff(m_iRcvLastSkipAck, seqno);
Original file line number Diff line number Diff line change
@@ -887,16 +887,7 @@ class CUDT
887
887
m_iSndLastAck2 = isn;
888
888
}
889
889
890
-
void setInitialRcvSeq(int32_t isn)
891
-
{
892
-
m_iRcvLastAck = isn;
893
-
#ifdef ENABLE_LOGGING
894
-
m_iDebugPrevLastAck = m_iRcvLastAck;
895
-
#endif
896
-
m_iRcvLastSkipAck = m_iRcvLastAck;
897
-
m_iRcvLastAckAck = isn;
898
-
m_iRcvCurrSeqNo = CSeqNo::decseq(isn);
899
-
}
890
+
void setInitialRcvSeq(int32_t isn);
900
891
901
892
int32_t m_iISN; // Initial Sequence Number
902
893
bool m_bPeerTsbPd; // Peer accept TimeStamp-Based Rx mode
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4