Skip to content

Commit

Permalink
[API] Drop EXPERIMENTAL from ENABLE_EXPERIMENTAL_BONDING
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed May 4, 2022
1 parent 7b2311f commit 78b4d65
Show file tree
Hide file tree
Showing 26 changed files with 153 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cxx11-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_EXPERIMENTAL_BONDING=ON
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON
- name: build
run: cd _build && cmake --build ./
- name: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cxx11-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_UNITTESTS=ON -DENABLE_EXPERIMENTAL_BONDING=ON
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON
- name: build
run: cd _build && cmake --build ./
- name: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cxx11-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: configure
run: |
md _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_EXPERIMENTAL_BONDING=ON
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON
- name: build
run: cd _build && cmake --build ./ --config Release
- name: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_ENCRYPTION=OFF -DENABLE_STDCXX_SYNC=${{matrix.cxxstdsync}} -DENABLE_UNITTESTS=OFF -DENABLE_EXPERIMENTAL_BONDING=ON --toolchain scripts/iOS.cmake
cmake ../ -DENABLE_ENCRYPTION=OFF -DENABLE_STDCXX_SYNC=${{matrix.cxxstdsync}} -DENABLE_UNITTESTS=OFF -DENABLE_BONDING=ON --toolchain scripts/iOS.cmake
- name: build
run: cd _build && cmake --build ./
2 changes: 1 addition & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ extraction:
cpp:
configure:
command:
- cmake . -DENABLE_HEAVY_LOGGING=1 -DENABLE_EXPERIMENTAL_BONDING=1
- cmake . -DENABLE_HEAVY_LOGGING=1 -DENABLE_BONDING=1
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ matrix:
- os: linux
env:
- BUILD_TYPE=Debug
- BUILD_OPTS='-DENABLE_CODE_COVERAGE=ON -DENABLE_EXPERIMENTAL_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- BUILD_OPTS='-DENABLE_CODE_COVERAGE=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- RUN_SONARCUBE=1
- RUN_CODECOV=1
- env:
- BUILD_TYPE=Debug
- BUILD_OPTS='-DENABLE_LOGGING=OFF -DENABLE_MONOTONIC_CLOCK=ON -DENABLE_EXPERIMENTAL_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- BUILD_OPTS='-DENABLE_LOGGING=OFF -DENABLE_MONOTONIC_CLOCK=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- os: linux
env: BUILD_TYPE=Release
- os: osx
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ else()
option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" ON)
endif()
option(ENABLE_APPS "Should the Support Applications be Built?" ON)
option(ENABLE_EXPERIMENTAL_BONDING "Should the EXPERIMENTAL bonding functionality be enabled?" OFF)
option(ENABLE_BONDING "Should the bonding functionality be enabled?" OFF)
option(ENABLE_TESTING "Should the Developer Test Applications be Built?" OFF)
option(ENABLE_PROFILE "Should instrument the code for profiling. Ignored for non-GNU compiler." $ENV{HAI_BUILD_PROFILE})
option(ENABLE_LOGGING "Should logging be enabled" ON)
Expand Down Expand Up @@ -674,8 +674,13 @@ if (ENABLE_GETNAMEINFO)
list(APPEND SRT_EXTRA_CFLAGS "-DENABLE_GETNAMEINFO=1")
endif()

# ENABLE_EXPERIMENTAL_BONDING is deprecated. Use ENABLE_BONDING. ENABLE_EXPERIMENTAL_BONDING is be removed in v1.6.0.
if (ENABLE_EXPERIMENTAL_BONDING)
list(APPEND SRT_EXTRA_CFLAGS "-DENABLE_EXPERIMENTAL_BONDING=1")
message(DEPRECATION "ENABLE_EXPERIMENTAL_BONDING is deprecated. Please use ENABLE_BONDING instead.")
endif()

if (ENABLE_BONDING OR ENABLE_EXPERIMENTAL_BONDING)
list(APPEND SRT_EXTRA_CFLAGS "-DENABLE_BONDING=1")
endif()

