bosprimigenious opened a new pull request, #894:
URL: https://github.com/apache/hugegraph-toolchain/pull/894

   ## Purpose of the PR
   
   - close #893
   
   `ContentLength=-1` is a documented unknown request length. Enabling 
request-body logging currently panics before sending it.
   
   ## Main Changes
   
   ```diff
   - allocate logging buffer with capacity int(req.ContentLength)
   + grow an initially empty bytes.Buffer while reading the body
   ```
   
   Only the Go transport body-duplication allocation changes. Add a real 
httptest echo-server matrix for -1, 0 and exact lengths with logging 
enabled/disabled; verify both transmitted bytes and request/response log 
content. No dependency changes.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [ ] Already covered by existing tests.
   - [x] Need tests and can be verified as follows:
     - Go 1.25.14, unchanged go.mod/go.sum, macOS arm64.
     - Original source + final regressions: **1 fail, 5 pass** (`makeslice: cap 
out of range`). Patched source: all **6 pass**.
     - `make test-case GOPKGS=./hgtransport` passes; separately rerun uncached 
with the same race/timeout/gcflags/coverage flags: all 10 existing top-level 
tests plus 6 new cases pass, package coverage 39.5% (report only).
     - `go build ./...` and `go vet ./hgtransport` pass.
     - Separate public API echo program: original panics; patched returns the 
complete payload. Extra non-replayable-stream/body boundary controls pass.
   
   **NOT READY for full acceptance:** `go test ./... -race` fails in five 
existing live-server API packages because no HugeGraph service runs at 
localhost:8080, including ensuing nil-pointer failures. Candidate-server CI and 
maintainer review remain outstanding. The repository-wide license script also 
reports 31 .git metadata header failures locally; scoped checks report both 
changed files valid. No server or CI check was bypassed.
   
   ## Does this PR potentially affect the following parts?
   
   - [x] Nope
   - [ ] Dependencies (add/update license info)
   - [ ] Modify configurations
   - [ ] The public API
   - [ ] Other affects (typed here)
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`
   - [ ] `Doc - Done`
   - [x] `Doc - No Need`
   
   ## Merge Danger
   
   **Door:** two-way. Reverting restores the previous allocation; no persisted 
data migration.
   
   **Blast Radius:** transport. Existing logging buffering behavior remains, 
but large or streaming bodies still buffer in memory as before.
   
   AI disclosure: patch, tests, analysis and prose prepared with OpenAI Codex. 
No human review is claimed. This independent bug fix does not implement or 
claim #748/#772 Rust compatibility/benchmark work.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to