Skip to content

refactor(net): keep WriteAll awaits in explicit branches - #25

Merged
thweetkomputer merged 1 commit into
mainfrom
fix/writeall-explicit-await-20261029
Oct 29, 2026
Merged

thweetkomputer merged 1 commit into
mainfrom
fix/writeall-explicit-await-20261029

Conversation

@thweetkomputer

Copy link
Copy Markdown
Contributor

TcpStream::WriteAll embeds its TLS and plain co_await expressions in a conditional expression. Use explicit if/else statements to avoid relying on GCC's handling of coroutine temporaries in conditional expressions (GCC PR c++/102217, including duplicate 107854). The direct awaits introduced by #24 still avoid the forwarding WriteSome coroutine.

This is compatibility hardening: the original expression is valid C++, and a failure was not reproduced with GCC 13.3 or Clang 18.1.3. A nearby comment explains why the branches stay explicit. No architectural contract changes.

Validation on Ubuntu 24.04 AArch64:

  • GCC 13.3 and Clang 18.1.3 Debug builds: all 32 selected tests passed per compiler (26 runtime/network tests and six Task transfer/ownership tests), zero skips.
  • A temporary echo harness linked against each build exercised the real plain TCP and TLS paths with small, fragmented, and repeated 64 KiB payloads; each connection echoed 2,117,650 bytes correctly, and both servers shut down successfully.
  • clang-format 23.1.1 and git diff --check passed.

CTest command for each build:

ctest --test-dir <build-dir> -R '^bycorf_(TaskTransfer|RuntimeStartup|TcpServiceStop|Timer|Connect|ConnectionStorage|TcpBufferedRead|IoUringBackpressure)\.' --output-on-failure --no-tests=error

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bffe3652-4b5a-450c-9fec-a858e2d2ba71
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@thweetkomputer
thweetkomputer merged commit 33b4f48 into main Oct 29, 2026
10 checks passed
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.

1 participant