Files
magpie/internal
ggbdpq 94e46b5fea gateway: a body short of its own Content-Length is answered 408 even with no read under way
The unrouted hold's 408 (the client is still sending its body) was
judged by whether the handler was inside a body read that instant.
unroutedMost can run out between two reads of a trickled body, or
before its first, and there the read's absence answered 504, as if
magpie held the request of its own (#4511, red in a full run). The
body is judged by its state now: less come than the request's own
Content-Length says is still arriving, and the time is the client's.
A body read whole, a length never said and an empty one are judged
by the read alone, as before.

Reviewed and applied from #4511 (ggbdpq, c59083f5f, SHA-256 matches).
The next commit narrows it. As written, a request still waiting for
magpie's own body room, before its first read, was answered 408 "its
body was still arriving". That blames a client whose body may all be
sent already.

Run (on mote, through mote-run):
- Full `go test -tags nogui -count=1 -timeout 45m ./...` with this stack
  on c30d3b7b6: 82 packages ok. internal/gui was red only on
  TestSettingsSaveKeepsWhatItDoesNotSend (#4514, SearchAll from
  b09349d17) and TestColdTurnsTaken (#4510). Both are filed, and neither
  touches this stack.
- Rebased onto 29d0ab39f, which changed internal/gateway since then:
  gofmt -l, go vet (darwin, GOOS=linux -tags nogui, GOOS=windows) and
  go test -count=1 ./internal/gateway ./internal/usage ./internal/provider
  ./internal/sessions all ok at the pushed head. go build ./... ok for
  darwin, linux (nogui) and windows.
- go test -race of the gateway tests this stack adds or touches, on
  the stack at fb29cd30f: ok.
2026-10-31 23:35:27 +08:00
..
…
…
…
…