Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/blocked-workflows/ubuntu-c++11-crypto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Linux

on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
types: [opened, synchronize, reopened]
jobs:
build:
strategy:
matrix:
crypto: [OFF, openssl, openssl-evp, gnutls, mbedtls, botan]

name: Build Crypto=${{ matrix.crypto }} C++11
runs-on: [ubuntu-latest, ubuntu-slim, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v3
- name: Configure packages and system
run: |
sudo apt install -y tcl cmake libssl-dev libgnutls28-dev libmbedtls-dev libbotan-2-dev gdb
echo "core.%e" | sudo tee /proc/sys/kernel/core_pattern
- name: Configure
run: |
mkdir _build && cd _build
if [[ ${{ matrix.crypto }} != OFF ]]; then CRYPTO_OPTIONS=-DUSE_ENCLIB=${{ matrix.crypto }}; else CRYPTO_OPTIONS=-DENABLE_ENCRYPTION=OFF; fi
cmake ../ -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DUSE_CXX_STD=11 -DENABLE_STDCXX_SYNC=ON $CRYPTO_OPTIONS -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_HEAVY_LOGGING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: cd _build && make -j -k
- name: test
run: |
ulimit -c unlimited
cd _build && ctest --extra-verbose
SUCCESS=$?
if [ -f core.test-srt ]; then gdb -batch ./test-srt -c core -ex bt -ex "info thread" -ex quit; else echo "NO CORE - NO CRY!"; fi;
test $SUCCESS == 0;

67 changes: 67 additions & 0 deletions .github/blocked-workflows/ubuntu-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Linux

on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
types: [opened, synchronize, reopened]
jobs:
build_options:
strategy:
matrix:
cxxstdsync: [OFF, ON]
logging: [OFF, ON]
bonding: [OFF, ON]
cxxstd: ["03", "11"]
exclude:
- cxxstd: "11"
logging: ON
bonding: ON
- cxxstd: "03"
cxxstdsync: ON
bonding: OFF
name: Build C++${{ matrix.cxxstd }} C++sync=${{ matrix.cxxstdsync }} Bonding=${{ matrix.bonding }} Logging=${{ matrix.logging }}
runs-on: [ubuntu-latest, ubuntu-slim, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v3
- name: Configure packages and system
run: |
sudo apt install -y tcl cmake libssl-dev libmbedtls-dev libbotan-2-dev gdb
echo "core.%e" | sudo tee /proc/sys/kernel/core_pattern
- name: Configure
run: |
mkdir _build && cd _build
# NOTE > Crypto options are default - enabled, openssl
cmake ../ -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DUSE_CXX_STD=${{ matrix.cxxstd }} -DENABLE_STDCXX_SYNC=${{ matrix.cxxstdsync }} -DENABLE_UNITTESTS=ON -DENABLE_BONDING=${{ matrix.bonding }} -DENABLE_LOGGING=${{ matrix.logging }} -DENABLE_HEAVY_LOGGING=${{ matrix.logging }} -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: cd _build && make -j -k
- name: test
run: |
ulimit -c unlimited
cd _build && ctest --extra-verbose
SUCCESS=$?
if [ -f core.test-srt ]; then gdb -batch ./test-srt -c core -ex bt -ex "info thread" -ex quit; else echo "NO CORE - NO CRY!"; fi;
test $SUCCESS == 0;

- name: codecov
run: |
source ./scripts/collect-gcov.sh
bash <(curl -s https://codecov.io/bash)

build_mingw:
name: Build Mingw32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: |
sudo apt install -y g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix
- name: Configure
run: |
mkdir _build && cd _build
export CC=x86_64-w64-mingw32-gcc-posix CXX=x86_64-w64-mingw32-g++-posix
# NOTE > Temporarily blocked encryption due to problems with enclib
cmake .. -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=OFF -DUSE_OPENSSL_PC=OFF -DCMAKE_SYSTEM_NAME=Windows
- name: Build
run: cd _build && make -j -k
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C++11
name: MacOS

on:
push:
Expand All @@ -15,7 +15,7 @@ concurrency:

jobs:
build:
name: macos
name: C++11 noenc
runs-on: macos-latest

steps:
Expand Down Expand Up @@ -43,13 +43,13 @@ jobs:
ccache --max-size=200M
ccache --zero-stats
- name: configure
# CERALIVE: noenc build-only smoke test -- crypto unit tests need a backend, so
# UNITTESTS is OFF here (as in the Ubuntu MinGW lane); full tests run enc-ON.
run: |
mkdir _build && cd _build
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DUSE_CXX_STD=17
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=OFF -DENABLE_BONDING=ON -DUSE_CXX_STD=17
- name: build
run: cd _build && cmake --build ./
- name: test
run: cd _build && ctest --extra-verbose
- name: Save ccache
if: ${{ success() && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C++03 (old compat)
name: Ubuntu C++03

on:
push:
Expand All @@ -8,7 +8,14 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: ubuntu
strategy:
matrix:
logging: [OFF, ON]
bonding: [OFF, ON]
exclude:
- bonding: OFF
logging: OFF
name: logging=${{ matrix.logging }} bonding=${{ matrix.bonding }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand All @@ -18,8 +25,8 @@ jobs:
uses: actions/cache/restore@v6
with:
path: ${{ runner.temp }}/ccache
key: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake_object_lib_support.c', 'apps/**', 'common/**', 'examples/**', 'haicrypt/**', 'scripts/**', 'srtcore/**', 'test/**', 'testing/**') }}
restore-keys: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-
key: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-log${{ matrix.logging }}-bond${{ matrix.bonding }}-${{ hashFiles('CMakeLists.txt', 'cmake_object_lib_support.c', 'apps/**', 'common/**', 'examples/**', 'haicrypt/**', 'scripts/**', 'srtcore/**', 'test/**', 'testing/**') }}
restore-keys: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-log${{ matrix.logging }}-bond${{ matrix.bonding }}-
- name: Set up ccache
run: |
sudo apt-get update
Expand All @@ -28,21 +35,27 @@ jobs:
ccache --zero-stats
- name: configure
run: |
sudo apt install -y tcl cmake libssl-dev gdb
mkdir _build && cd _build
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_STDCXX_SYNC=OFF -DUSE_CXX_STD=c++03 -DENABLE_ENCRYPTION=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_STDCXX_SYNC=OFF -DUSE_CXX_STD=03 -DENABLE_ENCRYPTION=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=${{ matrix.bonding }} -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_LOGGING=${{ matrix.logging }}
- name: build
# That below is likely SonarQube remains, which was removed earlier.
#run: cd _build && build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build .
run: cd _build && cmake --build .
- name: test
run: |
echo "core.%e" | sudo tee /proc/sys/kernel/core_pattern
ulimit -c unlimited
cd _build && ctest --extra-verbose
SUCCESS=$?
if [ -f core.test-srt ]; then gdb -batch ./test-srt -c core -ex bt -ex "info thread" -ex quit; else echo "NO CORE - NO CRY!"; fi;
test $SUCCESS == 0;
- name: Save ccache
if: ${{ success() && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
with:
path: ${{ runner.temp }}/ccache
key: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake_object_lib_support.c', 'apps/**', 'common/**', 'examples/**', 'haicrypt/**', 'scripts/**', 'srtcore/**', 'test/**', 'testing/**') }}
key: srt-ccache-cxx03-${{ runner.os }}-${{ runner.arch }}-log${{ matrix.logging }}-bond${{ matrix.bonding }}-${{ hashFiles('CMakeLists.txt', 'cmake_object_lib_support.c', 'apps/**', 'common/**', 'examples/**', 'haicrypt/**', 'scripts/**', 'srtcore/**', 'test/**', 'testing/**') }}
- name: Show ccache statistics
if: always()
run: ccache --show-stats
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C++11
name: Linux C++11

on:
push:
Expand All @@ -8,8 +8,14 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
# CERALIVE: upstream's ubuntu-24.04-arm entry is noenc + UNITTESTS=ON, which
# cannot build the crypto unit tests without a backend (red on upstream's own
# CI). Dropped; the device (arm64) is covered by the enc-ON runtime package build.
machine: [ubuntu-latest]
name: ON ${{ matrix.machine }}
runs-on: "${{ matrix.machine }}"
steps:
- uses: actions/checkout@v7
- name: Configure ccache environment
Expand All @@ -20,6 +26,12 @@ jobs:
path: ${{ runner.temp }}/ccache
key: srt-ccache-cxx11-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake_object_lib_support.c', 'apps/**', 'common/**', 'examples/**', 'haicrypt/**', 'scripts/**', 'srtcore/**', 'test/**', 'testing/**') }}
restore-keys: srt-ccache-cxx11-${{ runner.os }}-${{ runner.arch }}-
- name: prepare
run: |
RUNON=${{ matrix.machine }}
if [[ $RUNON == ubuntu-latest ]]; then
sudo apt install -y gdb
fi
- name: Set up ccache
run: |
sudo apt-get update
Expand All @@ -28,13 +40,21 @@ jobs:
ccache --zero-stats
- name: configure
run: |
RUNON=${{ matrix.machine }}
ENCRYPTION=ON
[[ $RUNON == ubuntu-24.04-arm ]] && ENCRYPTION=OFF
mkdir _build && cd _build
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DUSE_CXX_STD=11 -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=$ENCRYPTION -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: build
run: cd _build && cmake --build .
- name: test
run: |
echo "core.%e" | sudo tee /proc/sys/kernel/core_pattern
ulimit -c unlimited
cd _build && ctest --extra-verbose
SUCCESS=$?
if [ -f core.test-srt ]; then gdb -batch ./test-srt -c core -ex bt -ex "info thread" -ex quit; else echo "NO CORE - NO CRY!"; fi;
test $SUCCESS == 0;
- name: Save ccache
if: ${{ success() && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ubuntu-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ubuntu MinGW

on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
types: [opened, synchronize, reopened]
jobs:
build:
name: noenc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: |
sudo apt install -y g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix
- name: Configure
run: |
mkdir _build && cd _build
export CC=x86_64-w64-mingw32-gcc-posix CXX=x86_64-w64-mingw32-g++-posix
#cmake .. -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=OFF -DUSE_OPENSSL_PC=OFF -DCMAKE_SYSTEM_NAME=Windows -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
# Warn-on-error turned off because there's a warning about epoll about unimplemented system fd subscription system
cmake .. -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=OFF -DUSE_OPENSSL_PC=OFF -DCMAKE_SYSTEM_NAME=Windows -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: cd _build && make -j -k

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C++11
name: Windows

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
jobs:
build:

name: windows
name: C++11 noenc
runs-on: windows-latest

steps:
Expand All @@ -34,13 +34,13 @@ jobs:
with:
arch: x64
- name: configure
# CERALIVE: noenc build-only smoke test -- crypto unit tests need a backend, so
# UNITTESTS is OFF here (as in the Ubuntu MinGW lane); full tests run enc-ON.
run: |
md _build && cd _build
cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_LOCALIF_WIN32=ON -DUSE_CXX_STD=c++11
cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=OFF -DENABLE_BONDING=ON -DENABLE_LOCALIF_WIN32=ON -DUSE_CXX_STD=c++11
- name: build
run: cd _build && cmake --build ./ --config Release --verbose
- name: test
run: cd _build && ctest -E "TestIPv6.v6_calls_v4|TestConnectionTimeout.BlockingLoop" --extra-verbose -C Release
- name: Save ccache
if: ${{ success() && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ block the first content-keyed save.
| `runtime-package.yml` | Existing Docker-mounted ccache, normalized to the shared key/size/launcher contract |
| `publish-release.yml` | Host test build and Docker package build share the restored per-architecture cache |
| `abi.yml` | Separate current/base caches prevent concurrent writers while preserving stable restore prefixes |
| `cxx03-ubuntu.yaml`, `cxx11-ubuntu.yaml`, `cxx11-macos.yaml` | Native Makefile builds use the CMake launchers |
| `cxx11-win.yaml` | Uses Ninja with an explicit x64 MSVC developer environment because CMake compiler launchers are supported by Makefile/Ninja generators, not the Visual Studio generator |
| `ubuntu-c++03.yml`, `ubuntu-c++11.yml`, `macos.yml` | Native Makefile builds use the CMake launchers (renamed from `cxx03-ubuntu.yaml` / `cxx11-ubuntu.yaml` / `cxx11-macos.yaml` in the upstream v1.5.6 CI restructure; CeraLive ccache carried onto the renamed files) |
| `windows-msvc-noenc.yml` | Uses Ninja with an explicit x64 MSVC developer environment because CMake compiler launchers are supported by Makefile/Ninja generators, not the Visual Studio generator (renamed from `cxx11-win.yaml`) |
| `ubuntu-mingw.yml` | Upstream v1.5.6 addition (MinGW cross-build, `-DENABLE_UNITTESTS=OFF`); intentionally uncached — no CeraLive ccache precedent and it runs no unit tests |
| `android.yaml`, `iOS.yaml`, `s390x-focal.yaml` | Target/matrix-specific cross-build caches; container builds mount a host-restored cache path |

`codeql.yml` is intentionally uncached: its manual C/C++ build must execute and
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#

cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
set (SRT_VERSION 1.5.5)
set (SRT_VERSION 1.5.6)

set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
include(CheckSymbolExists)
Expand Down
2 changes: 1 addition & 1 deletion apps/apputil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace srt;
// See:
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms742214(v=vs.85).aspx
// http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedInternet3b.html
#if defined(_WIN32) && !defined(HAVE_INET_PTON)
#if defined(_WIN32) && !defined(HAVE_INET_PTON) && !defined(InetPton)
namespace // Prevent conflict in case when still defined
{
int inet_pton(int af, const char * src, void * dst)
Expand Down
10 changes: 7 additions & 3 deletions apps/socketoptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ struct SocketOption
bool applyt(Object socket, std::string value) const;

template <Domain D, typename Object>
static int setso(Object socket, int protocol, int symbol, const void* data, size_t size);
static int setso(Object , int , int , const void* , size_t )
{
typename Object::something something = Object::something;
return -1;
}

template<Type T>
bool extract(std::string value, OptionValue& val) const;
};

template<>
inline int SocketOption::setso<SocketOption::SRT, int>(int socket, int /*ignored*/, int sym, const void* data, size_t size)
inline int SocketOption::setso<SocketOption::SRT, SRTSOCKET>(SRTSOCKET socket, int /*ignored*/, int sym, const void* data, size_t size)
{
return srt_setsockopt(socket, 0, SRT_SOCKOPT(sym), data, (int) size);
}
Expand All @@ -80,7 +84,7 @@ inline int SocketOption::setso<SocketOption::SRT, SRT_SOCKOPT_CONFIG*>(SRT_SOCKO


template<>
inline int SocketOption::setso<SocketOption::SYSTEM, int>(int socket, int proto, int sym, const void* data, size_t size)
inline int SocketOption::setso<SocketOption::SYSTEM, SYSSOCKET>(SYSSOCKET socket, int proto, int sym, const void* data, size_t size)
{
return ::setsockopt(socket, proto, sym, (const char *)data, (int) size);
}
Expand Down
6 changes: 3 additions & 3 deletions apps/srt-live-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,12 @@ int main(int argc, char** argv)
}
if (!srcReady && sysrfdslen > 0)
{
int sock = src->GetSysSocket();
if (sock != -1)
SYSSOCKET sock = src->GetSysSocket();
if (sock != SYSSOCKET_INVALID)
{
for (int n = 0; n < sysrfdslen && !(srcReady = (sock == sysrfds[n])); n++);
}
}
}
}
// read a few chunks at a time in attempt to deplete
// read buffers as much as possible on each read event
Expand Down
Loading
Loading