Repository navigation
fix: large requests with Caddy - #187
Conversation
714e81f to
bcea628
Compare
|
This means you're buffering the whole request in memory? Or will it properly stream? |
|
No, it still streams (we have a test for that). We don't buffer the whole request but wait for the buffer provided by PHP to be full (which is a bit larger than the buffer you use in Caddy by default). PHP considers that the request has been totally read if its buffer isn't full, which isn't the Go behavior (which is more fine-grained btw), so we have to wait for the PHP buffer to be full before calling PHP again. |
|
Oh I see, so you just had to pump |
|
@francislavoie Yes exactly, Go's approach is better (you don't have to wait), but we have no choice here, PHP forces our hand. |
This fix ensures that the request body buffer is full (if possible) before copying it to C memory.
Thanks to @francislavoie for pointing me to caddyserver/caddy#5461, which revealed the bug.
Close #182.