Put a comment about the given buffer & the ownership story

This commit is contained in:
Romain Calascibetta 2023-02-01 12:52:59 +01:00
parent a0505c9e5e
commit 7c9efb7425

View file

@ -177,6 +177,8 @@ let single_http_1_1_request
} in } in
let rec on_read on_eof acc ba ~off ~len = let rec on_read on_eof acc ba ~off ~len =
let str = Bigstringaf.substring ~off ~len ba in let str = Bigstringaf.substring ~off ~len ba in
(* XXX(dinosaure): the copy must be done **before** any [>>=].
The given [ba] is re-used by the [Httpaf] scheduler then. *)
let acc = let acc =
acc >>= fun acc -> f response acc str acc >>= fun acc -> f response acc str
in in
@ -232,6 +234,8 @@ let single_h2_request
} in } in
let rec on_read on_eof acc ba ~off ~len = let rec on_read on_eof acc ba ~off ~len =
let str = Bigstringaf.substring ~off ~len ba in let str = Bigstringaf.substring ~off ~len ba in
(* XXX(dinosaure): the copy must be done **before** any [>>=].
The given [ba] is re-used by the [H2] scheduler then. *)
let acc = let acc =
acc >>= fun acc -> f response acc str acc >>= fun acc -> f response acc str
in in