yawaramin / re-web

Experimental web framework for ReasonML & OCaml
https://yawaramin.github.io/re-web/re-web/index.html
MIT License
261 stars 8 forks source link

Don't perform a bigarray copy of every body chunk #36

Closed anmonteiro closed 4 years ago

anmonteiro commented 4 years ago

The version of http/af we're using handles backpressure if further body reads are not scheduled, making it safe to use the underlying bigstring exposed to the application.

Alternatively, if this PR isn't accepted, off needs to be fixed (set to 0), given that Bigstringaf.copy will produce a new bigstring starting at offset 0.

yawaramin commented 4 years ago

Great thanks! I'll check locally–I believe I have a test for this specific behaviour of httpaf–if that continues to pass I'll merge immediately, otherwise will fix the test and merge.