A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/ac854f262ac2a78f152005876cec0da593845166 below:

[core] Fixed setting the peer rexmit flag on the RCV buffer · Haivision/srt@ac854f2 · GitHub

File tree Expand file treeCollapse file tree 5 files changed

+19

-15

lines changed

Filter options

Expand file treeCollapse file tree 5 files changed

+19

-15

lines changed Original file line number Diff line number Diff line change

@@ -70,7 +70,7 @@ namespace {

70 70

* m_iMaxPosInc: none? (modified on add and ack

71 71

*/

72 72 73 -

CRcvBufferNew::CRcvBufferNew(int initSeqNo, size_t size, CUnitQueue* unitqueue, bool peerRexmit, bool bMessageAPI)

73 +

CRcvBufferNew::CRcvBufferNew(int initSeqNo, size_t size, CUnitQueue* unitqueue, bool bMessageAPI)

74 74

: m_entries(size)

75 75

, m_szSize(size) // TODO: maybe just use m_entries.size()

76 76

, m_pUnitQueue(unitqueue)

@@ -81,7 +81,7 @@ CRcvBufferNew::CRcvBufferNew(int initSeqNo, size_t size, CUnitQueue* unitqueue,

81 81

, m_iNotch(0)

82 82

, m_numOutOfOrderPackets(0)

83 83

, m_iFirstReadableOutOfOrder(-1)

84 -

, m_bPeerRexmitFlag(peerRexmit)

84 +

, m_bPeerRexmitFlag(true)

85 85

, m_bMessageAPI(bMessageAPI)

86 86

, m_iBytesCount(0)

87 87

, m_iPktsCount(0)

Original file line number Diff line number Diff line change

@@ -51,7 +51,7 @@ class CRcvBufferNew

51 51

typedef sync::steady_clock::duration duration;

52 52 53 53

public:

54 -

CRcvBufferNew(int initSeqNo, size_t size, CUnitQueue* unitqueue, bool peerRexmit, bool bMessageAPI);

54 +

CRcvBufferNew(int initSeqNo, size_t size, CUnitQueue* unitqueue, bool bMessageAPI);

55 55 56 56

~CRcvBufferNew();

57 57

@@ -308,7 +308,7 @@ class CRcvBufferNew

308 308

size_t m_numOutOfOrderPackets; // The number of stored packets with "inorder" flag set to false

309 309

int m_iFirstReadableOutOfOrder; // In case of out ouf order packet, points to a position of the first such packet to

310 310

// read

311 -

const bool m_bPeerRexmitFlag; // Needed to read message number correctly

311 +

bool m_bPeerRexmitFlag; // Needed to read message number correctly

312 312

const bool m_bMessageAPI; // Operation mode flag: message or stream.

313 313 314 314

public: // TSBPD public functions

@@ -320,6 +320,8 @@ class CRcvBufferNew

320 320

/// @return 0

321 321

void setTsbPdMode(const time_point& timebase, bool wrap, duration delay);

322 322 323 +

void setPeerRexmitFlag(bool flag) { m_bPeerRexmitFlag = flag; }

324 + 323 325

void applyGroupTime(const time_point& timebase, bool wrp, uint32_t delay, const duration& udrift);

324 326 325 327

void applyGroupDrift(const time_point& timebase, bool wrp, const duration& udrift);

Original file line number Diff line number Diff line change

@@ -2414,7 +2414,7 @@ bool srt::CUDT::interpretSrtHandshake(const CHandShake& hs,

2414 2414

}

2415 2415 2416 2416

// We still believe it should work, let's check the flags.

2417 -

int ext_flags = SrtHSRequest::SRT_HSTYPE_HSFLAGS::unwrap(hs.m_iType);

2417 +

const int ext_flags = SrtHSRequest::SRT_HSTYPE_HSFLAGS::unwrap(hs.m_iType);

2418 2418

if (ext_flags == 0)

2419 2419

{

2420 2420

m_RejectReason = SRT_REJ_ROGUE;

@@ -4019,15 +4019,16 @@ EConnectStatus srt::CUDT::processRendezvous(

4019 4019

m_ConnReq.m_iReqType = rsp_type;

4020 4020

m_ConnReq.m_extension = needs_extension;

4021 4021 4022 -

// This must be done before prepareConnectionObjects().

4022 +

// This must be done before prepareConnectionObjects(), because it sets ISN and m_iMaxSRTPayloadSize needed to create buffers.

4023 4023

if (!applyResponseSettings())

4024 4024

{

4025 4025

LOGC(cnlog.Error, log << "processRendezvous: rogue peer");

4026 4026

return CONN_REJECT;

4027 4027

}

4028 4028 4029 -

// This must be done before interpreting and creating HSv5 extensions.

4030 -

if (!prepareConnectionObjects(m_ConnRes, m_SrtHsSide, 0))

4029 +

// The CryptoControl must be created by the prepareConnectionObjects() before interpreting and creating HSv5 extensions

4030 +

// because the it will be used there.

4031 +

if (!prepareConnectionObjects(m_ConnRes, m_SrtHsSide, NULL))

4031 4032

{

4032 4033

// m_RejectReason already handled

4033 4034

HLOGC(cnlog.Debug, log << "processRendezvous: rejecting due to problems in prepareConnectionObjects.");

@@ -4536,6 +4537,7 @@ EConnectStatus srt::CUDT::postConnect(const CPacket* pResponse, bool rendezvous,

4536 4537

// however in this case the HSREQ extension will not be attached,

4537 4538

// so it will simply go the "old way".

4538 4539

// (&&: skip if failed already)

4540 +

// Must be called before interpretSrtHandshake() to create the CryptoControl.

4539 4541

ok = ok && prepareConnectionObjects(m_ConnRes, m_SrtHsSide, eout);

4540 4542 4541 4543

// May happen that 'response' contains a data packet that was sent in rendezvous mode.

@@ -5568,11 +5570,8 @@ bool srt::CUDT::prepareConnectionObjects(const CHandShake &hs, HandshakeSide hsd

5568 5570

return true;

5569 5571

}

5570 5572 5571 -

bool bidirectional = false;

5572 -

if (hs.m_iVersion > HS_VERSION_UDT4)

5573 -

{

5574 -

bidirectional = true; // HSv5 is always bidirectional

5575 -

}

5573 +

// HSv5 is always bidirectional

5574 +

const bool bidirectional = (hs.m_iVersion > HS_VERSION_UDT4);

5576 5575 5577 5576

// HSD_DRAW is received only if this side is listener.

5578 5577

// If this side is caller with HSv5, HSD_INITIATOR should be passed.

@@ -5595,7 +5594,7 @@ bool srt::CUDT::prepareConnectionObjects(const CHandShake &hs, HandshakeSide hsd

5595 5594

m_pSndBuffer = new CSndBuffer(32, m_iMaxSRTPayloadSize);

5596 5595

#if ENABLE_NEW_RCVBUFFER

5597 5596

SRT_ASSERT(m_iISN != -1);

5598 -

m_pRcvBuffer = new srt::CRcvBufferNew(m_iISN, m_config.iRcvBufSize, &(m_pRcvQueue->m_UnitQueue), m_bPeerRexmitFlag, m_config.bMessageAPI);

5597 +

m_pRcvBuffer = new srt::CRcvBufferNew(m_iISN, m_config.iRcvBufSize, &(m_pRcvQueue->m_UnitQueue), m_config.bMessageAPI);

5599 5598

#else

5600 5599

m_pRcvBuffer = new CRcvBuffer(&(m_pRcvQueue->m_UnitQueue), m_config.iRcvBufSize);

5601 5600

#endif

@@ -8982,6 +8981,7 @@ void srt::CUDT::updateSrtRcvSettings()

8982 8981

enterCS(m_RecvLock);

8983 8982

#if ENABLE_NEW_RCVBUFFER

8984 8983

m_pRcvBuffer->setTsbPdMode(m_tsRcvPeerStartTime, false, milliseconds_from(m_iTsbPdDelay_ms));

8984 +

m_pRcvBuffer->setPeerRexmitFlag(m_bPeerRexmitFlag);

8985 8985

#else

8986 8986

m_pRcvBuffer->setRcvTsbPdMode(m_tsRcvPeerStartTime, milliseconds_from(m_iTsbPdDelay_ms));

8987 8987

#endif

Original file line number Diff line number Diff line change

@@ -489,6 +489,7 @@ class CUDT

489 489

SRT_ATR_NODISCARD SRT_ATTR_REQUIRES(m_ConnectionLock)

490 490

EConnectStatus processRendezvous(const CPacket* response, const sockaddr_any& serv_addr, EReadStatus, CPacket& reqpkt);

491 491 492 +

/// Create the CryptoControl object based on the HS packet. Allocates sender and receiver buffers and loss lists.

492 493

SRT_ATR_NODISCARD SRT_ATTR_REQUIRES(m_ConnectionLock)

493 494

bool prepareConnectionObjects(const CHandShake &hs, HandshakeSide hsd, CUDTException *eout);

494 495 Original file line number Diff line number Diff line change

@@ -34,7 +34,8 @@ class CRcvBufferReadMsg

34 34

#if ENABLE_NEW_RCVBUFFER

35 35

const bool enable_msg_api = m_use_message_api;

36 36

const bool enable_peer_rexmit = true;

37 -

m_rcv_buffer = unique_ptr<CRcvBufferNew>(new CRcvBufferNew(m_init_seqno, m_buff_size_pkts, m_unit_queue.get(), enable_peer_rexmit, enable_msg_api));

37 +

m_rcv_buffer = unique_ptr<CRcvBufferNew>(new CRcvBufferNew(m_init_seqno, m_buff_size_pkts, m_unit_queue.get(), enable_msg_api));

38 +

m_rcv_buffer->setPeerRexmitFlag(enable_peer_rexmit);

38 39

#else

39 40

m_rcv_buffer = unique_ptr<CRcvBuffer>(new CRcvBuffer(m_unit_queue.get(), m_buff_size_pkts));

40 41

#endif

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