Repository navigation
cherry-pick: lwIP adapter (#452) and Redis rate limiting (#453) to main - #454
Merged
Merged
Conversation
…452) * feat(port): serve a CWIST app over lwIP's raw TCP API (#447 Phase 3) - include/cwist/sys/port/lwip.h + src/sys/port/lwip.c: a listener on a raw-API tcp_pcb (NO_SYS-safe). Requests are framed by Content-Length with the parser's CL/TE rules (501 for Transfer-Encoding, 400 for CL+TE or a bad/conflicting CL, 431/413 above the configured caps), answered with 100 Continue on Expect, parsed and run through cwist_app_dispatch, and serialized. Keep-alive follows request and response as on the socket path; pipelined requests are answered in order. Responses go out zero-copy via tcp_write and are freed once acknowledged; while one is in flight, excess input is refused back to lwIP so the window throttles the peer. Connection cap, idle timeout via tcp_poll, HEAD without body, SOF_REUSEADDR when SO_REUSE is on. - The adapter is compiled by the firmware next to its own lwIP and lwipopts.h; it uses only public CWIST API and is not part of libcwist. - lib/lwip: lwIP STABLE-2_2_1_RELEASE, vendored for the tests only. - tests/test_lwip_adapter.c (make test): real lwIP TCP over the loopback netif in one process, covering keep-alive, pipelining, split bodies, 100-continue, every framing error, Connection: close, HTTP/1.0, HEAD, a 20 KB response through a 2-segment send window, the connection cap, the idle timeout and teardown. Clean under ASan/UBSan/LSan. - tests/baremetal/hello_lwip.c joins make baremetal-smoke: the same stack on Cortex-M7 under qemu-arm. * fix(port): keep cppcheck off the lwIP option #error cppcheck analyzes src/ without the firmware's lwIP tree, so LWIP_TCP was undefined and the requirement check fired. lwip/opt.h always defines LWIP_TCP and LWIP_CALLBACK_API, so check only once it has been seen; a real build with LWIP_TCP=0 still hits the #error. (cherry picked from commit ad7ecad)
* feat(middleware): add shared Redis rate limiting * test(redis): fix GCC buffer and pipe declarations * fix(redis): Potential fix for pull request finding 'CodeQL / Potentially overflowing call to snprintf' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix(redis): validate frame encoding before pooled I/O Preserve the upstream Autofix commit and supersede its void encoder with the independently reviewed checked implementation. Reject formatting failures and capacity mismatches before acquiring a connection; cover bounds and formatter failures without suppressing CodeQL. --------- Co-authored-by: 이윤진(Lee Yunjin) <168180007+gg582@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Lee Yunjin <gzblues61@daum.net> (cherry picked from commit 29df1ac)
| reply += chunk | ||
| if reply == b"+PONG\r\n": | ||
| return | ||
| except OSError: |
Contributor
|
This PR targets A maintainer needs to recreate this PR's commits against |
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks the dev merges since #451 that belong on main, in dev order (
git cherry-pick -x):ad7ecad9efeat(port): serve a CWIST app over lwIP's raw TCP API (epic: bare-metal STM32 (Cortex-M) port via the dispatch_memory core + lwIP #447 Phase 3) (feat(port): serve a CWIST app over lwIP's raw TCP API (#447 Phase 3) #452)29df1ac64feat(middleware): add shared Redis rate limiting (feat(middleware): add shared Redis rate limiting #453)Doxygen auto-commits stay divergent, as before.
Conflict resolution
docs/api/v4.0-api-baseline.txt. Regenerated withmake api-baselinefrom main's headers after each pick. Each diff adds only that PR's entries:docs/ko/api/middleware.md. main carries onlydocs/ko/runtime-config.mdanddocs/ko/versioning.md, so the Korean page is not added, as in cherry-pick: embedded build work (#428, #435-#440, #442-#444) to main #445. The Englishdocs/api/middleware.mdis included.#452 adds the
lib/lwipsubmodule (lwIPSTABLE-2_2_1_RELEASE, used by tests only). Other gitlinks are unchanged, and main keeps its own lsquic pin (2b30189).How it was verified
On the picked tree, with main's submodule pins (lsquic
2b30189):make -j16 allandmake -k test: all targets pass, exit 0. This includestest_lwip_adapter,test_rate_limit_redisandtest_redis_timeout.make baremetal-smoke: hello, hello-rtc and hello-lwip PASS.make redis-rate-limit-e2eagainst a localredis-server: the strict two-process integration passes.check_test_wiring,check_api_baseline(incl. the v4 guarantee),check_env_knobs,check_api_test_coverage,check_inline_exports,malloc_lint.sh,scripts/ciunit tests: OK.scripts/ci/cppcheck.shwith cppcheck 2.13 (the CI version): no findings.