Repository navigation
docs: request strings are views of the receive buffer on the native engines; RequestHeaders is not a copy (Refs celeris#891) - #115
Draft
FumingPower3925 wants to merge 1 commit into
Conversation
…ngines; RequestHeaders is not a copy (Refs celeris#891)
request-handling.md, core-concepts.md and context-api-reference.md called
RequestHeaders() a safe-to-retain copy, said x := c.Param("id") copies, and
named only Body() and Header() as views. Per celeris doc.go (celeris#920): every
request string is a view of the receive buffer on epoll, io_uring and Adaptive
over HTTP/1.1, valid until the handler returns; copy with strings.Clone.
After Hijack (HTTP/1.1 only) the request strings stay valid, including those
read before the call; Detach copies the values the Context holds but not the
strings you already read out of it.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
goceleris-docs | b8b2790 | Commit Preview URL Branch Preview URL |
Nov 10 2026, 06:21 PM |
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.
What
Three docs pages (
request-handling.md,core-concepts.md,context-api-reference.md) now say what the request strings are. Docs repo change; no celeris code.RequestHeaders()is not a safe-to-retain copy. It is the request's own header slice on HTTP/1.1 (a copy on HTTP/2), read-only, valid until the handler returns. The names and values are views of the receive buffer on the native engines over HTTP/1.1.Param,Header,Path,Method,Query, ...) is a view of the receive buffer on theEpoll,IOUringandAdaptiveengines over HTTP/1.1.x := c.Param("id")is the same view, not a copy;strings.Cloneis the copy. The engine reuses that buffer for the connection's next request and, once the connection closes, for another connection.Detachcopies the values theContextholds, not the strings you already read out of it (on HTTP/2 it copies neither the headers nor the body). AfterHijack(HTTP/1.1 only) the request strings stay valid, including the ones read before the call.Why
The pages called
RequestHeaders()a safe copy, saidx := c.Param("id")copies, and named onlyBody()andHeader()as views. That follows an older comment in celeris, and code written from the docs could keep a string that later reads another client's request.The pages quote celeris source (
RequestHeaders,doc.go). Those quotes match celeris main, not the v1.5.11 tag, so this should land with v1.6.0. Plan: open it as a draft, add it to the celeris#649 checklist beside the triage row for the Detach wording, and after the tag re-check the quotes againstgit show v1.6.0:context_request.goandv1.6.0:doc.go.Tests
On the docs repo:
bun test29 pass,bun run validate,bun run buildandbun run check(0 errors, 0 warnings) all pass. No wording-guard test is added here: thescripts/kernel-floor.test.tspattern that was suggested is in #108 and not on docs main yet.Risk
Docs only. The branch is based on docs main (7f76e18) and applies cleanly on main; it does not need #108 or #113 and should not be stacked on them.
Refs celeris#891