emilk / ehttp

Minimal Rust HTTP client for both native and WASM
Apache License 2.0
323 stars 30 forks source link

Streaming chunks fragmented at 2048 bytes #63

Open RJ opened 3 weeks ago

RJ commented 3 weeks ago

I'm using streaming, and if i send a chunk larger than 2048, it's truncated. I get sent a Part which is 2048 long, even if the server sent a larger chunk. (which then doesn't deserialize properly as it's truncated)

due to hardcoded buffer size here: https://github.com/emilk/ehttp/blob/master/ehttp/src/streaming/native.rs#L57

i don't think it's possible to know if a received Part was truncated or was simply exactly 2048 long originally.

RJ commented 3 weeks ago

not a real fix, but i doubled the size to "fix" my problem, and added a warning

https://github.com/rj/ehttp/blob/chunkier/ehttp/src/streaming/native.rs#L57