drogue-iot / reqwless

Rust async HTTP client for embedded/no_std
Apache License 2.0
129 stars 18 forks source link

Use BufferedRead when reading #56

Open rmja opened 1 year ago

rmja commented 1 year ago

Currently when e.g. reading a chunked response body, we request a read() with a single byte buffer. This PR uses the BufferedRead as an intermediate to greatly avoid small connection reads when tls is not in use.

cc @bugadani

rmja commented 1 year ago

I can now see that the small reads are actually not happening, so maybe the motivation to include this is not as strong as I first thought.

bugadani commented 1 year ago

Yeah the network stack won't receive bytes one by one but this is certainly a cleaner implementation than what we had before. Minus the matches! hack, which looks just weird, I hope we can drop that somehow.