Skip to content

Commit 6ccc15b

Browse files
committed
Upgrade to cohttp 6.0.0
1 parent 3d354d6 commit 6ccc15b

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

dune-project

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
(= :version))
9393
;;
9494
(cohttp
95-
(>= 6.0.0~beta2))
95+
(>= 6.0.0))
9696
(fmt
9797
(>= 0.9.0))
9898
(uri
@@ -175,11 +175,11 @@
175175
:with-test))
176176
(cohttp
177177
(and
178-
(>= 6.0.0~beta2)
178+
(>= 6.0.0)
179179
:with-test))
180180
(cohttp-lwt-unix
181181
(and
182-
(>= 6.0.0~beta2)
182+
(>= 6.0.0)
183183
(<> :os "win32")
184184
:with-test))
185185
(conduit-lwt-unix
@@ -223,7 +223,7 @@
223223
:with-test))
224224
(cohttp-lwt
225225
(and
226-
(>= 6.0.0~beta2)
226+
(>= 6.0.0)
227227
:with-test))
228228
(qcheck-multicoretests-util
229229
(and

lib/picos_io_cohttp/picos_io_cohttp.ml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ module Server = struct
242242
let callback conn req body = `Response (callback conn req body) in
243243
make_response_action ?conn_closed ~callback ()
244244

245-
let respond ?headers ?flush ~status ~body () =
245+
let respond ?headers ~status ~body () =
246246
let encoding =
247247
match headers with
248248
| None -> Cohttp.Body.transfer_encoding body
@@ -251,12 +251,12 @@ module Server = struct
251251
| Http.Transfer.Unknown -> Cohttp.Body.transfer_encoding body
252252
| t -> t)
253253
in
254-
let res = Cohttp.Response.make ~status ?flush ~encoding ?headers () in
254+
let res = Cohttp.Response.make ~status ~encoding ?headers () in
255255
(res, body)
256256

257-
let respond_string ?headers ?flush ~status ~body () =
257+
let respond_string ?headers ~status ~body () =
258258
let res =
259-
Cohttp.Response.make ~status ?flush
259+
Cohttp.Response.make ~status
260260
~encoding:(Http.Transfer.Fixed (Int64.of_int (String.length body)))
261261
?headers ()
262262
in
@@ -288,7 +288,9 @@ module Server = struct
288288
(if keep_alive then "keep-alive" else "close")
289289
in
290290
let res = { res with headers } in
291-
Response.write (Body.write_with Response.write_body body) res oc;
291+
Response.write ~flush:false
292+
(Body.write_with Response.write_body body)
293+
res oc;
292294
if keep_alive then handle t conn ic oc
293295
end
294296

picos_io_cohttp.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bug-reports: "https://github.com/ocaml-multicore/picos/issues"
1010
depends: [
1111
"dune" {>= "3.14"}
1212
"picos_io" {= version}
13-
"cohttp" {>= "6.0.0~beta2"}
13+
"cohttp" {>= "6.0.0"}
1414
"fmt" {>= "0.9.0"}
1515
"uri" {>= "4.4.0"}
1616
"odoc" {with-doc}

picos_meta.opam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ depends: [
2222
"qcheck-stm" {>= "0.3"}
2323
"alcotest" {>= "1.7.0" & with-test}
2424
"backoff" {>= "0.1.0" & with-test}
25-
"cohttp" {>= "6.0.0~beta2" & with-test}
26-
"cohttp-lwt-unix" {>= "6.0.0~beta2" & os != "win32" & with-test}
25+
"cohttp" {>= "6.0.0" & with-test}
26+
"cohttp-lwt-unix" {>= "6.0.0" & os != "win32" & with-test}
2727
"conduit-lwt-unix" {>= "6.2.2" & os != "win32" & with-test}
2828
"conf-npm"
2929
{arch != "x86_32" & arch != "riscv64" & os != "win32" & with-test}
@@ -34,7 +34,7 @@ depends: [
3434
"multicore-magic" {>= "2.3.0" & with-test}
3535
"multicore-magic-dscheck" {>= "2.3.0" & with-test}
3636
"ocaml-version" {>= "3.6.4" & with-test}
37-
"cohttp-lwt" {>= "6.0.0~beta2" & with-test}
37+
"cohttp-lwt" {>= "6.0.0" & with-test}
3838
"qcheck-multicoretests-util" {>= "0.3" & with-test}
3939
"uri" {>= "4.4.0" & with-test}
4040
"odoc" {>= "2.4.1" & with-doc}

0 commit comments

Comments
 (0)