Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new version of http/af #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.dev" "git+https://github.com/dinosaure/paf-le-chien.git#bab8406b1e49e47e37d21753d1a890cdb2b0f66a" ]
[ "httpaf.dev" "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