feat: S28.10 FreeRtosLwip TCP (octet-framed StreamSender over LwipRawTcpStream)#480
Conversation
… reconnects StreamSender reconnects only when Send returns false; it never Reads. On a graceful peer FIN (RecvCallback with NULL p) the adapter set Errored but left the pcb non-NULL, and Send guarded only on IsOpen — so tcp_write kept returning ERR_OK into a doomed half-closed connection and the sender never reconnected after the server recovered. Gate Send with a new intent-named predicate IsWritable (IsOpen && !Errored) so a post-FIN send fails, prompting StreamSender to close and reconnect on the next message. Read still runs while Errored (drain queued bytes, then close on EOF). Mirrors FreeRTOS-Plus-TCP's send-side closed-socket detection. Driven red->green by SendReturnsFalseAfterPeerFin (Tests/Lwip, 56 tests green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…RawTcpStream Wire a real RFC 6587 octet-framed SolidSyslogStreamSender over SolidSyslogLwipRawTcpStream into the SwitchingSender's TCP slot (TLS stays NullSender until S28.11). Shares the resolver + endpoint callbacks with UDP (syslog-ng oracle listens TCP on the same :5514); RtosSleep drives the bounded synchronous connect. Flip the advisory lwIP lane filter to (@udp or @tcp) — enables tcp_transport, tcp_reconnect, and the UDP->TCP switching_transport scenario. Oracle green: 11 features / 28 scenarios / 116 steps, 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 47 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. 📝 WalkthroughWalkthroughThis PR implements TCP transport support for the FreeRTOS + lwIP BDD target. It adds a peer-FIN send-gating predicate to the TCP stream adapter, wires a real octet-framed TCP sender into the BDD target's SwitchingSender, and updates documentation and CI configuration to reflect both UDP and TCP transport availability. ChangesTCP Transport Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1344 passed) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
…shift The IsWritable forward declaration shifted the existing 11.3 / 11.5 cast suppressions in SolidSyslogLwipRawTcpStream.c down one line (129->130, 138->139, 146->147), so cppcheck-misra re-fired previously-deviated findings. Re-anchored via scripts/misra_renumber.py --apply; the gate exits 0 again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1344 passed) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
Purpose
S28.10 (#473, epic E28) puts a real TCP transport on the
FreeRtosLwipBDDtarget: an RFC 6587 octet-framed
SolidSyslogStreamSenderoverSolidSyslogLwipRawTcpStream, proven on QEMU against the syslog-ng oracle —plain delivery, runtime UDP→TCP switching, and reconnect after a server outage.
Closes #473.
Change Description
main.c). Create aLwipRawTcpStream(connect timeout from theSOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MStunable;RtosSleepdrives the boundedsynchronous connect), a
LwipRawAddress, and aStreamSendersharing theresolver +
GetEndpoint/GetEndpointVersionwith UDP (the oracle listens TCPon the same
:5514). Wire it intoinners[BDD_TARGET_SWITCH_TCP]; the TLS slotstays
NullSenderuntil S28.11. Teardown destroys the stream sender + stream +address in order.
Platform/LwipRaw, Tier 2).tcp_reconnectsurfaced a realgap:
StreamSenderreconnects only whenSendreturns false (it neverReads), but on a graceful peer FIN the adapter setErroredwhile leaving thepcb non-NULL, and
Sendguarded only onIsOpen— sotcp_writekeptreturning
ERR_OKinto a half-closed connection and the sender neverreconnected. New intent-named predicate
LwipRawTcpStream_IsWritable(
IsOpen && !Errored) gatesSend;Readstill runs whileErroredto drainthen close. This matches FreeRTOS-Plus-TCP's send-side detection (why the +TCP
lane already passed the scenario). Driven red→green by a new unit test.
ci/docker-compose.bdd.yml). lwIP lane filter@udp and not @tcp …→(@udp or @tcp) and not @tls and not @mtls and not @store. Enablestcp_transport,tcp_reconnect, and the UDP→TCPswitching_transportscenario;
tcp_singletask(@windows_wip) and TCP→TLS (@tls) stay excluded.Test Evidence
Tests/Lwip/SolidSyslogLwipRawTcpStreamTest— addedSendReturnsFalseAfterPeerFin(red→green); 56 tests, 0 failures (built in thecpputest-freertoshost image, which setsLWIP_PATH).ci/docker-compose.bdd.yml, lwIP pair): 11 features / 28scenarios / 116 steps passed, 0 failed.
tcp_transport,tcp_reconnect, andthe UDP→TCP switch are green alongside the full UDP set; TLS/mTLS/store and the
1500-MTU scenario are correctly skipped (target
MAX_MESSAGE_SIZE=512).Areas Affected
Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStream.c(Tier 2) + its test —Send now fails on peer close. Benefits any lwIP-Raw TCP/TLS integrator, not just
this target.
Bdd/Targets/FreeRtosLwip/(Tier 3) — TCP wiring, README..github/compose — advisory lwIP lane scope. NoCore/change.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests