diff --git a/dune-project b/dune-project index 99cd43e1..f483593d 100644 --- a/dune-project +++ b/dune-project @@ -92,7 +92,7 @@ (= :version)) ;; (cohttp - (>= 6.0.0~beta2)) + (>= 6.0.0)) (fmt (>= 0.9.0)) (uri @@ -175,11 +175,11 @@ :with-test)) (cohttp (and - (>= 6.0.0~beta2) + (>= 6.0.0) :with-test)) (cohttp-lwt-unix (and - (>= 6.0.0~beta2) + (>= 6.0.0) (<> :os "win32") :with-test)) (conduit-lwt-unix @@ -223,7 +223,7 @@ :with-test)) (cohttp-lwt (and - (>= 6.0.0~beta2) + (>= 6.0.0) :with-test)) (qcheck-multicoretests-util (and diff --git a/lib/picos_io_cohttp/picos_io_cohttp.ml b/lib/picos_io_cohttp/picos_io_cohttp.ml index 3d73ee88..c40a9b12 100644 --- a/lib/picos_io_cohttp/picos_io_cohttp.ml +++ b/lib/picos_io_cohttp/picos_io_cohttp.ml @@ -242,7 +242,7 @@ module Server = struct let callback conn req body = `Response (callback conn req body) in make_response_action ?conn_closed ~callback () - let respond ?headers ?flush ~status ~body () = + let respond ?headers ~status ~body () = let encoding = match headers with | None -> Cohttp.Body.transfer_encoding body @@ -251,12 +251,12 @@ module Server = struct | Http.Transfer.Unknown -> Cohttp.Body.transfer_encoding body | t -> t) in - let res = Cohttp.Response.make ~status ?flush ~encoding ?headers () in + let res = Cohttp.Response.make ~status ~encoding ?headers () in (res, body) - let respond_string ?headers ?flush ~status ~body () = + let respond_string ?headers ~status ~body () = let res = - Cohttp.Response.make ~status ?flush + Cohttp.Response.make ~status ~encoding:(Http.Transfer.Fixed (Int64.of_int (String.length body))) ?headers () in @@ -288,7 +288,9 @@ module Server = struct (if keep_alive then "keep-alive" else "close") in let res = { res with headers } in - Response.write (Body.write_with Response.write_body body) res oc; + Response.write ~flush:false + (Body.write_with Response.write_body body) + res oc; if keep_alive then handle t conn ic oc end diff --git a/picos_io_cohttp.opam b/picos_io_cohttp.opam index 21a3a12d..7a7afe49 100644 --- a/picos_io_cohttp.opam +++ b/picos_io_cohttp.opam @@ -10,7 +10,7 @@ bug-reports: "https://github.com/ocaml-multicore/picos/issues" depends: [ "dune" {>= "3.14"} "picos_io" {= version} - "cohttp" {>= "6.0.0~beta2"} + "cohttp" {>= "6.0.0"} "fmt" {>= "0.9.0"} "uri" {>= "4.4.0"} "odoc" {with-doc} diff --git a/picos_meta.opam b/picos_meta.opam index b90d47f4..9480e905 100644 --- a/picos_meta.opam +++ b/picos_meta.opam @@ -22,8 +22,8 @@ depends: [ "qcheck-stm" {>= "0.3"} "alcotest" {>= "1.7.0" & with-test} "backoff" {>= "0.1.0" & with-test} - "cohttp" {>= "6.0.0~beta2" & with-test} - "cohttp-lwt-unix" {>= "6.0.0~beta2" & os != "win32" & with-test} + "cohttp" {>= "6.0.0" & with-test} + "cohttp-lwt-unix" {>= "6.0.0" & os != "win32" & with-test} "conduit-lwt-unix" {>= "6.2.2" & os != "win32" & with-test} "conf-npm" {arch != "x86_32" & arch != "riscv64" & os != "win32" & with-test} @@ -34,7 +34,7 @@ depends: [ "multicore-magic" {>= "2.3.0" & with-test} "multicore-magic-dscheck" {>= "2.3.0" & with-test} "ocaml-version" {>= "3.6.4" & with-test} - "cohttp-lwt" {>= "6.0.0~beta2" & with-test} + "cohttp-lwt" {>= "6.0.0" & with-test} "qcheck-multicoretests-util" {>= "0.3" & with-test} "uri" {>= "4.4.0" & with-test} "odoc" {>= "2.4.1" & with-doc}