Skip to content

Upstream merge#17

Merged
datagutt merged 4 commits into
irlserver:belaboxfrom
Haivision:master
May 15, 2026
Merged

Upstream merge#17
datagutt merged 4 commits into
irlserver:belaboxfrom
Haivision:master

Conversation

@datagutt
Copy link
Copy Markdown
Member

@datagutt datagutt commented May 15, 2026

Summary by CodeRabbit

  • Documentation

    • Updated socket API error documentation with improved descriptions
    • Enhanced build configuration documentation for subproject integration
    • Refreshed build status badges in repository overview
  • Bug Fixes

    • Improved socket state validation logic
    • Enhanced logger safety for post-destruction scenarios
  • Tests

    • Added test coverage for socket listen functionality

Review Change Stack

ethouris and others added 4 commits March 30, 2026 10:34
* [BUG] Incorrect error code when srt_listen on closed socket

* Fixed API description

* Ask Codespell to ignore the TEST() macro.

* Replace few if statements by a switch statement.

* Status SRTS_NONEXIST throws MN_CLOSED instead of MN_ISUNBOUND

* Manage the rendez-vous case first

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
* [doc] Remove a badge (Travis)

* Update repology's badges

---------

Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
Co-authored-by: Mikołaj Małecki <mmalecki@haivision.com>
…ion (#3310)

* [BUG] Fixed a heavy-logging instruction that may crash on initialization

* Protect calls to logger functions by checking on src_config NULL

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
@datagutt datagutt merged commit bafd37c into irlserver:belabox May 15, 2026
0 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d070e9b-7836-4bd5-b401-2d683d269d1c

📥 Commits

Reviewing files that changed from the base of the PR and between 42acfa3 and 8e68635.

📒 Files selected for processing (9)
  • CMakeLists.txt
  • README.md
  • docs/API/API-functions.md
  • docs/build/build-options.md
  • scripts/codespell/codespell.cfg
  • srtcore/api.cpp
  • srtcore/common.cpp
  • srtcore/logging.h
  • test/test_connection_timeout.cpp

Walkthrough

This PR introduces three major functional changes: refactored listen() socket state validation with explicit state-machine dispatch, guarded CMake parent-project option imports behind an enable flag, and hardened LogDispatcher against post-destruction logging. Documentation and tests are updated accordingly.

Changes

Socket Listen Validation, CMake Guard, and Logging Safety Hardening

Layer / File(s) Summary
CMake Parent Option Import Control
CMakeLists.txt, docs/build/build-options.md
LIBSRT_ENABLE_IMPORT_VARIABLES flag now gates parent-scope option imports. When enabled, the flag unsets itself, applies CMP0077 NEW policy, and calls srt_import_parent_options(). Documentation clarifies the required set() snippet and scope behavior.
listen() Socket State Validation
srtcore/api.cpp, docs/API/API-functions.md
CUDTUnited::listen() refactored to validate socket state via switch dispatch: rejects rendezvous flag, transitions SRTS_OPENED→SRTS_LISTENING via setListenState(), permits backlog updates when already SRTS_LISTENING, and maps broken/closing/closed states to SRT_ESCLOSED. Error table updated with clarified SRT_ECONNSOCK and new SRT_ESCLOSED rows.
listen() Behavior Test
test/test_connection_timeout.cpp
New TEST(TestConnectionAPI, Listen) verifies listen behavior across socket bind, multiple listen calls, socket closure, error code validation, and error string retrieval via srt_strerror.
LogDispatcher Post-Destruction Safety
srtcore/logging.h, srtcore/common.cpp
LogDispatcher destructor clears src_config to NULL; CheckEnabled() null-checks src_config and returns false when unavailable. Header comments document global-only logger lifetime. Exception constructor logging disabled with explanatory comments.
Supporting Configuration Updates
README.md, scripts/codespell/codespell.cfg
README badge URLs updated to Fedora 43 and Ubuntu 26.04. Codespell config adds ignore-regex rule for TEST(\*) patterns.

Sequence Diagram(s)

Not applicable. Changes consist of state-machine refactoring, configuration gating, safety hardening, and documentation/test updates without novel multi-component interactions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A listen that knows what state it's in,
Options guarded before they begin,
LogDispatcher checks what's truly there,
Null pointers banished with careful care!
Test cases verify the flow so true,
SRT grows safer, solid and new. 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants