+20
-13
lines changedFilter options
+20
-13
lines changed Original file line number Diff line number Diff line change
@@ -163,8 +163,10 @@ class CRcvBufferNew
163
163
/// IF skipseqno == -1, no missing packet but 1st not ready to play.
164
164
PacketInfo getFirstValidPacketInfo() const;
165
165
166
-
/// Get information on the packets available to be read
167
-
/// @returns a pair of sequence numbers
166
+
/// Get information on packets available to be read.
167
+
/// @returns a pair of sequence numbers (first available; first unavailable).
168
+
///
169
+
/// @note CSeqNo::seqoff(first, second) is 0 if nothing to read.
168
170
std::pair<int, int> getAvailablePacketsRange() const;
169
171
170
172
size_t countReadable() const;
Original file line number Diff line number Diff line change
@@ -7734,7 +7734,7 @@ void srt::CUDT::releaseSynch()
7734
7734
// [[using locked(m_RcvBufferLock)]];
7735
7735
int32_t srt::CUDT::ackDataUpTo(int32_t ack)
7736
7736
{
7737
-
const int acksize = CSeqNo::seqoff(m_iRcvLastSkipAck, ack);
7737
+
const int acksize SRT_ATR_UNUSED = CSeqNo::seqoff(m_iRcvLastSkipAck, ack);
7738
7738
7739
7739
HLOGC(xtlog.Debug, log << "ackDataUpTo: %" << m_iRcvLastSkipAck << " -> %" << ack
7740
7740
<< " (" << acksize << " packets)");
@@ -7750,21 +7750,15 @@ int32_t srt::CUDT::ackDataUpTo(int32_t ack)
7750
7750
LOGC(xtlog.Error, log << "IPE: Acknowledged seqno %" << ack << " outruns the RCV buffer state %" << range.first
7751
7751
<< " - %" << range.second);
7752
7752
}
7753
-
return acksize;
7753
+
return CSeqNo::decseq(range.second);
7754
7754
#else
7755
7755
// NOTE: This is new towards UDT and prevents spurious
7756
7756
// wakeup of select/epoll functions when no new packets
7757
7757
// were signed off for extraction.
7758
7758
if (acksize > 0)
7759
7759
{
7760
-
const int distance = m_pRcvBuffer->ackData(acksize);
7761
-
return CSeqNo::decseq(ack, distance);
7760
+
m_pRcvBuffer->ackData(acksize);
7762
7761
}
7763
-
7764
-
// If nothing was confirmed, then use the current buffer span
7765
-
const int distance = m_pRcvBuffer->getRcvDataSize();
7766
-
if (distance > 0)
7767
-
return CSeqNo::decseq(ack, distance);
7768
7762
return ack;
7769
7763
#endif
7770
7764
}
@@ -8006,7 +8000,7 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
8006
8000
// IF ack %> m_iRcvLastAck
8007
8001
if (CSeqNo::seqcmp(ack, m_iRcvLastAck) > 0)
8008
8002
{
8009
-
const int32_t first_seq SRT_ATR_UNUSED = ackDataUpTo(ack);
8003
+
const int32_t group_read_seq SRT_ATR_UNUSED = ackDataUpTo(ack);
8010
8004
InvertedLock un_bufflock (m_RcvBufferLock);
8011
8005
8012
8006
#if ENABLE_EXPERIMENTAL_BONDING
@@ -8101,7 +8095,7 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
8101
8095
// The current "APP reader" needs to simply decide as to whether
8102
8096
// the next CUDTGroup::recv() call should return with no blocking or not.
8103
8097
// When the group is read-ready, it should update its pollers as it sees fit.
8104
-
m_parent->m_GroupOf->updateReadState(m_SocketID, first_seq);
8098
+
m_parent->m_GroupOf->updateReadState(m_SocketID, group_read_seq);
8105
8099
}
8106
8100
}
8107
8101
#endif
Original file line number Diff line number Diff line change
@@ -1043,7 +1043,13 @@ class CUDT
1043
1043
int processConnectRequest(const sockaddr_any& addr, CPacket& packet);
1044
1044
static void addLossRecord(std::vector<int32_t>& lossrecord, int32_t lo, int32_t hi);
1045
1045
int32_t bake(const sockaddr_any& addr, int32_t previous_cookie = 0, int correction = 0);
1046
+
1047
+
/// @brief Acknowledge reading position up to the @p seq.
1048
+
/// Updates m_iRcvLastAck and m_iRcvLastSkipAck to @p seq.
1049
+
/// @param seq first unacknowledged packet sequence number.
1050
+
/// @return
1046
1051
int32_t ackDataUpTo(int32_t seq);
1052
+
1047
1053
void handleKeepalive(const char* data, size_t lenghth);
1048
1054
1049
1055
/// Locks m_RcvBufferLock and retrieves the available size of the receiver buffer.
Original file line number Diff line number Diff line change
@@ -341,7 +341,12 @@ class CUDTGroup
341
341
void addEPoll(int eid);
342
342
void removeEPollEvents(const int eid);
343
343
void removeEPollID(const int eid);
344
+
345
+
/// @brief Update read-ready state.
346
+
/// @param sock member socket ID (unused)
347
+
/// @param sequence the latest packet sequence number available for reading.
344
348
void updateReadState(SRTSOCKET sock, int32_t sequence);
349
+
345
350
void updateWriteState();
346
351
void updateFailedLink();
347
352
void activateUpdateEvent(bool still_have_items);
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