Skip to content

Commit

Permalink
Update for cohttp 6 Response API
Browse files Browse the repository at this point in the history
Cohttp 6 introduced a breaking change to the `Response` API dropping
`flush` in mirage/ocaml-cohttp#1052

This updates our usage to be compatible.
  • Loading branch information
shonfeder committed Nov 29, 2024
1 parent 29c20bb commit 187d957
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion opam-repo-ci-web.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ depends: [
"prometheus-app"
"cmdliner" {>= "1.1.0"}
"lwt"
"cohttp-lwt-unix" {>= "2.2.0"}
"cohttp-lwt-unix" {>= "6.0.0"}
"mirage-crypto-rng" {>= "0.11.0"}
"tyxml"
"capnp-rpc-unix"
Expand Down
5 changes: 2 additions & 3 deletions web-ui/github.ml
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ module Repo_handle = struct
(* Otherwise, an nginx reverse proxy will wait for the whole log before sending anything. *)
Cohttp.Header.init_with "X-Accel-Buffering" "no"
in
let res = Cohttp.Response.make ~status:`OK ~flush:true ~encoding:Cohttp.Transfer.Chunked ~headers () in
let res = Cohttp.Response.make ~status:`OK ~encoding:Cohttp.Transfer.Chunked ~headers () in
let write _ic oc =
let flush = Cohttp.Response.flush res in
let writer = Transfer_IO.make_writer ~flush Cohttp.Transfer.Chunked oc in
let writer = Transfer_IO.make_writer ~flush:true Cohttp.Transfer.Chunked oc in
Lwt.finalize
(fun () ->
stream_logs job ~owner ~name ~refs ~hash ~variant ~status chunk writer >>= fun () ->
Expand Down

0 comments on commit 187d957

Please sign in to comment.