mirror of
https://github.com/Haivision/srt.git
synced 2026-07-04 15:07:49 +00:00
[docs] fix bunch of typos and enable codespell via github workflow. (#3263)
* fix bunch of typos and enable codespell via github workflow. Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> * address review comments. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Replace instability by unstability and insecure by unsecure. * Rollback instability! * Moving the configuration files to scripts/codespell. * Replace connenctions by connections. --------- Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
name: codespell
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
spellcheck:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install dependencies with pip
|
||||
run: pip install --no-warn-script-location --user codespell
|
||||
|
||||
- name: Spellcheck
|
||||
run: codespell --config scripts/codespell/codespell.cfg
|
||||
+3
-3
@@ -200,7 +200,7 @@ Please use SRT_USE_OPENSSL_STATIC_LIBS instead.")
|
||||
endif()
|
||||
|
||||
# NOTE: Use ATOMIC_USE_SRT_SYNC_MUTEX and will override the auto-detection of the
|
||||
# Atomic implemetation in srtcore/atomic.h.
|
||||
# Atomic implementation in srtcore/atomic.h.
|
||||
option(ATOMIC_USE_SRT_SYNC_MUTEX "Use srt::sync::Mutex to Implement Atomics" OFF)
|
||||
if (ATOMIC_USE_SRT_SYNC_MUTEX)
|
||||
add_definitions(-DATOMIC_USE_SRT_SYNC_MUTEX=1)
|
||||
@@ -264,7 +264,7 @@ endif()
|
||||
set(USE_ENCLIB "${USE_ENCLIB}" CACHE STRING "The crypto library that SRT uses")
|
||||
set_property(CACHE USE_ENCLIB PROPERTY STRINGS "openssl" "openssl-evp" "gnutls" "mbedtls" "botan")
|
||||
|
||||
# Make sure DLLs and executabes go to the same path regardles of subdirectory
|
||||
# Make sure DLLs and executables go to the same path regardless of subdirectory
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
@@ -1384,7 +1384,7 @@ macro(srt_make_application name)
|
||||
|
||||
if (LINUX AND ENABLE_RELATIVE_LIBPATH AND NOT srt_libspec_static)
|
||||
# This is only needed on Linux, on Windows (including Cygwin) the library file will
|
||||
# be placed into the binrary directory anyway.
|
||||
# be placed into the binary directory anyway.
|
||||
# XXX not sure about Mac.
|
||||
# See this name used already in install(${TARGET_srt} LIBRARY DESTINATION...).
|
||||
set(FORCE_RPATH LINK_FLAGS -Wl,-rpath,.,-rpath,../${CMAKE_INSTALL_LIBDIR} BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
@@ -157,7 +157,7 @@ In live streaming configurations, the SRT protocol maintains a constant end-to-e
|
||||
|
||||
- [Why SRT?](./docs/misc/why-srt-was-created.md) - A brief history and rationale for SRT by Marc Cymontkowski.
|
||||
- [RTMP vs. SRT: Comparing Latency and Maximum Bandwidth](https://www.haivision.com/resources/white-paper/srt-versus-rtmp/) White Paper.
|
||||
- [Documentation on GitHub](./docs#documentation-overview) with SRT API documents, features decsriptions, etc.
|
||||
- [Documentation on GitHub](./docs#documentation-overview) with SRT API documents, features descriptions, etc.
|
||||
- The SRT Protocol Internet Draft: [Datatracker](https://datatracker.ietf.org/doc/draft-sharabayko-srt/) | [Latest Version](https://datatracker.ietf.org/doc/html/draft-sharabayko-srt-01) | [Latest Working Copy](https://haivision.github.io/srt-rfc/draft-sharabayko-srt.html) | [GitHub Repo](https://github.com/Haivision/srt-rfc)
|
||||
- If you are curious about live streaming using SRT with QUIC datagrams as an alternative to UDP transport, take a look at the following [blog post](https://medium.com/innovation-labs-blog/live-streaming-using-srt-with-quic-datagrams-7896f7ce7bf3?source=friends_link&sk=d0a00e79861d89673e27a04260f279b5) on Medium.
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ void TestLogHandler(void* opaque, int level, const char* file, int line, const c
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// That's something weird that happens on Microsoft Visual Studio 2013
|
||||
// Trying to keep portability, while every version of MSVS is a different plaform.
|
||||
// Trying to keep portability, while every version of MSVS is a different platform.
|
||||
// On MSVS 2015 there's already a standard-compliant snprintf, whereas _snprintf
|
||||
// is available on backward compatibility and it doesn't work exactly the same way.
|
||||
#define snprintf _snprintf
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ void Engine::Worker()
|
||||
throw Medium::ReadEOF("");
|
||||
|
||||
case Medium::RD_AGAIN:
|
||||
// Theoreticall RD_AGAIN should not be reported
|
||||
// Theoretically RD_AGAIN should not be reported
|
||||
// because it should be taken care of internally by
|
||||
// repeated sending - unless we get m_broken set.
|
||||
// If it is, however, it should be handled just like error.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
/* This file intended to serve as a drop-in replacement for
|
||||
* unistd.h on Windows
|
||||
* Please add functionality as neeeded
|
||||
* Please add functionality as needed
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1651,7 +1651,7 @@ will be able to retrieve this stream ID from the socket that is returned from
|
||||
`srt_accept` (for a connected socket with that stream ID). You usually use SET
|
||||
on the socket used for `srt_connect`, and GET on the socket retrieved from
|
||||
`srt_accept`. This string can be used completely free-form. However, it's highly
|
||||
recommended to follow the [SRT Access Control (Stream ID) Guidlines](../features/access-control.md).
|
||||
recommended to follow the [SRT Access Control (Stream ID) Guidelines](../features/access-control.md).
|
||||
|
||||
- As this uses internally the `std::string` type, there are additional functions
|
||||
for it in the legacy/C++ API (udt.h): `srt::setstreamid` and `srt::getstreamid`.
|
||||
|
||||
@@ -182,7 +182,7 @@ If the packet `s` is received out of order (`s < next_exp`), the statistic is no
|
||||
|
||||
Note that only original (not retransmitted) SRT DATA packets are taken into account. Refer to [pktRcvRetransTotal](#pktRcvRetransTotal) for the formula for obtaining the total number of lost retransmitted packets.
|
||||
|
||||
In SRT v1.4.0, v1.4.1, the `pktRcvLossTotal` statistic includes packets that failed to be decrypted. To receive the number of presently missing packets, substract [pktRcvUndecryptTotal](#pktRcvUndecryptTotal) from the current one. This is going to be fixed in SRT v.1.5.0.
|
||||
In SRT v1.4.0, v1.4.1, the `pktRcvLossTotal` statistic includes packets that failed to be decrypted. To receive the number of presently missing packets, subtract [pktRcvUndecryptTotal](#pktRcvUndecryptTotal) from the current one. This is going to be fixed in SRT v.1.5.0.
|
||||
|
||||
#### pktRetransTotal
|
||||
|
||||
@@ -245,7 +245,7 @@ Packets may be dropped conditionally when both `SRTO_TSBPDMODE` and `SRTO_TLPKTD
|
||||
#### pktRcvUndecryptTotal
|
||||
|
||||
The total number of packets that failed to be decrypted at the receiver side. Available for receiver.
|
||||
The statistic also counts unencrypted packets that were expected to be uncrypted on a secured connection (see [SRTO_KM_S_SECURED](API-socket-options.md#srt_km_state))
|
||||
The statistic also counts unencrypted packets that were expected to be unencrypted on a secured connection (see [SRTO_KM_S_SECURED](API-socket-options.md#srt_km_state))
|
||||
and hence dropped as not encrypted (undecrypted).
|
||||
|
||||
#### pktSndFilterExtraTotal
|
||||
@@ -657,7 +657,7 @@ Instantaneous (current) value of `pktRcvBuf`, expressed in bytes, including payl
|
||||
|
||||
The timespan (msec) of acknowledged packets in the receiver's buffer. Receiver side.
|
||||
|
||||
If TSBPD mode is enabled (defualt for **live mode**),
|
||||
If TSBPD mode is enabled (default for **live mode**),
|
||||
a packet can be acknowledged, but not yet ready to play.
|
||||
This range includes all packets regardless of whether
|
||||
they are ready to play or not.
|
||||
|
||||
@@ -40,7 +40,7 @@ If you use sender in listener mode, then you start it with specifying either the
|
||||
full filename path, or only the directory where the file is located; in the latter
|
||||
case the filename will be tried from the `streamid` option extracted from the
|
||||
connected socket (as set by the other side's caller). If the full filename was
|
||||
specified, it must match the rootname extraced from this option, or otherwise
|
||||
specified, it must match the rootname extracted from this option, or otherwise
|
||||
transmission will not be done.
|
||||
|
||||
If you use receiver in listener mode, then you start it with specifying either
|
||||
|
||||
Vendored
+29
-28
@@ -2,33 +2,34 @@
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
- [1. Prerequisites](#1-prerequisites)
|
||||
- [1.1. Build Tool Dependencies](#11-build-tool-dependencies)
|
||||
- [1.2. External Library Dependencies](#12-external-library-dependencies)
|
||||
- [1.2.1. Cryptographic Library](#121-cryptographic-library)
|
||||
- [1.2.2. Threading Library](#122-threading-library)
|
||||
- [1.3. Package Managers](#13-package-managers)
|
||||
- [1.3.1. VCpkg Packet Manager (optional)](#131-vcpkg-packet-manager-optional)
|
||||
- [1.3.2. NuGet Manager (optional)](#132-nuget-manager-optional)
|
||||
- [2. Preparing Dependencies](#2-preparing-dependencies)
|
||||
- [2.1. Cryptographic Library](#21-cryptographic-library)
|
||||
- [2.1.1. Install OpenSSL](#211-install-openssl)
|
||||
- [2.1.1.1. Using vcpkg](#2111-using-vcpkg)
|
||||
- [2.1.1.2. Using Installer](#2112-using-installer-windows)
|
||||
- [2.1.1.3. Build from Sources](#2113-build-from-sources)
|
||||
- [2.1.2. Install MbedTLS](#212-install-mbedtls)
|
||||
- [2.1.3. Install LibreSSL](#213-install-libressl)
|
||||
- [2.2. Threading Library](#22-threading-library)
|
||||
- [2.2.1. Using C++11 Threading](#221-using-c11-threading)
|
||||
- [2.2.2. Building PThreads](#222-building-pthreads)
|
||||
- [2.2.2.1. Using vcpkg](#2221-using-vcpkg)
|
||||
- [2.2.2.2. Using NuGet](#2222-using-nuget)
|
||||
- [2.2.2.3. Build pthreads4w from Sources](#2223-build-pthreads4w-from-sources)
|
||||
- [2.2.2.4. Build pthread-win32 from Sources](#2224-build-pthread-win32-from-sources)
|
||||
- [3. Building SRT](#3-building-srt)
|
||||
- [3.1. Cloning the Source Code](#31-cloning-the-source-code)
|
||||
- [3.2. Generate Build Files](#32-generate-build-files)
|
||||
- [3.3. Build SRT](#33-build-srt)
|
||||
- [Building SRT on Windows](#building-srt-on-windows)
|
||||
- [1. Prerequisites](#1-prerequisites)
|
||||
- [1.1. Build Tool Dependencies](#11-build-tool-dependencies)
|
||||
- [1.2. External Library Dependencies](#12-external-library-dependencies)
|
||||
- [1.2.1. Cryptographic Library](#121-cryptographic-library)
|
||||
- [1.2.2. Threading Library](#122-threading-library)
|
||||
- [1.3. Package Managers](#13-package-managers)
|
||||
- [1.3.1. VCpkg Packet Manager (optional)](#131-vcpkg-packet-manager-optional)
|
||||
- [1.3.2. NuGet Manager (optional)](#132-nuget-manager-optional)
|
||||
- [2. Preparing Dependencies](#2-preparing-dependencies)
|
||||
- [2.1 Cryptographic Library](#21-cryptographic-library)
|
||||
- [2.1.1. Install OpenSSL](#211-install-openssl)
|
||||
- [2.1.1.1. Using vcpkg](#2111-using-vcpkg)
|
||||
- [2.1.1.2. Using Installer (Windows)](#2112-using-installer-windows)
|
||||
- [2.1.1.3. Build from Sources](#2113-build-from-sources)
|
||||
- [2.1.2. Install MbedTLS](#212-install-mbedtls)
|
||||
- [2.1.3. Install LibreSSL](#213-install-libressl)
|
||||
- [2.2. Threading Library](#22-threading-library)
|
||||
- [2.2.1. Using C++11 Threading](#221-using-c11-threading)
|
||||
- [2.2.2. Building PThreads](#222-building-pthreads)
|
||||
- [2.2.2.1. Using vcpkg](#2221-using-vcpkg)
|
||||
- [2.2.2.2. Using NuGet](#2222-using-nuget)
|
||||
- [2.2.2.3. Build pthreads4w from Sources](#2223-build-pthreads4w-from-sources)
|
||||
- [2.2.2.4. Build pthread-win32 from Sources](#2224-build-pthread-win32-from-sources)
|
||||
- [3. Building SRT](#3-building-srt)
|
||||
- [3.1. Cloning the Source Code](#31-cloning-the-source-code)
|
||||
- [3.2. Generate Build Files](#32-generate-build-files)
|
||||
- [3.3. Build SRT](#33-build-srt)
|
||||
|
||||
<!-- /TOC -->
|
||||
|
||||
@@ -296,7 +297,7 @@ In case vcpkg was used to build pthreads or OpenSSL, provide:
|
||||
|
||||
- `-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\\scripts\\buildsystems\\vcpkg.cmake`
|
||||
|
||||
In case NuGet was used to get pre-built pthreads libray, provide:
|
||||
In case NuGet was used to get pre-built pthreads library, provide:
|
||||
|
||||
- `-DPTHREAD_INCLUDE_DIR`
|
||||
- `-DPTHREAD_LIBRARY`
|
||||
|
||||
@@ -82,9 +82,9 @@ password.
|
||||
- `r`: **Resource Name** identifies the name of the resource and facilitates
|
||||
selection should the listener party be able to serve multiple resources.
|
||||
- `h`: **Host Name** identifies the hostname of the resource. For example,
|
||||
to request a stream with the URI `somehost.com/videos/querry.php?vid=366` the
|
||||
to request a stream with the URI `somehost.com/videos/query.php?vid=366` the
|
||||
`hostname` field should have `somehost.com`, and the resource name can have
|
||||
`videos/querry.php?vid=366` or simply `366`. Note that this is still a key to be
|
||||
`videos/query.php?vid=366` or simply `366`. Note that this is still a key to be
|
||||
specified explicitly. Support tools that apply simplifications and URI extraction
|
||||
are expected to insert only the host portion of the URI here.
|
||||
- `s`: **Session ID** is a temporary resource identifier negotiated with
|
||||
|
||||
@@ -26,7 +26,7 @@ Transmission happens over the main link until it is considered broken or is pres
|
||||
|
||||
### Sensitivity Levels
|
||||
|
||||
The only sensitivity level implemented at the moment is a **pre-emptive switch** to a backup path from an unstable main path before it breaks. The goal is to predict an upcoming link breakage before it happens, and to be ready to switch to an activated backup link while losing as few packets as possible.
|
||||
The only sensitivity level implemented at the moment is a **preemptive switch** to a backup path from an unstable main path before it breaks. The goal is to predict an upcoming link breakage before it happens, and to be ready to switch to an activated backup link while losing as few packets as possible.
|
||||
|
||||
An additional sensitivity level (**handover switch**) may be added in the future for cases where low latency and packet loss is not critical. The switch would take place once the link is actually broken, without trying to predict it thereby reducing processing overhead. Since the main path in this case is already broken, there would be a delay associated with activating the backup path resulting in a discontinuity in streaming (data loss during the switch).
|
||||
|
||||
|
||||
+28
-27
@@ -7,31 +7,32 @@ Last updated: 2018-06-28
|
||||
|
||||
**Contents**
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Short Introduction to SRT Packet Structure](#short-introduction-to-srt-packet-structure)
|
||||
- [Handshake Structure](#handshake-structure)
|
||||
- [The "UDT Legacy" and "SRT Extended" Handshakes](#the-udt-legacy-and-srt-extended-handshakes)
|
||||
- [UDT Legacy Handshake](#udt-legacy-handshake)
|
||||
- [Initiator and Responder](#initiator-and-responder)
|
||||
- [The Request Type Field](#the-request-type-field)
|
||||
- [The Type Field](#the-type-field)
|
||||
- [The Caller-Listener Handshake](#the-caller-listener-handshake)
|
||||
- [The Induction Phase](#the-induction-phase)
|
||||
- [The Conclusion Phase](#the-conclusion-phase)
|
||||
- [The Rendezvous Handshake](#the-rendezvous-handshake)
|
||||
- [HSv4 Rendezvous Process](#hsv4-rendezvous-process)
|
||||
- [HSv5 Rendezvous Process](#hsv5-rendezvous-process)
|
||||
- [Serial Handshake Flow](#serial-handshake-flow)
|
||||
- [Parallel Handshake Flow](#parallel-handshake-flow)
|
||||
- [Rendezvous Between Different Versions](#rendezvous-between-different-versions)
|
||||
- [The SRT Extended Handshake](#the-srt-extended-handshake)
|
||||
- [HSv4 Extended Handshake Process](#hsv4-extended-handshake-process)
|
||||
- [HSv5 Extended Handshake Process](#hsv5-extended-handshake-process)
|
||||
- [SRT Extension Commands](#srt-extension-commands)
|
||||
- [HSREQ and HSRSP](#hsreq-and-hsrsp)
|
||||
- [KMREQ and KMRSP](#kmreq-and-kmrsp)
|
||||
- [Congestion controller](#congestion-controller)
|
||||
- [Stream ID (SID)](#stream-id-sid)
|
||||
- [SRT Handshake](#srt-handshake)
|
||||
- [Overview](#overview)
|
||||
- [Short Introduction to SRT Packet Structure](#short-introduction-to-srt-packet-structure)
|
||||
- [Handshake Structure](#handshake-structure)
|
||||
- [The "UDT Legacy" and "SRT Extended" Handshakes](#the-udt-legacy-and-srt-extended-handshakes)
|
||||
- [UDT Legacy Handshake](#udt-legacy-handshake)
|
||||
- [Initiator and Responder](#initiator-and-responder)
|
||||
- [The Request Type Field](#the-request-type-field)
|
||||
- [The Type Field](#the-type-field)
|
||||
- [The Caller-Listener Handshake](#the-caller-listener-handshake)
|
||||
- [The Induction Phase](#the-induction-phase)
|
||||
- [The Conclusion Phase](#the-conclusion-phase)
|
||||
- [The Rendezvous Handshake](#the-rendezvous-handshake)
|
||||
- [HSv4 Rendezvous Process](#hsv4-rendezvous-process)
|
||||
- [HSv5 Rendezvous Process](#hsv5-rendezvous-process)
|
||||
- [Serial Handshake Flow](#serial-handshake-flow)
|
||||
- [Parallel Handshake Flow](#parallel-handshake-flow)
|
||||
- [Rendezvous Between Different Versions](#rendezvous-between-different-versions)
|
||||
- [The SRT Extended Handshake](#the-srt-extended-handshake)
|
||||
- [HSv4 Extended Handshake Process](#hsv4-extended-handshake-process)
|
||||
- [HSv5 Extended Handshake Process](#hsv5-extended-handshake-process)
|
||||
- [SRT Extension Commands](#srt-extension-commands)
|
||||
- [HSREQ and HSRSP](#hsreq-and-hsrsp)
|
||||
- [KMREQ and KMRSP](#kmreq-and-kmrsp)
|
||||
- [Congestion controller](#congestion-controller)
|
||||
- [Stream ID (SID)](#stream-id-sid)
|
||||
|
||||
|
||||
## Overview
|
||||
@@ -1552,7 +1553,7 @@ the user's choice that can be passed from the Caller to the Listener. The
|
||||
symbol for this extension is `SRT_CMD_SID`.
|
||||
|
||||
The extension block for this extension is encoded the same way as described
|
||||
for Congestion Controler above.
|
||||
for Congestion Controller above.
|
||||
|
||||
The Stream ID is a string of up to 512 characters that a Caller can pass to a
|
||||
Listener (it's actually passed from an Initiator to a Responder in general, but
|
||||
@@ -1561,4 +1562,4 @@ application should set it on a Caller socket using the `SRTO_STREAMID` option.
|
||||
Upon connection, the accepted socket on the Listener side will have exactly the
|
||||
same value set, and it can be retrieved using the same option. For more details
|
||||
about the prospective use of this option, please refer to the
|
||||
[SRT API Socket Options](../API/API-socket-options.md) and [SRT Access Control (Stream ID) Guidlines](access-control.md).
|
||||
[SRT API Socket Options](../API/API-socket-options.md) and [SRT Access Control (Stream ID) Guidelines](access-control.md).
|
||||
|
||||
@@ -33,7 +33,7 @@ However, the transmission must still satisfy the Live Streaming Requirements.
|
||||
|
||||
The MPEG-TS stream, as a good example, consists of Frames. Each
|
||||
Frame is a portion of data assigned to a particular stream (usually you have
|
||||
multipe streams interleaved, at least video and audio). The video stream always has
|
||||
multiple streams interleaved, at least video and audio). The video stream always has
|
||||
its playing speed expressed in fps (frames per second) units. This
|
||||
value maps to a duration for one video frame. So, for example, 60 fps means that
|
||||
one video frame should be "displayed" for a duration of 1/60 of a second. You can
|
||||
|
||||
@@ -113,7 +113,7 @@ time to realize that the link might be broken and time required for resending
|
||||
all unacknowledged packets, before the time to play comes for the received
|
||||
packets. If this time isn't met, packets will be dropped and your advantage
|
||||
of having the backup link might be impaired. According to the tests on the
|
||||
local network it turns out that the most sensible unstability timeout is about
|
||||
local network it turns out that the most sensible instability timeout is about
|
||||
50ms, while normally ACK timeout is 30ms, so extra 100ms latency tax seems to
|
||||
be an absolute minimum.
|
||||
|
||||
@@ -431,7 +431,7 @@ to maintain, whether the list is constant or can be dynamically modified, or
|
||||
whether a dead link is not to be revived by some reason - all these things are
|
||||
out of the interest of the library. It's up to the application to decide
|
||||
when and by what reason the connection is to be established. All that your
|
||||
application has to do is to monitor the conenctions (that is, be conscious
|
||||
application has to do is to monitor the connections (that is, be conscious
|
||||
about that particular links are up and running or get broken) and take
|
||||
appropriate action in response.
|
||||
|
||||
@@ -514,7 +514,7 @@ by `srt_sendmsg2` or `srt_recvmsg2`.
|
||||
This is very simple. Call the sending function (recommended is `srt_sendmsg2`)
|
||||
to send the data, passing group ID in the place of socket ID. By recognizing
|
||||
the ID as group ID, this will be resolved internally as sending the payload
|
||||
by approprately using the bonded links as defined for particular group type.
|
||||
by appropriately using the bonded links as defined for particular group type.
|
||||
|
||||
The current implementation for most of the bonding groups (broadcast and
|
||||
backup) relies on synchronizing the sequence numbers of the packets so that
|
||||
@@ -539,7 +539,7 @@ This is also simple from the user's perspective. Simply call the reading
|
||||
function, such as `srt_recvmsg2`, passing the group ID instead of socket
|
||||
ID.
|
||||
|
||||
Also the dillema of blocking and nonblocking is the same thing. With blocking
|
||||
Also the dilemma of blocking and nonblocking is the same thing. With blocking
|
||||
mode (`SRTO_RCVSYN`), simply wait until your payload is retrieved. The internal
|
||||
group reading facility will take care that you get your payload in the right
|
||||
order and at the time to play, and the redundant payloads retrieved over
|
||||
|
||||
@@ -38,7 +38,7 @@ int run(char *command) {
|
||||
getpid(), grandchild_pid);
|
||||
// Intermediate process exits immediately
|
||||
sleep(10);
|
||||
printf("[PARENT] exitting\n");
|
||||
printf("[PARENT] exiting\n");
|
||||
exit(0);
|
||||
}
|
||||
// Grandchild process
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef struct botan_aes_context
|
||||
#define CRYSPR_HAS_PBKDF2 1
|
||||
|
||||
/*
|
||||
#define CRYSPR_AESCTX to the CRYSPR specifix AES key context object.
|
||||
#define CRYSPR_AESCTX to the CRYSPR-specific AES key context object.
|
||||
This type reserves room in the CRYPSPR control block for Haicrypt KEK and SEK
|
||||
It is set from the keystring through CRYSPR_methods.aes_set_key and passed
|
||||
to CRYSPR_methods.aes_XXX.
|
||||
|
||||
@@ -187,7 +187,7 @@ CRYSPR_methods *crysprGnuTLS(void)
|
||||
crysprGnuTLS_methods.aes_ecb_cipher = crysprGnuTLS_AES_EcbCipher;
|
||||
#endif
|
||||
#if !CRYSPR_HAS_PBKDF2
|
||||
crysprGnuTLS_methods.sha1_msg_digest= crysprGnuTLS_SHA1_MsgDigest; //Onl required if using generic KmPbkdf2
|
||||
crysprGnuTLS_methods.sha1_msg_digest= crysprGnuTLS_SHA1_MsgDigest; //Only required if using generic KmPbkdf2
|
||||
#endif
|
||||
|
||||
//--Crypto Session (Top API)
|
||||
|
||||
@@ -48,9 +48,9 @@ written by
|
||||
#define CRYSPR_HAS_PBKDF2 1
|
||||
|
||||
/*
|
||||
#define CRYSPR_AESCTX to the CRYSPR specifix AES key context object.
|
||||
#define CRYSPR_AESCTX to the CRYSPR-specific AES key context object.
|
||||
This type reserves room in the CRYPSPR control block for Haicrypt KEK and SEK
|
||||
It is set from hte keystring through CRYSPR_methods.aes_set_key and passed
|
||||
It is set from the keystring through CRYSPR_methods.aes_set_key and passed
|
||||
to CRYSPR_methods.aes_XXX.
|
||||
*/
|
||||
typedef struct aes_ctx CRYSPR_AESCTX; /* CRYpto Service PRovider AES key context */
|
||||
|
||||
@@ -246,7 +246,7 @@ CRYSPR_methods *crysprMbedtls(void)
|
||||
crysprMbedtls_methods.aes_ecb_cipher = crysprMbedtls_AES_EcbCipher;
|
||||
#endif
|
||||
#if !CRYSPR_HAS_PBKDF2
|
||||
crysprMbedtls_methods.sha1_msg_digest= crysprMbedtls_SHA1_MsgDigest; //Onl required if using generic KmPbkdf2
|
||||
crysprMbedtls_methods.sha1_msg_digest= crysprMbedtls_SHA1_MsgDigest; //Only required if using generic KmPbkdf2
|
||||
#endif
|
||||
|
||||
//--Crypto Session (Top API)
|
||||
|
||||
@@ -50,7 +50,7 @@ written by
|
||||
#endif
|
||||
|
||||
/*
|
||||
#define CRYSPR_AESCTX to the CRYSPR specifix AES key context object.
|
||||
#define CRYSPR_AESCTX to the CRYSPR-specific AES key context object.
|
||||
This type reserves room in the CRYPSPR control block for Haicrypt KEK and SEK
|
||||
It is set from the keystring through CRYSPR_methods.aes_set_key and passed
|
||||
to CRYSPR_methods.aes_XXX.
|
||||
|
||||
@@ -385,7 +385,7 @@ CRYSPR_methods* crysprOpenSSL_EVP(void)
|
||||
#if !(CRYSPR_HAS_AESCTR && CRYSPR_HAS_AESKWRAP)
|
||||
/* AES-ECB only required if cryspr has no AES-CTR and no AES KeyWrap */
|
||||
/* OpenSSL has both AESCTR and AESKWRP and the AESECB wrapper is only used
|
||||
to test the falback methods */
|
||||
to test the fallback methods */
|
||||
crysprOpenSSL_EVP_methods.aes_ecb_cipher = crysprOpenSSL_EVP_AES_EcbCipher;
|
||||
#endif
|
||||
#if !CRYSPR_HAS_PBKDF2
|
||||
|
||||
@@ -55,9 +55,9 @@ written by
|
||||
#define CRYSPR_HAS_PBKDF2 1 /* Define to 1 if CRYSPR has Password-based Key Derivaion Function 2 */
|
||||
|
||||
/*
|
||||
#define CRYSPR_AESCTX to the CRYSPR specifix AES key context object.
|
||||
#define CRYSPR_AESCTX to the CRYSPR-specific AES key context object.
|
||||
This type reserves room in the CRYPSPR control block for Haicrypt KEK and SEK
|
||||
It is set from hte keystring through CRYSPR_methods.aes_set_key and passed
|
||||
It is set from the keystring through CRYSPR_methods.aes_set_key and passed
|
||||
to CRYSPR_methods.aes_*.
|
||||
*/
|
||||
typedef EVP_CIPHER_CTX CRYSPR_AESCTX; /* CRYpto Service PRovider AES key context */
|
||||
|
||||
@@ -207,7 +207,7 @@ CRYSPR_methods *crysprOpenSSL(void)
|
||||
#if !(CRYSPR_HAS_AESCTR && CRYSPR_HAS_AESKWRAP)
|
||||
/* AES-ECB only required if cryspr has no AES-CTR and no AES KeyWrap */
|
||||
/* OpenSSL has both AESCTR and AESKWRP and the AESECB wrapper is only used
|
||||
to test the falback methods */
|
||||
to test the fallback methods */
|
||||
crysprOpenSSL_methods.aes_ecb_cipher = crysprOpenSSL_AES_EcbCipher;
|
||||
#endif
|
||||
#if !CRYSPR_HAS_PBKDF2
|
||||
|
||||
@@ -52,9 +52,9 @@ written by
|
||||
#define CRYSPR_HAS_PBKDF2 1 /* Define to 1 if CRYSPR has Password-based Key Derivaion Function 2 */
|
||||
|
||||
/*
|
||||
#define CRYSPR_AESCTX to the CRYSPR specifix AES key context object.
|
||||
#define CRYSPR_AESCTX to the CRYSPR-specific AES key context object.
|
||||
This type reserves room in the CRYPSPR control block for Haicrypt KEK and SEK
|
||||
It is set from hte keystring through CRYSPR_methods.aes_set_key and passed
|
||||
It is set from the keystring through CRYSPR_methods.aes_set_key and passed
|
||||
to CRYSPR_methods.aes_*.
|
||||
*/
|
||||
typedef AES_KEY CRYSPR_AESCTX; /* CRYpto Service PRovider AES key context */
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ typedef struct tag_CRYSPR_methods {
|
||||
|
||||
/*
|
||||
* km_setkey:
|
||||
* Set the Key Encypting Key for Wrap (Encryption) or UnWrap (Decryption).
|
||||
* Set the Key Encrypting Key for Wrap (Encryption) or UnWrap (Decryption).
|
||||
* Context (ctx) tells if it's for Wrap or Unwrap
|
||||
* A Context flags (ctx->flags) also tells if this is for wrap(encryption) or unwrap(decryption) context (HCRYPT_CTX_F_ENCRYPT)
|
||||
*/
|
||||
|
||||
+3
-3
@@ -91,7 +91,7 @@ static hcrypt_Session* sHaiCrypt_PrepareHandle(const HaiCrypt_Cfg* cfg, HaiCrypt
|
||||
crypto->km.refresh_rate = cfg->km_refresh_rate_pkt;
|
||||
crypto->km.pre_announce = cfg->km_pre_announce_pkt;
|
||||
|
||||
/* Indentify each context */
|
||||
/* Identify each context */
|
||||
crypto->ctx_pair[0].flags = HCRYPT_MSG_F_eSEK | (tx ? HCRYPT_CTX_F_ENCRYPT : 0);
|
||||
crypto->ctx_pair[1].flags = HCRYPT_MSG_F_oSEK | (tx ? HCRYPT_CTX_F_ENCRYPT : 0);
|
||||
/* Point to each other */
|
||||
@@ -307,7 +307,7 @@ int HaiCrypt_Clone(HaiCrypt_Handle hhcSrc, HaiCrypt_CryptoDir tx, HaiCrypt_Handl
|
||||
timerclear(&cryptoClone->km.tx_last);
|
||||
|
||||
/* Adjust pointers pointing into cryproSrc after copy
|
||||
msg_info and crysprs are extern statics so this is ok*/
|
||||
msg_info and crysprs are extern static so this is ok*/
|
||||
cryptoClone->ctx_pair[0].alt = &cryptoClone->ctx_pair[1];
|
||||
cryptoClone->ctx_pair[1].alt = &cryptoClone->ctx_pair[0];
|
||||
|
||||
@@ -327,7 +327,7 @@ int HaiCrypt_Clone(HaiCrypt_Handle hhcSrc, HaiCrypt_CryptoDir tx, HaiCrypt_Handl
|
||||
}
|
||||
|
||||
/* Clear salt to force later regeneration of KEK as AES decrypting key,
|
||||
copyed one is encrypting key */
|
||||
copied one is encrypting key */
|
||||
cryptoClone->ctx_pair[0].flags &= ~HCRYPT_CTX_F_ENCRYPT;
|
||||
cryptoClone->ctx_pair[1].flags &= ~HCRYPT_CTX_F_ENCRYPT;
|
||||
memset(cryptoClone->ctx_pair[0].salt, 0, sizeof(cryptoClone->ctx_pair[0].salt));
|
||||
|
||||
@@ -110,7 +110,7 @@ int hcryptCtx_Tx_CloneKey(hcrypt_Session *crypto, hcrypt_Ctx *ctx, const hcrypt_
|
||||
const hcrypt_Ctx* ctxSrc = cryptoSrc->ctx;
|
||||
if (!ctxSrc)
|
||||
{
|
||||
/* Probbly the context is not yet completely initialized, so
|
||||
/* Probably the context is not yet completely initialized, so
|
||||
* use blindly the first context from the pair
|
||||
*/
|
||||
ctxSrc = &cryptoSrc->ctx_pair[0];
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef uint32_t hcrypt_Pki;
|
||||
|
||||
#define HCRYPT_MSG_PT_MS 1 /* Media stream */
|
||||
#define HCRYPT_MSG_PT_KM 2 /* Keying Material */
|
||||
#define HCRYPT_MSG_PT_RESV7 7 /* Reserved to dicriminate MPEG-TS packet (SyncByte=0x47) */
|
||||
#define HCRYPT_MSG_PT_RESV7 7 /* Reserved to discriminate MPEG-TS packet (SyncByte=0x47) */
|
||||
|
||||
|
||||
#define HCRYPT_MSG_F_eSEK 0x01 /* Even Stream Encrypting Key */
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[codespell]
|
||||
|
||||
# Enable built-in dictionaries/rules.
|
||||
# See more details for https://github.com/codespell-project/codespell/tree/main/codespell_lib/data.
|
||||
builtin = clear,rare,informal,code
|
||||
|
||||
# Ignore words listed in this file.
|
||||
ignore-words = ./scripts/codespell/codespell_whitelist.txt
|
||||
|
||||
# Add custom dictionary file.
|
||||
dictionary = ./scripts/codespell/codespell_dictionary.txt,-
|
||||
|
||||
# Skip checking files or directories.
|
||||
skip = ./build/*,./.git/*
|
||||
@@ -0,0 +1,30 @@
|
||||
AnyOther
|
||||
ANS
|
||||
CAS
|
||||
connectIn
|
||||
deque
|
||||
dur
|
||||
endcode
|
||||
fo
|
||||
inout
|
||||
kinda
|
||||
lene
|
||||
lets
|
||||
lite
|
||||
LITE
|
||||
mane
|
||||
mut
|
||||
MUSL
|
||||
nd
|
||||
numer
|
||||
od
|
||||
RO
|
||||
stdio
|
||||
stoll
|
||||
snd
|
||||
Snd
|
||||
SND
|
||||
uint
|
||||
unsecure
|
||||
UNSECURE
|
||||
ws
|
||||
@@ -36,7 +36,7 @@ set loggers {
|
||||
RSRC rs 5 "System resource allocation and management"
|
||||
CONGEST cc 7 "Congestion control module"
|
||||
PFILTER pf 8 "Packet filter module"
|
||||
API_CTRL ac 11 "API part for socket and library managmenet"
|
||||
API_CTRL ac 11 "API part for socket and library management"
|
||||
QUE_CTRL qc 13 "Queue control activities"
|
||||
EPOLL_UPD ei 16 "EPoll, internal update activities"
|
||||
|
||||
@@ -140,7 +140,7 @@ proc GenerateModelForSrtH {} {
|
||||
continue
|
||||
}
|
||||
|
||||
# End of generated section. Switch back to pass-thru.
|
||||
# End of generated section. Switch back to pass-through.
|
||||
|
||||
# First fill the gap
|
||||
append contents "\n\$entries\n\n"
|
||||
|
||||
@@ -24,7 +24,7 @@ macro(fetch_googletest _download_module_path _download_root)
|
||||
${_download_root}
|
||||
)
|
||||
|
||||
# adds the targers: gtest, gtest_main, gmock, gmock_main
|
||||
# adds the targets: gtest, gtest_main, gmock, gmock_main
|
||||
add_subdirectory(
|
||||
${_download_root}/googletest-src
|
||||
${_download_root}/googletest-build
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ local msg_type_select = {
|
||||
[0x7FFF] = "[Message Extension Type]"
|
||||
}
|
||||
fields.msg_type = ProtoField.uint16("srt_dev.msg_type", "Message Type", base.HEX, msg_type_select, 0x7FFF)
|
||||
fields.msg_ext_type = ProtoField.uint16("srt_dev.msg_ext_type", "Message Extented Type", base.DEC)
|
||||
fields.msg_ext_type = ProtoField.uint16("srt_dev.msg_ext_type", "Message Extended Type", base.DEC)
|
||||
|
||||
local flag_state_select = {
|
||||
[0] = "Unset",
|
||||
@@ -281,7 +281,7 @@ function srt_dev.dissector (tvb, pinfo, tree)
|
||||
subtree:add(fields.ext_fld, tvb(offset, 2)):append_text(" [HSv5 MAGIC]")
|
||||
else
|
||||
-- Extension Field is HS_EXT_prefix
|
||||
-- The define is in fiel handshake.h
|
||||
-- The define is in file handshake.h
|
||||
local ext_fld_tree = subtree:add(fields.ext_fld_tree, tvb(offset, 2))
|
||||
local str_table = { " [" }
|
||||
ext_fld_tree:add(fields.hsreq, tvb(offset, 2))
|
||||
|
||||
@@ -58,7 +58,7 @@ class UDPProxy:
|
||||
#Modify the NAK
|
||||
processedData = data
|
||||
# NAK
|
||||
if(data[1] == 0x03 and len(data) == 24 and self.PACKETBREAK_NAK != 0): # IS A NAK, This should check for a 1 in the first byte aswell.
|
||||
if(data[1] == 0x03 and len(data) == 24 and self.PACKETBREAK_NAK != 0): # IS A NAK, This should check for a 1 in the first byte as well.
|
||||
print("Modifying NAK.")
|
||||
newBytes = b"\xff\xff\xff\xff"
|
||||
processedData = data[:20] + newBytes + data[20 + len(newBytes):]
|
||||
@@ -94,7 +94,7 @@ class UDPProxy:
|
||||
# Receive from server
|
||||
data, addr = sock.recvfrom(65535)
|
||||
|
||||
# Drop a sequence of data packets (as to atleast 3 to trigger an NAK with a range)
|
||||
# Drop a sequence of data packets (as to at least 3 to trigger an NAK with a range)
|
||||
if len(data) == 1332: # Packet with data
|
||||
self.sentPacketCounter += 1
|
||||
if (self.PACKETBREAK_NAK != 0 and self.sentPacketCounter in range(self.PACKETBREAK_NAK, self.PACKETBREAK_NAK+5)):
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# OS - the default, used to build for Vision Pro physical device, which have an arm arch.
|
||||
# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
|
||||
#
|
||||
# VISIONOS_ARCH = arm64 (default for OS), x86_64 (addiitonal support for SIMULATOR64)
|
||||
# VISIONOS_ARCH = arm64 (default for OS), x86_64 (additional support for SIMULATOR64)
|
||||
#
|
||||
# CMAKE_VISIONOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
|
||||
# By default this location is automatcially chosen based on the VISIONOS_PLATFORM value above.
|
||||
|
||||
@@ -35,7 +35,7 @@ Optional parameters:
|
||||
- `-Version name` :
|
||||
Use the specified string as version number for libsrt. By default, if the
|
||||
current commit has a tag, use that tag (initial "v" removed, for instance
|
||||
`1.4.3`). Otherwise, the defaut version is a detailed version number (most
|
||||
`1.4.3`). Otherwise, the default version is a detailed version number (most
|
||||
recent version, number of commits since then, short commit SHA, for instance
|
||||
`1.4.3-32-g22cc924`). Use that option if necessary to specify some other
|
||||
non-standard form of version string.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
Use the specified string as version number from libsrt. By default, if
|
||||
the current commit has a tag, use that tag (initial 'v' removed). Otherwise,
|
||||
the defaut version is a detailed version number (most recent version, number
|
||||
the default version is a detailed version number (most recent version, number
|
||||
of commits since then, short commit SHA).
|
||||
|
||||
.PARAMETER NoBuild
|
||||
|
||||
+9
-9
@@ -329,7 +329,7 @@ void srt::CUDTUnited::cleanupAllSockets()
|
||||
void srt::CUDTUnited::closeAllSockets()
|
||||
{
|
||||
// remove all sockets and multiplexers
|
||||
HLOGC(inlog.Debug, log << "GC: GLOBAL EXIT - releasing all pending sockets. Acquring control lock...");
|
||||
HLOGC(inlog.Debug, log << "GC: GLOBAL EXIT - releasing all pending sockets. Acquiring control lock...");
|
||||
|
||||
{
|
||||
// Pre-closing: run over all open sockets and close them.
|
||||
@@ -870,10 +870,10 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,
|
||||
g->m_bConnected = true;
|
||||
}
|
||||
|
||||
// XXX PROLBEM!!! These events are subscribed here so that this is done once, lazily,
|
||||
// XXX PROBLEM!!! These events are subscribed here so that this is done once, lazily,
|
||||
// but groupwise connections could be accepted from multiple listeners for the same group!
|
||||
// m_listener MUST BE A CONTAINER, NOT POINTER!!!
|
||||
// ALSO: Maybe checking "the same listener" is not necessary as subscruption may be done
|
||||
// ALSO: Maybe checking "the same listener" is not necessary as subscription may be done
|
||||
// multiple times anyway?
|
||||
if (!g->m_listener)
|
||||
{
|
||||
@@ -1613,7 +1613,7 @@ int srt::CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, i
|
||||
HLOGC(aclog.Debug, log << "srt_connect_group: socket @" << sid << " deleted in process");
|
||||
// Someone deleted the socket in the meantime?
|
||||
// Unlikely, but possible in theory.
|
||||
// Don't delete anyhting - it's alreay done.
|
||||
// Don't delete anything - it's already done.
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1659,7 +1659,7 @@ int srt::CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, i
|
||||
}
|
||||
}
|
||||
|
||||
// XXX This should be reenabled later, this should
|
||||
// XXX This should be re-enabled later, this should
|
||||
// be probably still in use to exchange information about
|
||||
// packets asymmetrically lost. But for no other purpose.
|
||||
/*
|
||||
@@ -1789,7 +1789,7 @@ int srt::CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, i
|
||||
// pending, about to be broken, and srt_connect() is called again?
|
||||
// SHOULD BLOCK the latter, even though is OPEN.
|
||||
// Or, OPEN should be removed from here and srt_connect(_group)
|
||||
// should block always if the group doesn't have neither 1 conencted link
|
||||
// should block always if the group doesn't have neither 1 connected link
|
||||
g.m_bOpened = true;
|
||||
|
||||
g.m_stats.tsLastSampleTime = steady_clock::now();
|
||||
@@ -1985,7 +1985,7 @@ int srt::CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, i
|
||||
// function will still be polling sockets to determine the last man
|
||||
// standing. Each one could, however, break by a different reason,
|
||||
// for example, one by timeout, another by wrong passphrase. Check
|
||||
// the `errorcode` field to determine the reaon for particular link.
|
||||
// the `errorcode` field to determine the reason for particular link.
|
||||
if (retval == -1)
|
||||
throw CUDTException(MJ_CONNECTION, MN_CONNLOST, 0);
|
||||
|
||||
@@ -3321,7 +3321,7 @@ void srt::CUDTUnited::updateMux(CUDTSocket* s, const sockaddr_any& reqaddr, cons
|
||||
{
|
||||
LOGC(smlog.Error,
|
||||
log << "bind: Wildcard address: " << reqaddr.str()
|
||||
<< " conflicts with existting IP binding: " << mux_addr.str());
|
||||
<< " conflicts with existing IP binding: " << mux_addr.str());
|
||||
throw CUDTException(MJ_NOTSUP, MN_BUSYPORT, 0);
|
||||
}
|
||||
// If this is bound to a certain address, AND:
|
||||
@@ -3639,7 +3639,7 @@ SRTSOCKET srt::CUDT::createGroup(SRT_GROUP_TYPE gt)
|
||||
srt::sync::ExclusiveLock globlock(uglobal().m_GlobControlLock);
|
||||
return newGroup(gt).id();
|
||||
// Note: potentially, after this function exits, the group
|
||||
// could be deleted, immediately, from a separate thread (tho
|
||||
// could be deleted, immediately, from a separate thread (though
|
||||
// unlikely because the other thread would need some handle to
|
||||
// keep it). But then, the first call to any API function would
|
||||
// return invalid ID error.
|
||||
|
||||
+1
-1
@@ -529,7 +529,7 @@ private:
|
||||
/// @brief Checks if channel configuration matches the socket configuration.
|
||||
/// @param cfgMuxer multiplexer configuration.
|
||||
/// @param cfgSocket socket configuration.
|
||||
/// @return tru if configurations match, false otherwise.
|
||||
/// @return true if configurations match, false otherwise.
|
||||
static bool channelSettingsMatch(const CSrtMuxerConfig& cfgMuxer, const CSrtConfig& cfgSocket);
|
||||
static bool inet6SettingsCompat(const sockaddr_any& muxaddr, const CSrtMuxerConfig& cfgMuxer,
|
||||
const sockaddr_any& reqaddr, const CSrtMuxerConfig& cfgSocket);
|
||||
|
||||
+2
-2
@@ -75,11 +75,11 @@
|
||||
#define ATOMIC_USE_GCC_INTRINSICS
|
||||
#elif defined(__GNUC__) \
|
||||
&& ( (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) )
|
||||
// NOTE: The __atomic_* family of intrisics were introduced in GCC-4.7.0.
|
||||
// NOTE: The __atomic_* family of intrinsics were introduced in GCC-4.7.0.
|
||||
// NOTE: This follows #if defined(__clang__), because most if, not all,
|
||||
// versions of Clang define __GNUC__ and __GNUC_MINOR__ but often define
|
||||
// them to 4.4 or an even earlier version. Most of the newish versions
|
||||
// of Clang also support GCC Atomic Intrisics even if they set GCC version
|
||||
// of Clang also support GCC Atomic Intrinsics even if they set GCC version
|
||||
// macros to <4.7.
|
||||
#define ATOMIC_USE_GCC_INTRINSICS
|
||||
#elif defined(__GNUC__) && !defined(ATOMIC_USE_SRT_SYNC_MUTEX)
|
||||
|
||||
@@ -483,7 +483,7 @@ int CRcvBuffer::readMessage(char* data, size_t len, SRT_MSGCTRL* msgctrl)
|
||||
|
||||
if (!m_tsbpd.isEnabled())
|
||||
// We need updateFirstReadableOutOfOrder() here even if we are reading inorder,
|
||||
// incase readable inorder packets are all read out.
|
||||
// in case readable inorder packets are all read out.
|
||||
updateFirstReadableOutOfOrder();
|
||||
|
||||
const int bytes_read = int(dst - data);
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
/// @param seqnolo sequence number of the first packet in the dropping range.
|
||||
/// @param seqnohi sequence number of the last packet in the dropping range.
|
||||
/// @param msgno message number to drop (0 if unknown)
|
||||
/// @param actionOnExisting Should an exising SOLO packet be dropped from the buffer or preserved?
|
||||
/// @param actionOnExisting Should an existing SOLO packet be dropped from the buffer or preserved?
|
||||
/// @return the number of packets actually dropped.
|
||||
int dropMessage(int32_t seqnolo, int32_t seqnohi, int32_t msgno, DropActionIfExists actionOnExisting);
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
int getRcvDataSize() const;
|
||||
|
||||
/// Get the number of packets, bytes and buffer timespan.
|
||||
/// Differs from getRcvDataSize() that it counts all packets in the buffer, not only continious.
|
||||
/// Differs from getRcvDataSize() that it counts all packets in the buffer, not only continuous.
|
||||
int getRcvDataSize(int& bytes, int& timespan) const;
|
||||
|
||||
struct PacketInfo
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
|
||||
/// Return buffer capacity.
|
||||
/// One slot had to be empty in order to tell the difference between "empty buffer" and "full buffer".
|
||||
/// E.g. m_iFirstNonreadPos would again point to m_iStartPos if m_szSize entries are added continiously.
|
||||
/// E.g. m_iFirstNonreadPos would again point to m_iStartPos if m_szSize entries are added continuously.
|
||||
/// TODO: Old receiver buffer capacity returns the actual size. Check for conflicts.
|
||||
size_t capacity() const
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ void CSndBuffer::addBuffer(const char* data, int len, SRT_MSGCTRL& w_mctrl)
|
||||
s->m_iMsgNoBitset |= PacketBoundaryBits(PB_FIRST);
|
||||
if (i == iNumBlocks - 1)
|
||||
s->m_iMsgNoBitset |= PacketBoundaryBits(PB_LAST);
|
||||
// NOTE: if i is neither 0 nor size-1, it resuls with PB_SUBSEQUENT.
|
||||
// NOTE: if i is neither 0 nor size-1, it results with PB_SUBSEQUENT.
|
||||
// if i == 0 == size-1, it results with PB_SOLO.
|
||||
// Packets assigned to one message can be:
|
||||
// [PB_FIRST] [PB_SUBSEQUENT] [PB_SUBSEQUENT] [PB_LAST] - 4 packets per message
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ void srt::CChannel::setUDPSockOpt()
|
||||
m_iSocket, SOL_SOCKET, SO_SNDBUF, (const char*)&m_mcfg.iUDPSndBufSize, sizeof m_mcfg.iUDPSndBufSize))
|
||||
::setsockopt(m_iSocket, SOL_SOCKET, SO_SNDBUF, (const char*)&maxsize, sizeof maxsize);
|
||||
#else
|
||||
// for other systems, if requested is greated than maximum, the maximum value will be automactally used
|
||||
// for other systems, if requested is greater than maximum, the maximum value will be automatically used
|
||||
if ((-1 == ::setsockopt(m_iSocket, SOL_SOCKET, SO_RCVBUF,
|
||||
(const char*)&m_mcfg.iUDPRcvBufSize, sizeof m_mcfg.iUDPRcvBufSize))
|
||||
||
|
||||
|
||||
+2
-2
@@ -565,7 +565,7 @@ struct EventSlot
|
||||
|
||||
// UDT Sequence Number 0 - (2^31 - 1)
|
||||
|
||||
// seqcmp: compare two seq#, considering the wraping
|
||||
// seqcmp: compare two seq#, considering the wrapping
|
||||
// seqlen: length from the 1st to the 2nd seq#, including both
|
||||
// seqoff: offset from the 2nd to the 1st seq#
|
||||
// incseq: increase the seq# by 1
|
||||
@@ -601,7 +601,7 @@ public:
|
||||
return seqcmp(value, other.value) <= 0;
|
||||
}
|
||||
|
||||
// circular arithmetics
|
||||
// circular arithmetic
|
||||
friend int operator-(const CSeqNo& c1, const CSeqNo& c2)
|
||||
{
|
||||
return seqoff(c2.value, c1.value);
|
||||
|
||||
+33
-33
@@ -93,7 +93,7 @@ const SRTSOCKET UDT::INVALID_SOCK = srt::CUDT::INVALID_SOCK;
|
||||
const int UDT::ERROR = srt::CUDT::ERROR;
|
||||
|
||||
//#define SRT_CMD_HSREQ 1 /* SRT Handshake Request (sender) */
|
||||
#define SRT_CMD_HSREQ_MINSZ 8 /* Minumum Compatible (1.x.x) packet size (bytes) */
|
||||
#define SRT_CMD_HSREQ_MINSZ 8 /* Minimum Compatible (1.x.x) packet size (bytes) */
|
||||
#define SRT_CMD_HSREQ_SZ 12 /* Current version packet size */
|
||||
#if SRT_CMD_HSREQ_SZ > SRT_CMD_MAXSZ
|
||||
#error SRT_CMD_MAXSZ too small
|
||||
@@ -106,7 +106,7 @@ const int UDT::ERROR = srt::CUDT::ERROR;
|
||||
*/
|
||||
|
||||
//#define SRT_CMD_HSRSP 2 /* SRT Handshake Response (receiver) */
|
||||
#define SRT_CMD_HSRSP_MINSZ 8 /* Minumum Compatible (1.x.x) packet size (bytes) */
|
||||
#define SRT_CMD_HSRSP_MINSZ 8 /* Minimum Compatible (1.x.x) packet size (bytes) */
|
||||
#define SRT_CMD_HSRSP_SZ 12 /* Current version packet size */
|
||||
#if SRT_CMD_HSRSP_SZ > SRT_CMD_MAXSZ
|
||||
#error SRT_CMD_MAXSZ too small
|
||||
@@ -297,7 +297,7 @@ void srt::RateMeasurement::pickup(const clock_time& time)
|
||||
// If the container is empty, do not stockpile empty slices.
|
||||
if (m_slices.empty() && slice.bytes == 0)
|
||||
{
|
||||
HLOGC(bslog.Debug, log << "... NOT COLLECING packet with " << slice.bytes << " bytes to " << m_slices.size() << " total");
|
||||
HLOGC(bslog.Debug, log << "... NOT COLLECTING packet with " << slice.bytes << " bytes to " << m_slices.size() << " total");
|
||||
// Empty-to-empty: DO NOT stockpile.
|
||||
// NOTE: the container is never cleared when it has
|
||||
// any older data, so this situation is only possible:
|
||||
@@ -438,7 +438,7 @@ void srt::CUDT::construct()
|
||||
m_zSndMaxPacketSize = 0;
|
||||
#endif
|
||||
|
||||
// Initilize mutex and condition variables.
|
||||
// Initialize mutex and condition variables.
|
||||
initSynch();
|
||||
|
||||
// TODO: Uncomment when the callback is implemented.
|
||||
@@ -520,7 +520,7 @@ srt::CUDT::CUDT(CUDTSocket* parent, const CUDT& ancestor)
|
||||
|
||||
srt::CUDT::~CUDT()
|
||||
{
|
||||
// release mutex/condtion variables
|
||||
// release mutex/condition variables
|
||||
destroySynch();
|
||||
|
||||
// destroy the data structures
|
||||
@@ -1628,7 +1628,7 @@ bool srt::CUDT::createSrtHandshake(
|
||||
|
||||
// Once you are certain that the version is HSv5, set the enc type flags
|
||||
// to advertise pbkeylen. Otherwise make sure that the old interpretation
|
||||
// will correctly pick up the type field. PBKEYLEN should be advertized
|
||||
// will correctly pick up the type field. PBKEYLEN should be advertised
|
||||
// regardless of what URQ stage the handshake is (note that in case of rendezvous
|
||||
// CONCLUSION might be the FIRST MESSAGE EVER RECEIVED by a party).
|
||||
if (w_hs.m_iVersion > HS_VERSION_UDT4)
|
||||
@@ -1784,7 +1784,7 @@ bool srt::CUDT::createSrtHandshake(
|
||||
// it was an abnormal interrupt during the processing so the handshake process should be aborted
|
||||
// anyway, and that's what will be done.
|
||||
|
||||
// LOCKING INFORMATION: accesing this field just for NULL check doesn't
|
||||
// LOCKING INFORMATION: accessing this field just for NULL check doesn't
|
||||
// hurt, even if this field could be dangling in the moment. This will be
|
||||
// followed by an additional check, done this time under lock, and there will
|
||||
// be no dangling pointers at this time.
|
||||
@@ -1886,7 +1886,7 @@ bool srt::CUDT::createSrtHandshake(
|
||||
#if ENABLE_BONDING
|
||||
// Note that this will fire in both cases:
|
||||
// - When the group has been set by the user on a socket (or socket was created as a part of the group),
|
||||
// and the handshake request is to be sent with informing the peer that this conenction belongs to a group
|
||||
// and the handshake request is to be sent with informing the peer that this connection belongs to a group
|
||||
// - When the agent received a HS request with a group, has created its mirror group on its side, and
|
||||
// now sends the HS response to the peer, with ITS OWN group id (the mirror one).
|
||||
//
|
||||
@@ -4074,7 +4074,7 @@ void srt::CUDT::startConnect(const sockaddr_any& serv_addr, int32_t forced_isn)
|
||||
m_RejectReason = RejectReasonForURQ(m_ConnRes.m_iReqType);
|
||||
e = CUDTException(MJ_SETUP, MN_REJECTED, 0);
|
||||
}
|
||||
else if ((!m_config.bRendezvous) && (m_ConnRes.m_iISN != m_iISN)) // secuity check
|
||||
else if ((!m_config.bRendezvous) && (m_ConnRes.m_iISN != m_iISN)) // security check
|
||||
e = CUDTException(MJ_SETUP, MN_SECURITY, 0);
|
||||
}
|
||||
|
||||
@@ -4543,7 +4543,7 @@ EConnectStatus srt::CUDT::processRendezvous(
|
||||
HLOGC(
|
||||
cnlog.Debug,
|
||||
log << CONID()
|
||||
<< "processRendezvous: no INCOMING packet, NOT interpreting extensions (relying on exising data)");
|
||||
<< "processRendezvous: no INCOMING packet, NOT interpreting extensions (relying on existing data)");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4658,7 +4658,7 @@ EConnectStatus srt::CUDT::processRendezvous(
|
||||
// the request time must be updated so that the next handshake can be sent out immediately
|
||||
HLOGC(cnlog.Debug,
|
||||
log << "processRendezvous: rsp=" << RequestTypeStr(m_ConnReq.m_iReqType)
|
||||
<< " REQ-TIME: LOW to send immediately, consider yourself conencted");
|
||||
<< " REQ-TIME: LOW to send immediately, consider yourself connected");
|
||||
m_tsLastReqTime = steady_clock::time_point();
|
||||
}
|
||||
else
|
||||
@@ -4961,7 +4961,7 @@ bool srt::CUDT::applyResponseSettings(const CPacket* pHspkt /*[[nullable]]*/) AT
|
||||
m_SourceAddr = pHspkt->udpDestAddr();
|
||||
|
||||
HLOGC(cnlog.Debug,
|
||||
log << CONID() << "applyResponseSettings: HANSHAKE CONCLUDED. SETTING: payload-size=" << m_iMaxSRTPayloadSize
|
||||
log << CONID() << "applyResponseSettings: HANDSHAKE CONCLUDED. SETTING: payload-size=" << m_iMaxSRTPayloadSize
|
||||
<< " mss=" << m_ConnRes.m_iMSS << " flw=" << m_ConnRes.m_iFlightFlagSize << " peer-ISN=" << m_ConnRes.m_iISN
|
||||
<< " local-ISN=" << m_iISN
|
||||
<< " peerID=" << m_ConnRes.m_iID
|
||||
@@ -6279,7 +6279,7 @@ SRT_REJECT_REASON srt::CUDT::setupCC()
|
||||
|
||||
// XXX Not sure about that. May happen that AGENT wants
|
||||
// tsbpd mode, but PEER doesn't, even in bidirectional mode.
|
||||
// This way, the reception side should get precedense.
|
||||
// This way, the reception side should get precedence.
|
||||
// if (bidirectional || m_config.bDataSender || m_bTwoWayData)
|
||||
// m_bPeerTsbPd = m_bTSBPD;
|
||||
|
||||
@@ -6353,7 +6353,7 @@ SRT_REJECT_REASON srt::CUDT::setupCC()
|
||||
|
||||
if (!updateCC(TEV_INIT, EventVariant(TEV_INIT_RESET)))
|
||||
{
|
||||
LOGC(rslog.Error, log << CONID() << "setupCC: IPE: resrouces not yet initialized!");
|
||||
LOGC(rslog.Error, log << CONID() << "setupCC: IPE: resources not yet initialized!");
|
||||
return SRT_REJ_IPE;
|
||||
}
|
||||
return SRT_REJ_UNKNOWN;
|
||||
@@ -6785,7 +6785,7 @@ int srt::CUDT::sndDropTooLate()
|
||||
|
||||
// high threshold (msec) at tsbpd_delay plus sender/receiver reaction time (2 * 10ms)
|
||||
// Minimum value must accommodate an I-Frame (~8 x average frame size)
|
||||
// >>need picture rate or app to set min treshold
|
||||
// >>need picture rate or app to set min threshold
|
||||
// >>using 1 sec for worse case 1 frame using all bit budget.
|
||||
// picture rate would be useful in auto SRT setting for min latency
|
||||
// XXX Make SRT_TLPKTDROP_MINTHRESHOLD_MS option-configurable
|
||||
@@ -7019,7 +7019,7 @@ int srt::CUDT::sendmsg2(const char *data, int len, SRT_MSGCTRL& w_mctrl)
|
||||
|
||||
/*
|
||||
* The code below is to return ETIMEOUT when blocking mode could not get free buffer in time.
|
||||
* If no free buffer available in non-blocking mode, we alredy returned. If buffer available,
|
||||
* If no free buffer available in non-blocking mode, we already returned. If buffer available,
|
||||
* we test twice if this code is outside the else section.
|
||||
* This fix move it in the else (blocking-mode) section
|
||||
*/
|
||||
@@ -7106,7 +7106,7 @@ int srt::CUDT::sendmsg2(const char *data, int len, SRT_MSGCTRL& w_mctrl)
|
||||
w_mctrl.pktseq = seqno;
|
||||
|
||||
// Now seqno is the sequence to which it was scheduled
|
||||
// XXX Conversion from w_mctrl.srctime -> steady_clock::time_point need not be accurrate.
|
||||
// XXX Conversion from w_mctrl.srctime -> steady_clock::time_point need not be accurate.
|
||||
HLOGC(aslog.Debug, log << CONID() << "buf:SENDING (BEFORE) srctime:"
|
||||
<< (w_mctrl.srctime ? FormatTime(ts_srctime) : "none")
|
||||
<< " DATA SIZE: " << size << " sched-SEQUENCE: " << seqno
|
||||
@@ -7141,7 +7141,7 @@ int srt::CUDT::sendmsg2(const char *data, int len, SRT_MSGCTRL& w_mctrl)
|
||||
<< " size=" << size << " #" << w_mctrl.msgno << " SCHED %" << orig_seqno
|
||||
<< "(>> %" << seqno << ") !" << BufferStamp(data, size));
|
||||
|
||||
if (sndBuffersLeft() < 1) // XXX Not sure if it should test if any space in the buffer, or as requried.
|
||||
if (sndBuffersLeft() < 1) // XXX Not sure if it should test if any space in the buffer, or as required.
|
||||
{
|
||||
// write is not available any more
|
||||
uglobal().m_EPoll.update_events(m_SocketID, m_sPollID, SRT_EPOLL_OUT, false);
|
||||
@@ -7398,7 +7398,7 @@ int srt::CUDT::receiveMessage(char* data, int len, SRT_MSGCTRL& w_mctrl, int by_
|
||||
{
|
||||
// `wait_for(recv_timeout)` wouldn't be correct here. Waiting should be
|
||||
// only until the time that is now + timeout since the first moment
|
||||
// when this started, or sliced-waiting for 1 second, if timtout is
|
||||
// when this started, or sliced-waiting for 1 second, if timeout is
|
||||
// higher than this.
|
||||
const steady_clock::time_point exptime = steady_clock::now() + recv_timeout;
|
||||
|
||||
@@ -7950,7 +7950,7 @@ bool srt::CUDT::updateCC(ETransmissionEvent evt, const EventVariant arg)
|
||||
// Use the values:
|
||||
// - if SRTO_MAXBW is >0, use it.
|
||||
// - if SRTO_MAXBW == 0, use SRTO_INPUTBW + SRTO_OHEADBW
|
||||
// - if SRTO_INPUTBW == 0, pass 0 to requst in-buffer sampling
|
||||
// - if SRTO_INPUTBW == 0, pass 0 to request in-buffer sampling
|
||||
// Bytes/s
|
||||
const int64_t bw = m_config.llMaxBW != 0 ? m_config.llMaxBW : // When used SRTO_MAXBW
|
||||
m_config.llInputBW != 0 ? withOverhead(m_config.llInputBW) : // SRTO_INPUTBW + SRT_OHEADBW
|
||||
@@ -8249,7 +8249,7 @@ void srt::CUDT::sendCtrl(UDTMessageType pkttype, const int32_t* lparam, void* rp
|
||||
break;
|
||||
|
||||
case UMSG_SHUTDOWN: // 101 - Shutdown
|
||||
if (m_PeerID == 0) // Dont't send SHUTDOWN if we don't know peer ID.
|
||||
if (m_PeerID == 0) // Don't send SHUTDOWN if we don't know peer ID.
|
||||
break;
|
||||
ctrlpkt.pack(pkttype);
|
||||
ctrlpkt.set_id(m_PeerID);
|
||||
@@ -8271,7 +8271,7 @@ void srt::CUDT::sendCtrl(UDTMessageType pkttype, const int32_t* lparam, void* rp
|
||||
|
||||
break;
|
||||
|
||||
case UMSG_EXT: // 0x7FFF - Resevered for future use
|
||||
case UMSG_EXT: // 0x7FFF - Reserved for future use
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -8790,7 +8790,7 @@ void srt::CUDT::processCtrlAck(const CPacket &ctrlpkt, const steady_clock::time_
|
||||
* Therefore, a distinct ack state is used for received Ack (iSndLastFullAck)
|
||||
* and ack position in send buffer (m_iSndLastDataAck).
|
||||
* Otherwise, when severe congestion causing packet drops (and m_iSndLastDataAck update)
|
||||
* occures, we drop received acks (as duplicates) and do not update stats like RTT,
|
||||
* occurs, we drop received acks (as duplicates) and do not update stats like RTT,
|
||||
* which may go crazy and stay there, preventing proper stream recovery.
|
||||
*/
|
||||
|
||||
@@ -9212,7 +9212,7 @@ void srt::CUDT::processCtrlHS(const CPacket& ctrlpkt)
|
||||
|
||||
HLOGC(inlog.Debug, log << CONID() << "processCtrl: got HS: " << req.show());
|
||||
|
||||
if ((req.m_iReqType > URQ_INDUCTION_TYPES) // acually it catches URQ_INDUCTION and URQ_ERROR_* symbols...???
|
||||
if ((req.m_iReqType > URQ_INDUCTION_TYPES) // actually it catches URQ_INDUCTION and URQ_ERROR_* symbols...???
|
||||
|| (m_config.bRendezvous && (req.m_iReqType != URQ_AGREEMENT))) // rnd sends AGREEMENT in rsp to CONCLUSION
|
||||
{
|
||||
// The peer side has not received the handshake message, so it keeps querying
|
||||
@@ -9483,7 +9483,7 @@ void srt::CUDT::processCtrl(const CPacket &ctrlpkt)
|
||||
// int err_type = packet.getAddInfo();
|
||||
|
||||
// currently only this error is signalled from the peer side
|
||||
// if recvfile() failes (e.g., due to disk fail), blcoked sendfile/send should return immediately
|
||||
// if recvfile() fails (e.g., due to disk fail), blocked sendfile/send should return immediately
|
||||
// giving the app a chance to fix the issue
|
||||
m_bPeerHealth = false;
|
||||
|
||||
@@ -9611,7 +9611,7 @@ void srt::CUDT::updateAfterSrtHandshake(int hsv)
|
||||
std::pair<int32_t, int> srt::CUDT::getCleanRexmitOffset()
|
||||
{
|
||||
// This function is required to look into the loss list and
|
||||
// drop all sequences that are alrady revoked from the sender
|
||||
// drop all sequences that are already revoked from the sender
|
||||
// buffer, send the drop request if needed, and return the sender
|
||||
// buffer offset for the next packet to retransmit, or -1 if
|
||||
// there is no retransmission candidate at the moment.
|
||||
@@ -9686,7 +9686,7 @@ std::pair<int32_t, int> srt::CUDT::getCleanRexmitOffset()
|
||||
if (seq == SRT_SEQNO_NONE)
|
||||
return std::make_pair(SRT_SEQNO_NONE, -1);
|
||||
|
||||
// For the right sequence though check also the rigt time.
|
||||
// For the right sequence though check also the right time.
|
||||
const steady_clock::time_point time_now = steady_clock::now();
|
||||
if (!checkRexmitRightTime(offset, time_now))
|
||||
{
|
||||
@@ -10016,7 +10016,7 @@ void srt::CUDT::setDataPacketTS(CPacket& p, const time_point& ts)
|
||||
|
||||
bool srt::CUDT::isRegularSendingPriority()
|
||||
{
|
||||
// In order to have regular packets take precedense over retransmitted:
|
||||
// In order to have regular packets take precedence over retransmitted:
|
||||
// - SRTO_TLPKTDROP = true
|
||||
// - SRTO_MESSAGEAPI = true
|
||||
// NOTE:
|
||||
@@ -10035,7 +10035,7 @@ bool srt::CUDT::isRegularSendingPriority()
|
||||
// might be better in some situations. For example, it should be acceptable
|
||||
// that a packet that has very little time to be recovered is sent before a
|
||||
// regular packet that has still STT + Latency time to deliver. The regular
|
||||
// packets should still be favorized, but not necessarily at the expence of
|
||||
// packets should still be favored, but not necessarily at the expense of
|
||||
// dismissing a recovery chance that wouldn't endanger the delivery of a regular
|
||||
// packet. Criteria might be various, for example, the number of scheduled
|
||||
// packets and their late delivery time might be taken into account.
|
||||
@@ -10508,7 +10508,7 @@ void srt::CUDT::sendLossReport(const std::vector<std::pair<int32_t, int32_t> > &
|
||||
bool srt::CUDT::overrideSndSeqNo(int32_t seq)
|
||||
{
|
||||
// This function is intended to be called from the socket
|
||||
// group management functions to synchronize the sequnece in
|
||||
// group management functions to synchronize the sequence in
|
||||
// all sockes in the bonding group. THIS sequence given
|
||||
// here is the sequence TO BE STAMPED AT THE EXACTLY NEXT
|
||||
// sent payload. Therefore, screw up the ISN to exactly this
|
||||
@@ -10997,7 +10997,7 @@ int srt::CUDT::processData(CUnit* in_unit)
|
||||
// this socket as member (that is, 'gi' cannot be a dangling pointer).
|
||||
if (gi != NULL)
|
||||
{
|
||||
if (gi->rcvstate < SRT_GST_RUNNING) // PENDING or IDLE, tho PENDING is unlikely
|
||||
if (gi->rcvstate < SRT_GST_RUNNING) // PENDING or IDLE, though PENDING is unlikely
|
||||
{
|
||||
HLOGC(qrlog.Debug,
|
||||
log << CONID() << "processData: IN-GROUP rcv state transition " << srt_log_grp_state[gi->rcvstate]
|
||||
@@ -11175,7 +11175,7 @@ int srt::CUDT::processData(CUnit* in_unit)
|
||||
// If so, send the loss report and remove this element.
|
||||
// - Since the first element that has TTL>0, iterate until the end of container and decrease TTL.
|
||||
//
|
||||
// This will be efficient becase the loop to increment one field (without any condition check)
|
||||
// This will be efficient because the loop to increment one field (without any condition check)
|
||||
// can be quite well optimized.
|
||||
|
||||
vector<int32_t> lossdata;
|
||||
@@ -11598,7 +11598,7 @@ int srt::CUDT::processConnectRequest(const sockaddr_any& addr, CPacket& packet)
|
||||
return m_RejectReason;
|
||||
}
|
||||
|
||||
// Dunno why the original UDT4 code only MUCH LATER was checking if the packet was UMSG_HANDSHAKE.
|
||||
// Don't know why the original UDT4 code only MUCH LATER was checking if the packet was UMSG_HANDSHAKE.
|
||||
// It doesn't seem to make sense to deserialize it into the handshake structure if we are not
|
||||
// sure that the packet contains the handshake at all!
|
||||
if (!packet.isControl(UMSG_HANDSHAKE))
|
||||
|
||||
+3
-3
@@ -313,7 +313,7 @@ class CUDT
|
||||
typedef sync::AtomicClock<sync::steady_clock> atomic_time_point;
|
||||
typedef sync::AtomicDuration<sync::steady_clock> atomic_duration;
|
||||
|
||||
private: // constructor and desctructor
|
||||
private: // constructor and destructor
|
||||
void construct();
|
||||
void clearData();
|
||||
CUDT(CUDTSocket* parent);
|
||||
@@ -1225,10 +1225,10 @@ private: // Generation and processing of packets
|
||||
/// Forms and sends ACK packet
|
||||
/// @note Assumes @ctrlpkt already has a timestamp.
|
||||
///
|
||||
/// @param ctrlpkt A control packet structure to fill. It must have a timestemp already set.
|
||||
/// @param ctrlpkt A control packet structure to fill. It must have a timestamp already set.
|
||||
/// @param size Sends lite ACK if size is SEND_LITE_ACK, Full ACK otherwise
|
||||
///
|
||||
/// @returns the nmber of packets sent.
|
||||
/// @returns the number of packets sent.
|
||||
int sendCtrlAck(CPacket& ctrlpkt, int size);
|
||||
void sendLossReport(const std::vector< std::pair<int32_t, int32_t> >& losslist);
|
||||
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@ void srt::CCryptoControl::globalInit()
|
||||
{
|
||||
#ifdef SRT_ENABLE_ENCRYPTION
|
||||
// We need to force the Cryspr to be initialized during startup to avoid the
|
||||
// possibility of multiple threads initialzing the same static data later on.
|
||||
// possibility of multiple threads initializing the same static data later on.
|
||||
HaiCryptCryspr_Get_Instance();
|
||||
#endif
|
||||
}
|
||||
@@ -872,7 +872,7 @@ srt::EncryptionStatus srt::CCryptoControl::decrypt(CPacket& w_packet SRT_ATR_UNU
|
||||
// If not "secured", it means that it won't be able to decrypt packets,
|
||||
// so there's no point to even try to send them to HaiCrypt_Rx_Data.
|
||||
// Actually the current conditions concerning m_hRcvCrypto are such that this object
|
||||
// is cretaed in case of SRT_KM_S_BADSECRET, so it will simply fail to decrypt,
|
||||
// is created in case of SRT_KM_S_BADSECRET, so it will simply fail to decrypt,
|
||||
// but with SRT_KM_S_NOSECRET m_hRcvCrypto is not even created (is NULL), which
|
||||
// will then cause an error to be reported, misleadingly. Simply don't try to
|
||||
// decrypt anything as long as you are not sure that the connection is secured.
|
||||
|
||||
+1
-1
@@ -486,7 +486,7 @@ int srt::CEPoll::setflags(const int eid, int32_t flags)
|
||||
|
||||
int srt::CEPoll::uwait(const int eid, SRT_EPOLL_EVENT* fdsSet, int fdsSize, int64_t msTimeOut)
|
||||
{
|
||||
// It is allowed to call this function witn fdsSize == 0
|
||||
// It is allowed to call this function with fdsSize == 0
|
||||
// and therefore also NULL fdsSet. This will then only report
|
||||
// the number of ready sockets, just without information which.
|
||||
if (fdsSize < 0 || (fdsSize > 0 && !fdsSet))
|
||||
|
||||
+4
-4
@@ -157,7 +157,7 @@ std::string DisplayEpollWatch();
|
||||
ewatch_t m_USockWatchState;
|
||||
|
||||
/// Objects representing changes in SRT sockets.
|
||||
/// Objects are removed from here when an event is registerred as edge-triggered.
|
||||
/// Objects are removed from here when an event is registered as edge-triggered.
|
||||
/// Otherwise it is removed only when all events as per subscription
|
||||
/// are no longer on.
|
||||
enotice_t m_USockEventNotice;
|
||||
@@ -429,7 +429,7 @@ public: // for CUDTUnited API
|
||||
/// @param d the internal structure of the epoll container
|
||||
/// @param st output container for the results: { socket_type, event }
|
||||
/// @param msTimeOut timeout after which return with empty output is allowed
|
||||
/// @param report_by_exception if true, errors will result in exception intead of returning -1
|
||||
/// @param report_by_exception if true, errors will result in exception instead of returning -1
|
||||
/// @retval -1 error occurred
|
||||
/// @retval >=0 number of ready sockets (actually size of `st`)
|
||||
int swait(CEPollDesc& d, fmap_t& st, int64_t msTimeOut, bool report_by_exception = true);
|
||||
@@ -438,7 +438,7 @@ public: // for CUDTUnited API
|
||||
bool empty(const CEPollDesc& d) const;
|
||||
|
||||
/// Reports which events are ready on the given socket.
|
||||
/// @param mp socket event map retirned by `swait`
|
||||
/// @param mp socket event map returned by `swait`
|
||||
/// @param sock which socket to ask
|
||||
/// @return event flags for given socket, or 0 if none
|
||||
static int ready(const fmap_t& mp, SRTSOCKET sock)
|
||||
@@ -450,7 +450,7 @@ public: // for CUDTUnited API
|
||||
}
|
||||
|
||||
/// Reports whether socket is ready for given event.
|
||||
/// @param mp socket event map retirned by `swait`
|
||||
/// @param mp socket event map returned by `swait`
|
||||
/// @param sock which socket to ask
|
||||
/// @param event which events it should be ready for
|
||||
/// @return true if the given socket is ready for given event
|
||||
|
||||
+2
-2
@@ -297,7 +297,7 @@ void FECFilterBuiltin::ConfigureColumns(Container& which, int32_t isn)
|
||||
size_t zero = which.size();
|
||||
|
||||
// The first series of initialization should embrace:
|
||||
// - if multiplyer == 1, EVERYTHING (also the case of SOLID matrix)
|
||||
// - if multiplayer == 1, EVERYTHING (also the case of SOLID matrix)
|
||||
// - if more, ONLY THE FIRST SQUARE.
|
||||
which.resize(zero + numberCols());
|
||||
|
||||
@@ -891,7 +891,7 @@ bool FECFilterBuiltin::receive(const CPacket& rpkt, loss_seqs_t& loss_seqs)
|
||||
HLOGC(pflog.Debug, log << "FEC: HangVertical %" << rpkt.getSeqNo()
|
||||
<< " msgno=" << rpkt.getMsgSeq()
|
||||
<< " RESULT=" << hangname[okh]
|
||||
<< (discrep ? " IPE: H successul and V failed!" : "")
|
||||
<< (discrep ? " IPE: H successful and V failed!" : "")
|
||||
<< " IRRECOVERABLE: " << Printable(irrecover_col));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -132,10 +132,10 @@ private:
|
||||
|
||||
// Base index at the oldest column platform determines
|
||||
// the base index of the queue. Meaning, first you need
|
||||
// to determnine the column index, where the index 0 is
|
||||
// to determine the column index, where the index 0 is
|
||||
// the fistmost element of this queue. After determining
|
||||
// the column index, there must be also a second factor
|
||||
// deteremined - which column series it is. So, this can
|
||||
// determined - which column series it is. So, this can
|
||||
// start by extracting the base sequence of the element
|
||||
// at the index column. This is the series 0. Now, the
|
||||
// distance between these two sequences, divided by
|
||||
|
||||
+10
-10
@@ -90,7 +90,7 @@ bool CUDTGroup::applyGroupSequences(SRTSOCKET target, int32_t& w_snd_isn, int32_
|
||||
|
||||
// NOTE: the groupwise scheduling sequence might have been set
|
||||
// already. If so, it means that it was set by either:
|
||||
// - the call of this function on the very first conencted socket (see below)
|
||||
// - the call of this function on the very first connected socket (see below)
|
||||
// - the call to `sendBroadcast` or `sendBackup`
|
||||
// In both cases, we want THIS EXACTLY value to be reported
|
||||
if (m_iLastSchedSeqNo != -1)
|
||||
@@ -205,7 +205,7 @@ void CUDTGroup::debugMasterData(SRTSOCKET slave)
|
||||
else
|
||||
{
|
||||
// The returned master_st is the master's start time. Calculate the
|
||||
// differene time.
|
||||
// difference time.
|
||||
IF_LOGGING(steady_clock::duration master_tdiff = m_tsStartTime - start_time);
|
||||
LOGC(cnlog.Debug, log << CONID() << "FOUND GROUP MASTER LINK: peer=$" << mpeer
|
||||
<< " - start time diff: " << FormatDuration<DUNIT_S>(master_tdiff));
|
||||
@@ -595,7 +595,7 @@ void CUDTGroup::deriveSettings(CUDT* u)
|
||||
IM(SRTO_RCVLATENCY, iRcvLatency);
|
||||
IM(SRTO_PEERLATENCY, iPeerLatency);
|
||||
IM(SRTO_SNDDROPDELAY, iSndDropDelay);
|
||||
// Special handling of SRTO_PAYLOADSIZE becuase API stores the value as int32_t,
|
||||
// Special handling of SRTO_PAYLOADSIZE because API stores the value as int32_t,
|
||||
// while the config structure stores it as size_t.
|
||||
importTrivialOption(m_config, SRTO_PAYLOADSIZE, (int)u->m_config.zExpPayloadSize);
|
||||
IMF(SRTO_TLPKTDROP, m_bTLPktDrop);
|
||||
@@ -905,7 +905,7 @@ void CUDTGroup::getOpt(SRT_SOCKOPT optname, void* pw_optval, int& w_optlen)
|
||||
return;
|
||||
}
|
||||
|
||||
// Found a value set on or derived by a group. Prefer returing it over the one taken from a member socket.
|
||||
// Found a value set on or derived by a group. Prefer returning it over the one taken from a member socket.
|
||||
// Check the size first.
|
||||
if (w_optlen < int(i->value.size()))
|
||||
throw CUDTException(MJ_NOTSUP, MN_XSIZE, 0);
|
||||
@@ -935,7 +935,7 @@ SRT_KM_STATE CUDTGroup::getGroupEncryptionState()
|
||||
// no password, but peer did, and ENFORCEDENCRYPTION=false allowed
|
||||
// this connection to be established. UNSECURED can't be taken in this
|
||||
// case because this would suggest that BOTH are unsecured, that is,
|
||||
// we have established an unsecured connection (which ain't true).
|
||||
// we have established an unsecured connection (which is not true).
|
||||
if (gst == SRT_KM_S_UNSECURED && cc->m_SndKmState == SRT_KM_S_NOSECRET)
|
||||
gst = SRT_KM_S_NOSECRET;
|
||||
kmstates.insert(gst);
|
||||
@@ -1150,7 +1150,7 @@ void CUDTGroup::close()
|
||||
// Release blocked clients
|
||||
// XXX This looks like a dead code. Group receiver functions
|
||||
// do not use any lock on m_RcvDataLock, it is likely a remainder
|
||||
// of the old, internal impementation.
|
||||
// of the old, internal implementation.
|
||||
// CSync::lock_notify_one(m_RcvDataCond, m_RcvDataLock);
|
||||
}
|
||||
|
||||
@@ -2976,7 +2976,7 @@ CUDTGroup::BackupMemberState CUDTGroup::sendBackup_QualifyActiveState(const gli_
|
||||
const int64_t probing_period_us = initial_stabtout_us + 5 * CUDT::COMM_SYN_INTERVAL_US;
|
||||
|
||||
// RTT and RTTVar values are still being refined during the probing period,
|
||||
// therefore the dymanic timeout should not be used during the probing period.
|
||||
// therefore the dynamic timeout should not be used during the probing period.
|
||||
const bool is_activation_phase = !is_zero(u.freshActivationStart())
|
||||
&& (count_microseconds(currtime - u.freshActivationStart()) <= probing_period_us);
|
||||
|
||||
@@ -3511,7 +3511,7 @@ void CUDTGroup::sendBackup_RetryWaitBlocked(SendBackupCtx& w_sendBackupCtx
|
||||
if ((num_unstable + num_wary + num_pending == 0) || !w_none_succeeded)
|
||||
return;
|
||||
|
||||
HLOGC(gslog.Debug, log << "grp/sendBackup: no successfull sending: "
|
||||
HLOGC(gslog.Debug, log << "grp/sendBackup: no successful sending: "
|
||||
<< (num_unstable + num_wary) << " unstable links, "
|
||||
<< num_pending << " pending - waiting to retry sending...");
|
||||
|
||||
@@ -3699,7 +3699,7 @@ void CUDTGroup::sendBackup_SilenceRedundantLinks(SendBackupCtx& w_sendBackupCtx,
|
||||
{
|
||||
// The most important principle is to keep the data being sent constantly,
|
||||
// even if it means temporarily full redundancy.
|
||||
// A member can be silenced only if there is at least one stable memebr.
|
||||
// A member can be silenced only if there is at least one stable member.
|
||||
const unsigned num_stable = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_STABLE);
|
||||
if (num_stable == 0)
|
||||
return;
|
||||
@@ -4183,7 +4183,7 @@ void CUDTGroup::processKeepalive(CUDTGroup::SocketData* gli)
|
||||
// the sequence per being IDLE and empty buffer), so a large portion of initial
|
||||
// series of packets may come with past sequence, delaying this way with ACK,
|
||||
// which may result not only with exceeded stability timeout (which fortunately
|
||||
// isn't being measured in this case), but also with receiveing keepalive
|
||||
// isn't being measured in this case), but also with receiving keepalive
|
||||
// (therefore we also don't reset the link to IDLE in the temporary activation period).
|
||||
if (gli->sndstate == SRT_GST_RUNNING && is_zero(gli->ps->core().m_tsFreshActivation))
|
||||
{
|
||||
|
||||
+3
-3
@@ -223,7 +223,7 @@ private:
|
||||
bool send_CheckIdle(const gli_t d, std::vector<SRTSOCKET>& w_wipeme, std::vector<SRTSOCKET>& w_pendingLinks);
|
||||
|
||||
|
||||
/// This function checks if the member has just become idle (check if sender buffer is empty) to send a KEEPALIVE immidiatelly.
|
||||
/// This function checks if the member has just become idle (check if sender buffer is empty) to send a KEEPALIVE immediately.
|
||||
/// @todo Check it is some abandoned logic.
|
||||
void sendBackup_CheckIdleTime(gli_t w_d);
|
||||
|
||||
@@ -247,11 +247,11 @@ private:
|
||||
/// @param[in,out] w_mc message control
|
||||
/// @param[in] currtime current time
|
||||
/// @param[in] currseq current packet sequence number
|
||||
/// @param[out] w_nsuccessful number of members with successfull sending.
|
||||
/// @param[out] w_nsuccessful number of members with successful sending.
|
||||
/// @param[in,out] maxActiveWeight
|
||||
/// @param[in,out] sendBackupCtx context
|
||||
/// @param[in,out] w_cx error
|
||||
/// @return group send result: -1 if sending over all members has failed; number of bytes sent overwise.
|
||||
/// @return group send result: -1 if sending over all members has failed; number of bytes sent otherwise.
|
||||
int sendBackup_SendOverActive(const char* buf, int len, SRT_MSGCTRL& w_mc, const steady_clock::time_point& currtime, int32_t& w_curseq,
|
||||
size_t& w_nsuccessful, uint16_t& w_maxActiveWeight, SendBackupCtx& w_sendBackupCtx, CUDTException& w_cx);
|
||||
|
||||
|
||||
@@ -92,13 +92,13 @@ namespace groups
|
||||
|
||||
/// @brief Adds or updates a record of the member socket state.
|
||||
/// @param pSocketDataIt Iterator to a socket
|
||||
/// @param st State of the memmber socket
|
||||
/// @param st State of the member socket
|
||||
/// @todo Implement updating member state
|
||||
void recordMemberState(SocketData* pSocketDataIt, BackupMemberState st);
|
||||
|
||||
/// @brief Updates a record of the member socket state.
|
||||
/// @param pSocketDataIt Iterator to a socket
|
||||
/// @param st State of the memmber socket
|
||||
/// @param st State of the member socket
|
||||
/// @todo To be replaced by recordMemberState
|
||||
/// @todo Update max weights?
|
||||
void updateMemberState(const SocketData* pSocketDataIt, BackupMemberState st);
|
||||
|
||||
+1
-1
@@ -740,7 +740,7 @@ int32_t srt::CRcvLossList::removeUpTo(int32_t seqno_last)
|
||||
|
||||
if (CSeqNo::seqcmp(seqno_last, first) < 0)
|
||||
{
|
||||
//HLOGC(tslog.Debug, log << "rcv-loss: DROP to %" << seqno_last << " - first %" << first << " is newer, exitting");
|
||||
//HLOGC(tslog.Debug, log << "rcv-loss: DROP to %" << seqno_last << " - first %" << first << " is newer, exiting");
|
||||
return first; // seqno_last older than first - nothing to remove
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
/// Insert a series of loss seq. no. between "seqno1" and "seqno2" into the receiver's loss list.
|
||||
/// @param [in] seqno1 sequence number starts.
|
||||
/// @param [in] seqno2 seqeunce number ends.
|
||||
/// @param [in] seqno2 sequence number ends.
|
||||
/// @return length of the loss record inserted (seqlen(seqno1, seqno2)), -1 on error.
|
||||
int insert(int32_t seqno1, int32_t seqno2);
|
||||
|
||||
|
||||
+4
-4
@@ -110,7 +110,7 @@ modified by
|
||||
// Control Info: None
|
||||
// 2: Acknowledgement (UMSG_ACK)
|
||||
// Add. Info: The ACK sequence number
|
||||
// Control Info: The sequence number to which (but not include) all the previous packets have beed received
|
||||
// Control Info: The sequence number to which (but not include) all the previous packets have been received
|
||||
// Optional: RTT
|
||||
// RTT Variance
|
||||
// available receiver buffer size (in bytes)
|
||||
@@ -131,7 +131,7 @@ modified by
|
||||
// 7: Message Drop Request (UMSG_DROPREQ)
|
||||
// Add. Info: Message ID
|
||||
// Control Info: first sequence number of the message
|
||||
// last seqeunce number of the message
|
||||
// last sequence number of the message
|
||||
// 8: Error Signal from the Peer Side (UMSG_PEERERROR)
|
||||
// Add. Info: Error code
|
||||
// Control Info: None
|
||||
@@ -151,7 +151,7 @@ modified by
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
//
|
||||
// Loss List Field Coding:
|
||||
// For any consecutive lost seqeunce numbers that the differnece between
|
||||
// For any consecutive lost sequence numbers that the difference between
|
||||
// the last and first is more than 1, only record the first (a) and the
|
||||
// the last (b) sequence numbers in the loss list field, and modify the
|
||||
// the first bit of a to 1.
|
||||
@@ -174,7 +174,7 @@ using namespace srt_logging;
|
||||
|
||||
namespace srt {
|
||||
|
||||
// Set up the aliases in the constructure
|
||||
// Set up the aliases in the constructor
|
||||
CPacket::CPacket()
|
||||
: m_nHeader() // Silences GCC 12 warning "used uninitialized".
|
||||
, m_extra_pad()
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ namespace srt
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// The purpose of the IOVector class is to proide a platform-independet interface
|
||||
// to the WSABUF on Windows and iovec on Linux, that can be easilly converted
|
||||
// to the WSABUF on Windows and iovec on Linux, that can be easily converted
|
||||
// to the native structure for use in WSARecvFrom() and recvmsg(...) functions
|
||||
class IOVector
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
// Copy constructor - important when listener-spawning
|
||||
// Things being done:
|
||||
// 1. The filter is individual, so don't copy it. Set NULL.
|
||||
// 2. This will be configued anyway basing on possibly a new rule set.
|
||||
// 2. This will be configured anyway basing on possibly a new rule set.
|
||||
PacketFilter(const PacketFilter& source SRT_ATR_UNUSED): m_filter(), m_parent(), m_sndctlpkt(0), m_unitq() {}
|
||||
|
||||
// This function will be called by the parent CUDT
|
||||
|
||||
+2
-2
@@ -1559,7 +1559,7 @@ srt::EConnectStatus srt::CRcvQueue::worker_TryAsyncRend_OrStore(int32_t id, CUni
|
||||
// side just started sending its handshake packets, the local side has already
|
||||
// run the CRcvQueue::worker thread, and this worker thread is trying to dispatch
|
||||
// the handshake packet too early, before the dispatcher has a chance to see
|
||||
// this socket registerred in the RendezvousQueue, which causes the packet unable
|
||||
// this socket registered in the RendezvousQueue, which causes the packet unable
|
||||
// to be dispatched. Therefore simply treat every "out of band" packet (with socket
|
||||
// not belonging to the connection and not registered as rendezvous) as "possible
|
||||
// attack" and ignore it. This also should better protect the rendezvous socket
|
||||
@@ -1620,7 +1620,7 @@ srt::EConnectStatus srt::CRcvQueue::worker_TryAsyncRend_OrStore(int32_t id, CUni
|
||||
// that we KNOW (by the cst == CONN_ACCEPT result) that the socket should be inserted
|
||||
// into the pending anteroom.
|
||||
|
||||
CUDT* ne = getNewEntry(); // This function actuall removes the entry and returns it.
|
||||
CUDT* ne = getNewEntry(); // This function actually removes the entry and returns it.
|
||||
// This **should** now always return a non-null value, but check it first
|
||||
// because if this accidentally isn't true, the call to worker_ProcessAddressedPacket will
|
||||
// result in redirecting it to here and so on until the call stack overflow. In case of
|
||||
|
||||
+2
-2
@@ -339,7 +339,7 @@ public:
|
||||
|
||||
/// @brief Update status of connections in the pending queue.
|
||||
/// Stop connecting if TTL expires. Resend handshake request every 250 ms if no response from the peer.
|
||||
/// @param rst result of reading from a UDP socket: received packet / nothin read / read error.
|
||||
/// @param rst result of reading from a UDP socket: received packet / nothing read / read error.
|
||||
/// @param cst target status for pending connection: reject or proceed.
|
||||
/// @param pktIn packet received from the UDP socket.
|
||||
void updateConnStatus(EReadStatus rst, EConnectStatus cst, CUnit* unit);
|
||||
@@ -368,7 +368,7 @@ private:
|
||||
/// - Sockets with expired TTL go to the 'to_remove' list and removed from the queue straight away.
|
||||
/// - If HS request is to be resent (resend 250 ms if no response from the peer) go to the 'to_process' list.
|
||||
///
|
||||
/// @param rst result of reading from a UDP socket: received packet / nothin read / read error.
|
||||
/// @param rst result of reading from a UDP socket: received packet / nothing read / read error.
|
||||
/// @param cst target status for pending connection: reject or proceed.
|
||||
/// @param iDstSockID destination socket ID of the received packet.
|
||||
/// @param[in,out] toRemove stores sockets with expired TTL.
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace srt
|
||||
{
|
||||
int RcvBufferSizeOptionToValue(int val, int flightflag, int mss)
|
||||
{
|
||||
// Mimimum recv buffer size is 32 packets
|
||||
// Minimum recv buffer size is 32 packets
|
||||
const int mssin_size = mss - CPacket::UDP_HDR_SIZE;
|
||||
|
||||
int bufsize;
|
||||
@@ -1025,7 +1025,7 @@ bool CSrtConfig::payloadSizeFits(size_t val, int /*ip_family*/, std::string& w_e
|
||||
}
|
||||
}
|
||||
|
||||
// Not checking AUTO to allow defaul 1456 bytes.
|
||||
// Not checking AUTO to allow default 1456 bytes.
|
||||
if ((this->iCryptoMode == CSrtConfig::CIPHER_MODE_AES_GCM)
|
||||
&& (val > (SRT_LIVE_MAX_PLSIZE - HAICRYPT_AUTHTAG_MAX)))
|
||||
{
|
||||
@@ -1089,7 +1089,7 @@ bool SRT_SocketOptionObject::add(SRT_SOCKOPT optname, const void* optval, size_t
|
||||
|
||||
// Header size will get the size likely aligned, but it won't
|
||||
// hurt if the memory size will be up to 4 bytes more than
|
||||
// needed - and it's better to not risk that alighment rules
|
||||
// needed - and it's better to not risk that alignment rules
|
||||
// will make these calculations result in less space than needed.
|
||||
const size_t headersize = sizeof(SingleOption);
|
||||
const size_t payload = std::max(sizeof(uint32_t), optlen);
|
||||
|
||||
@@ -93,7 +93,7 @@ struct CSrtMuxerConfig
|
||||
int iUDPSndBufSize; // UDP sending buffer size
|
||||
int iUDPRcvBufSize; // UDP receiving buffer size
|
||||
|
||||
// NOTE: this operator is not reversable. The syntax must use:
|
||||
// NOTE: this operator is not reversible. The syntax must use:
|
||||
// muxer_entry == socket_entry
|
||||
bool isCompatWith(const CSrtMuxerConfig& other) const
|
||||
{
|
||||
@@ -212,7 +212,7 @@ struct CSrtConfig: CSrtMuxerConfig
|
||||
static const int COMM_RESPONSE_TIMEOUT_MS = 5 * 1000; // 5 seconds
|
||||
static const uint32_t COMM_DEF_MIN_STABILITY_TIMEOUT_MS = 60; // 60 ms
|
||||
|
||||
// Mimimum recv flight flag size is 32 packets
|
||||
// Minimum recv flight flag size is 32 packets
|
||||
static const int DEF_MIN_FLIGHT_PKT = 32;
|
||||
static const size_t MAX_SID_LENGTH = 512;
|
||||
static const size_t MAX_PFILTER_LENGTH = 64;
|
||||
@@ -339,7 +339,7 @@ struct CSrtConfig: CSrtMuxerConfig
|
||||
|
||||
// Default congestion is "live".
|
||||
// Available builtin congestions: "file".
|
||||
// Others can be registerred.
|
||||
// Others can be registered.
|
||||
sCongestion.set("live", 4);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -221,7 +221,7 @@ typedef enum SRT_SOCKOPT {
|
||||
SRTO_PAYLOADSIZE, // Maximum payload size sent in one UDP packet (0 if unlimited)
|
||||
SRTO_TRANSTYPE = 50, // Transmission type (set of options required for given transmission type)
|
||||
SRTO_KMREFRESHRATE, // After sending how many packets the encryption key should be flipped to the new key
|
||||
SRTO_KMPREANNOUNCE, // How many packets before key flip the new key is annnounced and after key flip the old one decommissioned
|
||||
SRTO_KMPREANNOUNCE, // How many packets before key flip the new key is announced and after key flip the old one decommissioned
|
||||
SRTO_ENFORCEDENCRYPTION, // Connection to be rejected or quickly broken when one side encryption set or bad password
|
||||
SRTO_IPV6ONLY, // IPV6_V6ONLY mode
|
||||
SRTO_PEERIDLETIMEO, // Peer-idle timeout (max time of silence heard from peer) in [ms]
|
||||
@@ -599,7 +599,7 @@ enum SRT_REJECT_REASON
|
||||
#define SRT_LOGFA_CONGEST 7 // cclog: Congestion control module
|
||||
#define SRT_LOGFA_PFILTER 8 // pflog: Packet filter module
|
||||
|
||||
#define SRT_LOGFA_API_CTRL 11 // aclog: API part for socket and library managmenet
|
||||
#define SRT_LOGFA_API_CTRL 11 // aclog: API part for socket and library management
|
||||
|
||||
#define SRT_LOGFA_QUE_CTRL 13 // qclog: Queue control activities
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ extern const char * SysStrError(int errnum, char * buf, size_t buflen)
|
||||
// 0 for success, otherwise it's:
|
||||
// - possibly -1 and the error code is in ::errno
|
||||
// - possibly the error code itself
|
||||
// The details of the errror are not interesting; simply
|
||||
// The details of the error are not interesting; simply
|
||||
// craft a fallback message in this case.
|
||||
if (strerror_r(errnum, buf, buflen) != 0)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ written by
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Ensures that we store the error in the buffer and return the bufer. */
|
||||
/* Ensures that we store the error in the buffer and return the buffer. */
|
||||
const char * SysStrError(int errnum, char * buf, size_t buflen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+1
-1
@@ -347,7 +347,7 @@ int srt::sync::genRandomInt(int minVal, int maxVal)
|
||||
#endif
|
||||
|
||||
// Map onto [minVal, maxVal].
|
||||
// Note. There is a minuscule probablity to get maxVal+1 as the result.
|
||||
// Note. There is a minuscule probability to get maxVal+1 as the result.
|
||||
// So we have to use long long to handle cases when maxVal = INT32_MAX.
|
||||
// Also we must check 'res' does not exceed maxVal,
|
||||
// which may happen if rand_0_1 = 1, even though the chances are low.
|
||||
|
||||
+5
-5
@@ -431,7 +431,7 @@ public:
|
||||
~Condition();
|
||||
public:
|
||||
/// These functions do not align with C++11 version. They are here hopefully as a temporal solution
|
||||
/// to avoud issues with static initialization of CV on windows.
|
||||
/// to avoid issues with static initialization of CV on windows.
|
||||
void init();
|
||||
void reset();
|
||||
void destroy();
|
||||
@@ -511,13 +511,13 @@ public:
|
||||
~SharedMutex();
|
||||
|
||||
public:
|
||||
/// Acquire the lock for writting purposes. Only one thread can acquire this lock at a time
|
||||
/// Acquire the lock for writing purposes. Only one thread can acquire this lock at a time
|
||||
/// Once it is locked, no reader can acquire it
|
||||
void lock();
|
||||
bool try_lock();
|
||||
void unlock();
|
||||
|
||||
/// Acquire the lock if no writter already has it. For read purpose only
|
||||
/// Acquire the lock if no writer already has it. For read purpose only
|
||||
/// Several readers can lock this at the same time.
|
||||
void lock_shared();
|
||||
bool try_lock_shared();
|
||||
@@ -547,7 +547,7 @@ inline void releaseMutex(SharedMutex&) {}
|
||||
|
||||
/// A version of std::scoped_lock<std::shared_mutex> (or lock_guard for C++11).
|
||||
/// We could have used the srt::sync::ScopedLock making it a template-based class.
|
||||
/// But in that case all usages would have to be specificed like ScopedLock<Mutex> in C++03.
|
||||
/// But in that case all usages would have to be specified like ScopedLock<Mutex> in C++03.
|
||||
class SRT_ATTR_SCOPED_CAPABILITY ExclusiveLock
|
||||
{
|
||||
public:
|
||||
@@ -856,7 +856,7 @@ public:
|
||||
|
||||
/// Wakes up waiting thread (sleep_until(..)) without
|
||||
/// changing the target waiting time to force a recheck
|
||||
/// of the current time in comparisson to the target time.
|
||||
/// of the current time in comparison to the target time.
|
||||
void tick();
|
||||
|
||||
private:
|
||||
|
||||
@@ -567,7 +567,7 @@ CUDTException& GetThreadLocalError()
|
||||
{
|
||||
// In POSIX version we take into account the possibility
|
||||
// of having an allocation error here. Therefore we need to
|
||||
// allow thie value to return NULL and have some fallback
|
||||
// allow this value to return NULL and have some fallback
|
||||
// for that case. The dynamic memory allocation failure should
|
||||
// be the only case as to why it is unable to get the pointer
|
||||
// to the error description.
|
||||
|
||||
@@ -266,7 +266,7 @@ void CTsbpdTime::updateBaseTime(uint32_t usPktTimestamp)
|
||||
// Check if timestamp is within the TSBPD_WRAP_PERIOD before reaching the MAX_TIMESTAMP.
|
||||
if (usPktTimestamp > (CPacket::MAX_TIMESTAMP - TSBPD_WRAP_PERIOD))
|
||||
{
|
||||
// Approching wrap around point, start wrap check period (if for packet delivery head)
|
||||
// Approaching wrap around point, start wrap check period (if for packet delivery head)
|
||||
m_bTsbPdWrapCheck = true;
|
||||
LOGC(tslog.Debug,
|
||||
log << "tsbpd wrap period begins with ts=" << usPktTimestamp
|
||||
|
||||
+3
-3
@@ -285,7 +285,7 @@ inline void ItoHLA(uint32_t* dst, const uint32_t* src, size_t size)
|
||||
// Usage: typedef Bits<leftmost, rightmost> MASKTYPE; // MASKTYPE is a name of your choice.
|
||||
//
|
||||
// With this defined, you can use the following members:
|
||||
// - MASKTYPE::mask - to get the int32_t value with bimask (used bits set to 1, others to 0)
|
||||
// - MASKTYPE::mask - to get the int32_t value with bitmask (used bits set to 1, others to 0)
|
||||
// - MASKTYPE::offset - to get the lowermost bit number, or number of bits to shift
|
||||
// - MASKTYPE::wrap(int value) - to create a bitset where given value is encoded in given bits
|
||||
// - MASKTYPE::unwrap(int bitset) - to extract an integer value from the bitset basing on mask definition
|
||||
@@ -1072,7 +1072,7 @@ public:
|
||||
// overdrift() should be read only immediately after update() returned
|
||||
// true. It will stay available with this value until the next time when
|
||||
// update() returns true, in which case the value will be cleared.
|
||||
// Therefore, after calling update() if it retuns true, you should read
|
||||
// Therefore, after calling update() if it returns true, you should read
|
||||
// overdrift() immediately an make some use of it. Next valid overdrift
|
||||
// will be then relative to every previous overdrift.
|
||||
//
|
||||
@@ -1215,7 +1215,7 @@ inline size_t safe_advance(It& it, size_t num, It end)
|
||||
return num; // will be effectively 0, if reached the required point, or >0, if end was by that number earlier
|
||||
}
|
||||
|
||||
// This is available only in C++17, dunno why not C++11 as it's pretty useful.
|
||||
// This is available only in C++17, don't know why not C++11 as it's pretty useful.
|
||||
template <class V, size_t N> inline
|
||||
ATR_CONSTEXPR size_t Size(const V (&)[N]) ATR_NOEXCEPT { return N; }
|
||||
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ int srt::CPktTimeWindowTools::getPktRcvSpeed_in(const int* window, int* replica,
|
||||
AccumulatePassFilterParallel<unsigned, unsigned long>(window, asize, filter, abytes,
|
||||
(sum), (count), (bytes));
|
||||
|
||||
// claculate speed, or return 0 if not enough valid value
|
||||
// calculate speed, or return 0 if not enough valid value
|
||||
if (count <= (asize/2))
|
||||
{
|
||||
w_bytesps = 0;
|
||||
|
||||
+1
-1
@@ -322,7 +322,7 @@ public:
|
||||
// Meaning: if the packet is fully packed, probe_case = timediff.
|
||||
// Otherwise the timediff will be "converted" to a time that a fully packed packet "would take",
|
||||
// provided the arrival time is proportional to the payload size and skipping
|
||||
// the ETH+IP+UDP+SRT header part elliminates the constant packet delivery time influence.
|
||||
// the ETH+IP+UDP+SRT header part eliminates the constant packet delivery time influence.
|
||||
//
|
||||
const size_t pktsz = pkt.getLength();
|
||||
m_aProbeWindow[m_iProbeWindowPtr] = pktsz ? int(timediff_times_pl_size / pktsz) : int(timediff);
|
||||
|
||||
+3
-3
@@ -209,11 +209,11 @@ private: // Storage and Virtual Method Table
|
||||
/// The state of the union after this call is unspecified, caller must ensure not to use src anymore.
|
||||
void(*destroy)(storage_union&) noexcept;
|
||||
|
||||
/// Copies the **inner** content of the src union into the yet unitialized dest union.
|
||||
/// Copies the **inner** content of the src union into the yet uninitialized dest union.
|
||||
/// As such, both inner objects will have the same state, but on separate memory locations.
|
||||
void(*copy)(const storage_union& src, storage_union& dest);
|
||||
|
||||
/// Moves the storage from src to the yet unitialized dest union.
|
||||
/// Moves the storage from src to the yet uninitialized dest union.
|
||||
/// The state of src after this call is unspecified, caller must ensure not to use src anymore.
|
||||
void(*move)(storage_union& src, storage_union& dest) noexcept;
|
||||
|
||||
@@ -251,7 +251,7 @@ private: // Storage and Virtual Method Table
|
||||
|
||||
static void swap(storage_union& lhs, storage_union& rhs) noexcept
|
||||
{
|
||||
// just exchage the storage pointers.
|
||||
// just exchange the storage pointers.
|
||||
std::swap(lhs.dynamic, rhs.dynamic);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -326,7 +326,7 @@ TEST(Bonding, CloseGroupAndSocket)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
if (srt_send(ss, buf, 1316) == -1)
|
||||
{
|
||||
std::cout << "[Sender] sending failure, exitting after sending " << n << " packets\n";
|
||||
std::cout << "[Sender] sending failure, exiting after sending " << n << " packets\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ TEST(Bonding, Options)
|
||||
EXPECT_NE(srt_setsockflag(grp, SRTO_PACKETFILTER, packet_filter.c_str(), (int)packet_filter.size()), SRT_ERROR);
|
||||
|
||||
// ================
|
||||
// Linger is an option of a trivial type, but differes from other integer-typed options.
|
||||
// Linger is an option of a trivial type, but differs from other integer-typed options.
|
||||
// Therefore checking it specifically.
|
||||
const linger l = {1, 10};
|
||||
srt_setsockflag(grp, SRTO_LINGER, &l, sizeof l);
|
||||
|
||||
@@ -25,7 +25,7 @@ protected:
|
||||
// SetUp() is run immediately before a test starts.
|
||||
void SetUp() override
|
||||
{
|
||||
// make_unique is unfortunatelly C++14
|
||||
// make_unique is unfortunately C++14
|
||||
m_unit_queue.reset(new CUnitQueue(m_buff_size_pkts, 1500));
|
||||
ASSERT_NE(m_unit_queue.get(), nullptr);
|
||||
|
||||
|
||||
+4
-4
@@ -592,7 +592,7 @@ protected:
|
||||
|
||||
ASSERT_NE(srt_epoll_wait(m_client_pollid, read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR);
|
||||
|
||||
@@ -603,7 +603,7 @@ protected:
|
||||
|
||||
char buffer[1316] = {1, 2, 3, 4};
|
||||
ASSERT_NE(srt_sendmsg(m_client_sock, buffer, sizeof buffer,
|
||||
-1, // infinit ttl
|
||||
-1, // infinite ttl
|
||||
true // in order must be set to true
|
||||
),
|
||||
SRT_ERROR);
|
||||
@@ -670,7 +670,7 @@ protected:
|
||||
ASSERT_NE(srt_epoll_wait(m_server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR );
|
||||
|
||||
@@ -697,7 +697,7 @@ protected:
|
||||
ASSERT_NE(srt_epoll_wait(m_server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR );
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
auto state = srt_getsockstate(server_sock);
|
||||
if (int(state) > int(SRTS_CONNECTED))
|
||||
{
|
||||
std::cout << "[T] Listener socket closed, exitting\n";
|
||||
std::cout << "[T] Listener socket closed, exiting\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
SRTSOCKET acp = srt_accept(server_sock, NULL, NULL);
|
||||
if (acp == SRT_INVALID_SOCK)
|
||||
{
|
||||
std::cout << "[T] Accept failed, so exitting\n";
|
||||
std::cout << "[T] Accept failed, so exiting\n";
|
||||
break;
|
||||
}
|
||||
srt_close(acp);
|
||||
|
||||
+4
-4
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
ASSERT_NE(srt_epoll_wait(m_client_pollid, read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR);
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
char buffer[1316] = {1, 2, 3, 4};
|
||||
ASSERT_NE(srt_sendmsg(m_caller_sock, buffer, sizeof buffer,
|
||||
-1, // infinit ttl
|
||||
-1, // infinite ttl
|
||||
true // in order must be set to true
|
||||
), SRT_ERROR);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ TEST_F(TestMuxer, IPv4_and_IPv6)
|
||||
ASSERT_NE(srt_epoll_wait(m_server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR );
|
||||
|
||||
@@ -177,7 +177,7 @@ TEST_F(TestMuxer, IPv4_and_IPv6)
|
||||
ASSERT_NE(srt_epoll_wait(m_server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR );
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ protected:
|
||||
|
||||
EXPECT_NE(srt_epoll_wait(client_pollid, read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR) << srt_getlasterror_str();
|
||||
|
||||
@@ -204,7 +204,7 @@ protected:
|
||||
|
||||
char buffer[1316] = {1, 2, 3, 4};
|
||||
EXPECT_NE(srt_sendmsg(client_sock, buffer, sizeof buffer,
|
||||
-1, // infinit ttl
|
||||
-1, // infinite ttl
|
||||
true // in order must be set to true
|
||||
),
|
||||
SRT_ERROR);
|
||||
@@ -324,7 +324,7 @@ protected:
|
||||
EXPECT_NE(srt_epoll_wait(server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
10000, // -1 is set for debuging purpose.
|
||||
10000, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR) << srt_getlasterror_str();
|
||||
|
||||
@@ -363,7 +363,7 @@ protected:
|
||||
EXPECT_NE(srt_epoll_wait(server_pollid,
|
||||
read, &rlen,
|
||||
write, &wlen,
|
||||
-1, // -1 is set for debuging purpose.
|
||||
-1, // -1 is set for debugging purpose.
|
||||
// in case of production we need to set appropriate value
|
||||
0, 0, 0, 0), SRT_ERROR) << srt_getlasterror_str();
|
||||
|
||||
|
||||
+2
-2
@@ -11,14 +11,14 @@ const int32_t CSeqNo::m_iMaxSeqNo;
|
||||
|
||||
TEST(CSeqNo, constants)
|
||||
{
|
||||
// Compare two seq#, considering the wraping.
|
||||
// Compare two seq#, considering the wrapping.
|
||||
EXPECT_EQ(CSeqNo::m_iMaxSeqNo, 0x7FFFFFFF);
|
||||
EXPECT_EQ(CSeqNo::m_iSeqNoTH, 0x3FFFFFFF);
|
||||
}
|
||||
|
||||
TEST(CSeqNo, seqcmp)
|
||||
{
|
||||
// Compare two seq#, considering the wraping.
|
||||
// Compare two seq#, considering the wrapping.
|
||||
EXPECT_EQ(CSeqNo::seqcmp(0x7FFFFFFF, 0x7FFFFFFF), 0);
|
||||
|
||||
// abs(seq1 - seq2) < 0x3FFFFFFF : seq1 - seq2
|
||||
|
||||
@@ -30,7 +30,7 @@ protected:
|
||||
// SetUp() is run immediately before a test starts.
|
||||
void SetUp() override
|
||||
{
|
||||
// make_unique is unfortunatelly C++14
|
||||
// make_unique is unfortunately C++14
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ void TestDefaultValues(SRTSOCKET s)
|
||||
|
||||
if (!(entry.flags & Flags::R))
|
||||
{
|
||||
// TODO: Check reading retuns an error.
|
||||
// TODO: Check reading returns an error.
|
||||
LOGD(cerr << "Skipping " << entry.optname << ": not readable.\n");
|
||||
continue; // The flag must be READABLE and WRITABLE for this.
|
||||
}
|
||||
|
||||
+14
-14
@@ -740,14 +740,14 @@ TEST(Sync, FormatTime)
|
||||
const string time4 = FormatTime(a + seconds_from(1));
|
||||
const string time5 = FormatTime(a + seconds_from(5));
|
||||
const string time6 = FormatTime(a + milliseconds_from(-4350));
|
||||
cerr << "Current time formated: " << time1 << endl;
|
||||
cerr << "Current time formatted: " << time1 << endl;
|
||||
const long long diff_2_1 = parse_time(time2) - parse_time(time1);
|
||||
cerr << "Same time formated again: " << time2 << " (" << diff_2_1 << " us)" << endl;
|
||||
print_timediff("Same time formated again: ", time2, time1);
|
||||
print_timediff("Time +500 ms formated: ", time3, time1);
|
||||
print_timediff("Time +1 sec formated: ", time4, time1);
|
||||
print_timediff("Time +5 sec formated: ", time5, time1);
|
||||
print_timediff("Time -4350 ms formated: ", time6, time1);
|
||||
cerr << "Same time formatted again: " << time2 << " (" << diff_2_1 << " us)" << endl;
|
||||
print_timediff("Same time formatted again: ", time2, time1);
|
||||
print_timediff("Time +500 ms formatted: ", time3, time1);
|
||||
print_timediff("Time +1 sec formatted: ", time4, time1);
|
||||
print_timediff("Time +5 sec formatted: ", time5, time1);
|
||||
print_timediff("Time -4350 ms formatted: ", time6, time1);
|
||||
|
||||
EXPECT_TRUE(time1 == time2);
|
||||
}
|
||||
@@ -782,14 +782,14 @@ TEST(Sync, FormatTimeSys)
|
||||
const string time4 = FormatTimeSys(a + seconds_from(1));
|
||||
const string time5 = FormatTimeSys(a + seconds_from(5));
|
||||
const string time6 = FormatTimeSys(a + milliseconds_from(-4350));
|
||||
cerr << "Current time formated: " << time1 << endl;
|
||||
cerr << "Current time formatted: " << time1 << endl;
|
||||
const long long diff_2_1 = parse_time(time2) - parse_time(time1);
|
||||
cerr << "Same time formated again: " << time2 << " (" << diff_2_1 << " us)" << endl;
|
||||
print_timediff("Same time formated again: ", time2, time1);
|
||||
print_timediff("Time +500 ms formated: ", time3, time1);
|
||||
print_timediff("Time +1 sec formated: ", time4, time1);
|
||||
print_timediff("Time +5 sec formated: ", time5, time1);
|
||||
print_timediff("Time -4350 ms formated: ", time6, time1);
|
||||
cerr << "Same time formatted again: " << time2 << " (" << diff_2_1 << " us)" << endl;
|
||||
print_timediff("Same time formatted again: ", time2, time1);
|
||||
print_timediff("Time +500 ms formatted: ", time3, time1);
|
||||
print_timediff("Time +1 sec formatted: ", time4, time1);
|
||||
print_timediff("Time +5 sec formatted: ", time5, time1);
|
||||
print_timediff("Time -4350 ms formatted: ", time6, time1);
|
||||
|
||||
EXPECT_TRUE(time1 == time2);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ struct Double
|
||||
Double(): d(0.0)
|
||||
{
|
||||
instance = ++sourceid;
|
||||
IF_HEAVY_LOGGING(cerr << "(Double/" << instance << ": empty costruction)\n");
|
||||
IF_HEAVY_LOGGING(cerr << "(Double/" << instance << ": empty construction)\n");
|
||||
}
|
||||
|
||||
Double(double dd): d(dd)
|
||||
|
||||
@@ -934,7 +934,7 @@ int main( int argc, char** argv )
|
||||
|
||||
if (!skip_flushing)
|
||||
{
|
||||
Verror("(DEBUG) EOF when reading file. Looping until the sending bufer depletes.\n");
|
||||
Verror("(DEBUG) EOF when reading file. Looping until the sending buffer depletes.\n");
|
||||
for (;;)
|
||||
{
|
||||
size_t still = tar->Still();
|
||||
@@ -1011,7 +1011,7 @@ void TestLogHandler(void* opaque, int level, const char* file, int line, const c
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// That's something weird that happens on Microsoft Visual Studio 2013
|
||||
// Trying to keep portability, while every version of MSVS is a different plaform.
|
||||
// Trying to keep portability, while every version of MSVS is a different platform.
|
||||
// On MSVS 2015 there's already a standard-compliant snprintf, whereas _snprintf
|
||||
// is available on backward compatibility and it doesn't work exactly the same way.
|
||||
#define snprintf _snprintf
|
||||
|
||||
@@ -274,7 +274,7 @@ int main( int argc, char** argv )
|
||||
|
||||
if (!skip_flushing)
|
||||
{
|
||||
Verror() << "(DEBUG) EOF when reading file. Looping until the sending bufer depletes.\n";
|
||||
Verror() << "(DEBUG) EOF when reading file. Looping until the sending buffer depletes.\n";
|
||||
for (;;)
|
||||
{
|
||||
size_t still = tar->Still();
|
||||
|
||||
@@ -436,7 +436,7 @@ void Help(string program)
|
||||
"The URIs specified as -i INPUT... will be used for input and therefore SRT for output,\n"
|
||||
"and in the other way around if you use -o OUTPUT...\n"
|
||||
"For every such URI you must specify additionally a parameter named 'id', which will be\n"
|
||||
"interperted by the application and used to set resource id on an SRT socket when connecting\n"
|
||||
"interpreted by the application and used to set resource id on an SRT socket when connecting\n"
|
||||
"or to match with the id extracted from the accepted socket of incoming connection.\n"
|
||||
"Example:\n"
|
||||
"\tSender: srt-multiplex srt://remhost:2000 -i udp://:5000?id=low udp://:6000?id=high\n"
|
||||
@@ -501,7 +501,7 @@ int main( int argc, char** argv )
|
||||
// Extra parameters:
|
||||
//
|
||||
// mode: caller/listener/rendezvous. Default: if host empty, listener, otherwise caller.
|
||||
// adapter: IP to select network device for listner or rendezvous. Default: for listener taken from host, otherwise 0.0.0.0
|
||||
// adapter: IP to select network device for listener or rendezvous. Default: for listener taken from host, otherwise 0.0.0.0
|
||||
// port: default=0. Used only for caller mode, sets the outgoing port number. If 0, system-selected (default behavior)
|
||||
//
|
||||
// Syntax cases for -i:
|
||||
@@ -511,7 +511,7 @@ int main( int argc, char** argv )
|
||||
//
|
||||
// Syntax cases for -o:
|
||||
//
|
||||
// EMPTY ARGS...: use 'output%.dat' file patter for every stream.
|
||||
// EMPTY ARGS...: use 'output%.dat' file pattern for every stream.
|
||||
// PATTERN (one argument that contains % somewhere): define the output file pattern
|
||||
// URI...: try to match the input stream to particular URI by 'name' parameter. If none matches, ignore.
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ int main( int argc, char** argv )
|
||||
|
||||
if (input_spec != "" && input_echoback)
|
||||
{
|
||||
cerr << "ERROR: input-echoback is treated as input specifcation, -i can't be specified together.\n";
|
||||
cerr << "ERROR: input-echoback is treated as input specification, -i can't be specified together.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ SrtMainLoop::SrtMainLoop(const string& srt_uri, bool input_echoback, const strin
|
||||
{
|
||||
// Initialize input medium and do not add SRT medium
|
||||
// to the output list, as this will be fed directly
|
||||
// by the data from this input medium in a spearate engine.
|
||||
// by the data from this input medium in a separate engine.
|
||||
Verb() << "Setting up input: " << input_spec;
|
||||
m_input_medium.Setup(Source::Create(input_spec), g_chunksize);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ MediaPacket SourceMedium::Extract()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't worry about the media status as long as you have somthing in the buffer.
|
||||
// Don't worry about the media status as long as you have something in the buffer.
|
||||
// Purge the buffer first, then worry about the other things.
|
||||
if (!running)
|
||||
{
|
||||
|
||||
@@ -1513,7 +1513,7 @@ void SrtCommon::UpdateGroupStatus(const SRT_SOCKGROUPDATA* grpdata, size_t grpda
|
||||
{
|
||||
// This happens when you passed too small array. Treat this as error and stop.
|
||||
cerr << "ERROR: broadcast group update reports " << grpdata_size
|
||||
<< " existing sockets, but app registerred only " << m_group_nodes.size() << endl;
|
||||
<< " existing sockets, but app registered only " << m_group_nodes.size() << endl;
|
||||
Error("Too many unpredicted sockets in the group");
|
||||
}
|
||||
|
||||
@@ -2251,7 +2251,7 @@ RETRY_READING:
|
||||
if (have_ready || have_connectors)
|
||||
{
|
||||
Verb() << "(still have: " << (have_ready ? "+" : "-") << "ready, "
|
||||
<< (have_connectors ? "+" : "-") << "conenctors).";
|
||||
<< (have_connectors ? "+" : "-") << "connectors).";
|
||||
goto RETRY_READING;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user