Skip to content

Commit

Permalink
Minor fixes after self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Mar 4, 2021
1 parent 866eb44 commit d58013f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
6 changes: 3 additions & 3 deletions srtcore/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void CChannel::createSocket(int family)
if ((m_mcfg.iIpV6Only != -1) && (family == AF_INET6)) // (not an error if it fails)
{
int res ATR_UNUSED = ::setsockopt(m_iSocket, IPPROTO_IPV6, IPV6_V6ONLY,
(const char*) &m_mcfg.iIpV6Only, sizeof(int));
(const char*) &m_mcfg.iIpV6Only, sizeof m_mcfg.iIpV6Only);
if (res == -1)
{
int err = errno;
Expand Down Expand Up @@ -397,14 +397,14 @@ void CChannel::close() const

int CChannel::getSndBufSize()
{
socklen_t size = (socklen_t) sizeof m_mcfg.iUDPSndBufSize;
socklen_t size = (socklen_t) sizeof m_mcfg.iUDPSndBufSize;
::getsockopt(m_iSocket, SOL_SOCKET, SO_SNDBUF, (char*) &m_mcfg.iUDPSndBufSize, &size);
return m_mcfg.iUDPSndBufSize;
}

int CChannel::getRcvBufSize()
{
socklen_t size = (socklen_t) sizeof m_mcfg.iUDPRcvBufSize;
socklen_t size = (socklen_t) sizeof m_mcfg.iUDPRcvBufSize;
::getsockopt(m_iSocket, SOL_SOCKET, SO_RCVBUF, (char*) &m_mcfg.iUDPRcvBufSize, &size);
return m_mcfg.iUDPRcvBufSize;
}
Expand Down
25 changes: 11 additions & 14 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,15 @@ void CUDT::construct()
m_RejectReason = SRT_REJ_UNKNOWN;
m_tsLastReqTime = steady_clock::time_point();
m_SrtHsSide = HSD_DRAW;

m_uPeerSrtVersion = 0; // not defined until connected.

m_iTsbPdDelay_ms = 0;
m_iPeerTsbPdDelay_ms = 0;

m_bPeerTsbPd = false;
m_iPeerTsbPdDelay_ms = 0;
m_bTsbPd = false;
m_bTsbPdAckWakeup = false;
m_bGroupTsbPd = false;
m_bPeerTLPktDrop = false;
m_uPeerSrtVersion = 0; // not defined until connected.
m_iTsbPdDelay_ms = 0;
m_iPeerTsbPdDelay_ms = 0;
m_bPeerTsbPd = false;
m_iPeerTsbPdDelay_ms = 0;
m_bTsbPd = false;
m_bTsbPdAckWakeup = false;
m_bGroupTsbPd = false;
m_bPeerTLPktDrop = false;

// Initilize mutex and condition variables
initSynch();
Expand Down Expand Up @@ -4328,9 +4325,9 @@ bool CUDT::applyResponseSettings() ATR_NOEXCEPT
}

// Re-configure according to the negotiated values.
m_config.iMSS = m_ConnRes.m_iMSS;
m_config.iMSS = m_ConnRes.m_iMSS;
m_iFlowWindowSize = m_ConnRes.m_iFlightFlagSize;
int udpsize = m_config.iMSS - CPacket::UDP_HDR_SIZE;
const int udpsize = m_config.iMSS - CPacket::UDP_HDR_SIZE;
m_iMaxSRTPayloadSize = udpsize - CPacket::HDR_SIZE;
m_iPeerISN = m_ConnRes.m_iISN;

Expand Down
1 change: 1 addition & 0 deletions srtcore/filelist.maf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ PROTECTED HEADERS
platform_sys.h
udt.h

PRIVATE HEADERS
api.h
buffer.h
cache.h
Expand Down
2 changes: 1 addition & 1 deletion srtcore/socketconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ struct CSrtConfig: CSrtMuxerConfig
bool bTLPktDrop; // Whether Agent WILL DO TLPKTDROP on Rx.
int iSndDropDelay; // Extra delay when deciding to snd-drop for TLPKTDROP, -1 to off
bool bEnforcedEnc; // Off by default. When on, any connection other than nopw-nopw & pw1-pw1 is rejected.
int iGroupConnect; // 1 - allow group connections
int iGroupConnect; // 1 - allow group connections
int iPeerIdleTimeout; // Timeout for hearing anything from the peer.
uint32_t uStabilityTimeout;
int iRetransmitAlgo;
Expand Down

0 comments on commit d58013f

Please sign in to comment.