if (ENABLE_THREAD_CHECK)
Expand Down Expand Up @@ -1222,7 +1227,7 @@ if (ENABLE_APPS)
srt_add_testprogram(srt-test-multiplex)
srt_make_application(srt-test-multiplex)

if (ENABLE_EXPERIMENTAL_BONDING)
if (ENABLE_BONDING)
srt_add_testprogram(srt-test-mpbond)
srt_make_application(srt-test-mpbond)
endif()
Expand Down Expand Up @@ -1257,7 +1262,7 @@ if (ENABLE_EXAMPLES)

srt_add_example(test-c-server.c)

if (ENABLE_EXPERIMENTAL_BONDING)
if (ENABLE_BONDING)
srt_add_example(test-c-client-bonding.c)

srt_add_example(test-c-server-bonding.c)
Expand Down
4 changes: 2 additions & 2 deletions apps/socketoptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ inline int SocketOption::setso<SocketOption::SRT, int>(int socket, int /*ignored
return srt_setsockopt(socket, 0, SRT_SOCKOPT(sym), data, (int) size);
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
template<>
inline int SocketOption::setso<SocketOption::SRT, SRT_SOCKOPT_CONFIG*>(SRT_SOCKOPT_CONFIG* obj, int /*ignored*/, int sym, const void* data, size_t size)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ const SocketOption srt_options [] {
{ "ipv6only", 0, SRTO_IPV6ONLY, SocketOption::PRE, SocketOption::INT, nullptr },
{ "peeridletimeo", 0, SRTO_PEERIDLETIMEO, SocketOption::PRE, SocketOption::INT, nullptr },
{ "packetfilter", 0, SRTO_PACKETFILTER, SocketOption::PRE, SocketOption::STRING, nullptr },
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
{ "groupconnect", 0, SRTO_GROUPCONNECT, SocketOption::PRE, SocketOption::INT, nullptr},
{ "groupminstabletimeo", 0, SRTO_GROUPMINSTABLETIMEO, SocketOption::PRE, SocketOption::INT, nullptr},
#endif
Expand Down
2 changes: 1 addition & 1 deletion scripts/ShowProjectConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function(ShowProjectConfig)
" ENABLE_CXX11: ${ENABLE_CXX11}\n"
" ENABLE_APPS: ${ENABLE_APPS}\n"
" ENABLE_EXAMPLES: ${ENABLE_EXAMPLES}\n"
" ENABLE_EXPERIMENTAL_BONDING: ${ENABLE_EXPERIMENTAL_BONDING}\n"
" ENABLE_BONDING: ${ENABLE_BONDING}\n"
" ENABLE_TESTING: ${ENABLE_TESTING}\n"
" ENABLE_PROFILE: ${ENABLE_PROFILE}\n"
" ENABLE_LOGGING: ${ENABLE_LOGGING}\n"
Expand Down
58 changes: 29 additions & 29 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ using namespace srt::sync;

void srt::CUDTSocket::construct()
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
m_GroupOf = NULL;
m_GroupMemberData = NULL;
#endif
Expand Down Expand Up @@ -356,7 +356,7 @@ SRTSOCKET srt::CUDTUnited::generateSocketID(bool for_group)
{
enterCS(m_GlobControlLock);
const bool exists =
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
for_group
? m_Groups.count(sockval | SRTGROUP_MASK)
:
Expand Down Expand Up @@ -658,7 +658,7 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,
// could be requested deletion in the meantime. This will hold any possible
// removal from group and resetting m_GroupOf field.

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (ns->m_GroupOf)
{
// XXX this might require another check of group type.
Expand Down Expand Up @@ -814,7 +814,7 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,
{
ScopedLock cg(m_GlobControlLock);

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (ns->m_GroupOf)
{
HLOGC(smlog.Debug,
Expand Down Expand Up @@ -864,7 +864,7 @@ int srt::CUDTUnited::installConnectHook(const SRTSOCKET u, srt_connect_callback_
{
try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
GroupKeeper k(*this, u, ERH_THROW);
Expand Down Expand Up @@ -1133,7 +1133,7 @@ SRTSOCKET srt::CUDTUnited::accept(const SRTSOCKET listen, sockaddr* pw_addr, int
// Check if LISTENER has the SRTO_GROUPCONNECT flag set,
// and the already accepted socket has successfully joined
// the mirror group. If so, RETURN THE GROUP ID, not the socket ID.
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (ls->core().m_config.iGroupConnect == 1 && s->m_GroupOf)
{
// Put a lock to protect the group against accidental deletion
Expand Down Expand Up @@ -1192,7 +1192,7 @@ int srt::CUDTUnited::connect(SRTSOCKET u, const sockaddr* srcname, const sockadd
if (target_addr.len == 0)
throw CUDTException(MJ_NOTSUP, MN_INVAL, 0);

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
// Check affiliation of the socket. It's now allowed for it to be
// a group or socket. For a group, add automatically a socket to
// the group.
Expand Down Expand Up @@ -1226,7 +1226,7 @@ int srt::CUDTUnited::connect(const SRTSOCKET u, const sockaddr* name, int namele
if (target_addr.len == 0)
throw CUDTException(MJ_NOTSUP, MN_INVAL, 0);

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
// Check affiliation of the socket. It's now allowed for it to be
// a group or socket. For a group, add automatically a socket to
// the group.
Expand All @@ -1250,7 +1250,7 @@ int srt::CUDTUnited::connect(const SRTSOCKET u, const sockaddr* name, int namele
return connectIn(s, target_addr, forced_isn);
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
int srt::CUDTUnited::singleMemberConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* gd)
{
int gstat = groupConnect(pg, gd, 1);
Expand Down Expand Up @@ -1878,7 +1878,7 @@ int srt::CUDTUnited::connectIn(CUDTSocket* s, const sockaddr_any& target_addr, i

int srt::CUDTUnited::close(const SRTSOCKET u)
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
GroupKeeper k(*this, u, ERH_THROW);
Expand All @@ -1894,7 +1894,7 @@ int srt::CUDTUnited::close(const SRTSOCKET u)
return close(s);
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
void srt::CUDTUnited::deleteGroup(CUDTGroup* g)
{
using srt_logging::gmlog;
Expand Down Expand Up @@ -2008,7 +2008,7 @@ int srt::CUDTUnited::close(CUDTSocket* s)
s = i->second;
s->setClosed();

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (s->m_GroupOf)
{
HLOGC(smlog.Debug,
Expand Down Expand Up @@ -2334,7 +2334,7 @@ int srt::CUDTUnited::epoll_clear_usocks(int eid)
int srt::CUDTUnited::epoll_add_usock(const int eid, const SRTSOCKET u, const int* events)
{
int ret = -1;
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
GroupKeeper k(*this, u, ERH_THROW);
Expand Down Expand Up @@ -2405,7 +2405,7 @@ int srt::CUDTUnited::epoll_remove_socket_INTERNAL(const int eid, CUDTSocket* s)
return epoll_remove_entity(eid, &s->core());
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
int srt::CUDTUnited::epoll_remove_group_INTERNAL(const int eid, CUDTGroup* g)
{
return epoll_remove_entity(eid, g);
Expand All @@ -2416,7 +2416,7 @@ int srt::CUDTUnited::epoll_remove_usock(const int eid, const SRTSOCKET u)
{
CUDTSocket* s = 0;

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
CUDTGroup* g = 0;
if (u & SRTGROUP_MASK)
{
Expand Down Expand Up @@ -2485,7 +2485,7 @@ srt::CUDTSocket* srt::CUDTUnited::locateSocket_LOCKED(SRTSOCKET u)
return i->second;
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
srt::CUDTGroup* srt::CUDTUnited::locateAcquireGroup(SRTSOCKET u, ErrorHandling erh)
{
ScopedLock cg(m_GlobControlLock);
Expand Down Expand Up @@ -2545,7 +2545,7 @@ void srt::CUDTUnited::checkBrokenSockets()
{
ScopedLock cg(m_GlobControlLock);

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
vector<SRTSOCKET> delgids;

for (groups_t::iterator i = m_ClosedGroups.begin(); i != m_ClosedGroups.end(); ++i)
Expand Down Expand Up @@ -2610,7 +2610,7 @@ void srt::CUDTUnited::checkBrokenSockets()
}
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (s->m_GroupOf)
{
LOGC(smlog.Note,
Expand Down Expand Up @@ -2707,7 +2707,7 @@ void srt::CUDTUnited::removeSocket(const SRTSOCKET u)
if (rn && rn->m_bOnList)
return;

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (s->m_GroupOf)
{
HLOGC(smlog.Debug,
Expand Down Expand Up @@ -3117,7 +3117,7 @@ void* srt::CUDTUnited::garbageCollect(void* p)
CUDTSocket* s = i->second;
s->breakSocket_LOCKED();

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (s->m_GroupOf)
{
HLOGC(smlog.Debug,
Expand Down Expand Up @@ -3217,7 +3217,7 @@ srt::CUDT::APIError::APIError(CodeMajor mj, CodeMinor mn, int syserr)
SetThreadLocalError(CUDTException(mj, mn, syserr));
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
// This is an internal function; 'type' should be pre-checked if it has a correct value.
// This doesn't have argument of GroupType due to header file conflicts.

Expand Down Expand Up @@ -3485,7 +3485,7 @@ int srt::CUDT::connect(SRTSOCKET u, const sockaddr* name, const sockaddr* tname,
}
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
int srt::CUDT::connectLinks(SRTSOCKET grp, SRT_SOCKGROUPCONFIG targets[], int arraysize)
{
if (arraysize <= 0)
Expand Down Expand Up @@ -3601,7 +3601,7 @@ int srt::CUDT::getsockopt(SRTSOCKET u, int, SRT_SOCKOPT optname, void* pw_optval

try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
CUDTUnited::GroupKeeper k(uglobal(), u, CUDTUnited::ERH_THROW);
Expand Down Expand Up @@ -3632,7 +3632,7 @@ int srt::CUDT::setsockopt(SRTSOCKET u, int, SRT_SOCKOPT optname, const void* opt

try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
CUDTUnited::GroupKeeper k(uglobal(), u, CUDTUnited::ERH_THROW);
Expand Down Expand Up @@ -3677,7 +3677,7 @@ int srt::CUDT::sendmsg2(SRTSOCKET u, const char* buf, int len, SRT_MSGCTRL& w_m)
{
try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
CUDTUnited::GroupKeeper k(uglobal(), u, CUDTUnited::ERH_THROW);
Expand Down Expand Up @@ -3721,7 +3721,7 @@ int srt::CUDT::recvmsg2(SRTSOCKET u, char* buf, int len, SRT_MSGCTRL& w_m)
{
try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
{
CUDTUnited::GroupKeeper k(uglobal(), u, CUDTUnited::ERH_THROW);
Expand Down Expand Up @@ -4058,7 +4058,7 @@ srt::CUDTException& srt::CUDT::getlasterror()

int srt::CUDT::bstats(SRTSOCKET u, CBytePerfMon* perf, bool clear, bool instantaneous)
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (u & SRTGROUP_MASK)
return groupsockbstats(u, perf, clear);
#endif
Expand All @@ -4080,7 +4080,7 @@ int srt::CUDT::bstats(SRTSOCKET u, CBytePerfMon* perf, bool clear, bool instanta
}
}

#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
int srt::CUDT::groupsockbstats(SRTSOCKET u, CBytePerfMon* perf, bool clear)
{
try
Expand Down Expand Up @@ -4136,7 +4136,7 @@ SRT_SOCKSTATUS srt::CUDT::getsockstate(SRTSOCKET u)
{
try
{
#if ENABLE_EXPERIMENTAL_BONDING
#if ENABLE_BONDING
if (isgroup(u))
{
CUDTUnited::GroupKeeper k(uglobal(), u, CUDTUnited::ERH_THROW);
Expand Down
Loading

0 comments on commit 78b4d65

Please sign in to comment.