Skip to content

Commit

Permalink
Use the new version of http/af
Browse files Browse the repository at this point in the history
  • Loading branch information
dinosaure committed Apr 25, 2022
1 parent 3a8cd1d commit 196a881
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions git-paf.opam
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ build: [
["dune" "runtest" "-p" name "-j" jobs "--no-buffer"] {with-test}
]
dev-repo: "git+https://github.com/mirage/ocaml-git.git"
pin-depends: [
[ "paf" "git+https://github.com/dinosaure/paf-le-chien.git#90adffeaaeb890af23b7591c5e9a4b9c5737de21" ]
[ "httpaf" "git+https://github.com/inhabitedtype/httpaf.git#94ea5d6c233d55e642d60818afebd345f7eccb24" ]
]
10 changes: 5 additions & 5 deletions src/git-paf/git_paf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ let response_handler mvar pusher resp body =
let rec on_read buf ~off ~len =
let str = Bigstringaf.substring buf ~off ~len in
pusher (Some str);
Httpaf.Body.schedule_read ~on_eof ~on_read body
Httpaf.Body.Reader.schedule_read ~on_eof ~on_read body
in
Httpaf.Body.schedule_read ~on_eof ~on_read body;
Httpaf.Body.Reader.schedule_read ~on_eof ~on_read body;
Lwt.async @@ fun () -> Lwt_mvar.put mvar resp

let transmit body = function
| None -> Httpaf.Body.close_writer body
| None -> Httpaf.Body.Writer.close body
| Some str ->
Httpaf.Body.write_string body str;
Httpaf.Body.close_writer body
Httpaf.Body.Writer.write_string body str;
Httpaf.Body.Writer.close body

exception Invalid_response_body_length of Httpaf.Response.t
exception Malformed_response of string
Expand Down

0 comments on commit 196a881

Please sign in to comment.