From 7c9efb7425392af1d831436e2a112a627d021234 Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Wed, 1 Feb 2023 12:52:59 +0100 Subject: [PATCH] Put a comment about the given buffer & the ownership story --- src/http_mirage_client.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http_mirage_client.ml b/src/http_mirage_client.ml index c921e2d..7911fc7 100644 --- a/src/http_mirage_client.ml +++ b/src/http_mirage_client.ml @@ -177,6 +177,8 @@ let single_http_1_1_request } in let rec on_read on_eof acc ba ~off ~len = 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 = acc >>= fun acc -> f response acc str in @@ -232,6 +234,8 @@ let single_h2_request } in let rec on_read on_eof acc ba ~off ~len = 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 = acc >>= fun acc -> f response acc str in