Merge pull request 'Fix the ownership of the given bigstring by the underlying http scheduler' (#3) from fix-ownership into main
Reviewed-on: https://git.robur.io/robur/http-mirage-client/pulls/3
This commit is contained in:
commit
6effda224d
1 changed files with 4 additions and 2 deletions
|
@ -176,8 +176,9 @@ let single_http_1_1_request
|
||||||
(Httpaf.Headers.to_list response.Httpaf.Response.headers)
|
(Httpaf.Headers.to_list response.Httpaf.Response.headers)
|
||||||
} 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 acc =
|
let acc =
|
||||||
acc >>= fun acc -> f response acc (Bigstringaf.substring ~off ~len ba)
|
acc >>= fun acc -> f response acc str
|
||||||
in
|
in
|
||||||
Httpaf.Body.schedule_read body ~on_read:(on_read on_eof acc)
|
Httpaf.Body.schedule_read body ~on_read:(on_read on_eof acc)
|
||||||
~on_eof:(on_eof response acc) in
|
~on_eof:(on_eof response acc) in
|
||||||
|
@ -230,8 +231,9 @@ let single_h2_request
|
||||||
; headers= response.H2.Response.headers
|
; headers= response.H2.Response.headers
|
||||||
} 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 acc =
|
let acc =
|
||||||
acc >>= fun acc -> f response acc (Bigstringaf.substring ~off ~len ba)
|
acc >>= fun acc -> f response acc str
|
||||||
in
|
in
|
||||||
H2.Body.Reader.schedule_read response_body ~on_read:(on_read on_eof acc)
|
H2.Body.Reader.schedule_read response_body ~on_read:(on_read on_eof acc)
|
||||||
~on_eof:(on_eof response acc) in
|
~on_eof:(on_eof response acc) in
|
||||||
|
|
Loading…
Reference in a new issue