New upstream version 5.3.0
authorStephane Glondu <steph@glondu.net>
Sun, 8 Oct 2023 18:42:21 +0000 (20:42 +0200)
committerStephane Glondu <steph@glondu.net>
Sun, 8 Oct 2023 18:42:21 +0000 (20:42 +0200)
25 files changed:
.github/workflows/workflow.yml
CHANGES.md
cohttp-async.opam
cohttp-async/bin/cohttp_server_async.ml
cohttp-async/src/body_raw.ml
cohttp-async/src/client.ml
cohttp-async/src/io.ml
cohttp-async/test/test_async_integration.ml
cohttp-lwt-jsoo.opam
cohttp-lwt-unix.opam
cohttp-lwt.opam
cohttp-mirage.opam
cohttp-mirage/src/client.ml
cohttp-mirage/src/io.ml
cohttp-mirage/src/io.mli
cohttp-mirage/src/static.ml
cohttp-mirage/src/static.mli
cohttp-top.opam
cohttp.opam
cohttp/scripts/generate.ml
dune-project
examples/async/dune
examples/async/hello_world.ml
examples/async/receive_post.ml
examples/async/s3_cp.ml

index c6b46ebf288016bd01b1ac4d69e6ab971890a3b9..b906de04e612a1f92d397a55b34c415287fb52b8 100644 (file)
@@ -16,11 +16,7 @@ jobs:
           - macos-latest
           - ubuntu-latest
         ocaml-compiler:
-          - 4.08.x
-          - 4.09.x
-          - 4.10.x
-          - 4.11.x
-          - 4.12.x
+          - 4.14.x
 
     runs-on: ${{ matrix.os }}
 
index 0e604c54fd93b01322dd9559c8f5d2d46ce089a5..176890171d17121fcc777c4c16b275f48770415a 100644 (file)
@@ -1,3 +1,7 @@
+## v5.3.0 (2023-07-21)
+
+- cohttp-async: support for base/async v0.16
+
 ## v5.2.0 (2023-07-07)
 
 - cohttp-lwt server: call conn_closed before drainig the body of response on error (pirbo)
index 18fc6eacc99ba792978fe561fed1a4f260517fee..7a8d4c001a8d0cb6e838fb40663bc704a5249258 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
@@ -24,14 +24,14 @@ homepage: "https://github.com/mirage/ocaml-cohttp"
 doc: "https://mirage.github.io/ocaml-cohttp/"
 bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
 depends: [
-  "ocaml" {>= "4.08"}
+  "ocaml" {>= "4.14"}
   "dune" {>= "2.0"}
-  "async_kernel" {>= "v0.14.0"}
-  "async_unix" {>= "v0.14.0"}
-  "async" {>= "v0.14.0" & < "v0.16.0"}
-  "base" {>= "v0.11.0"}
-  "core" {with-test & < "v0.15.0"}
-  "core_unix" {>= "v0.14.0"}
+  "async_kernel" {>= "v0.16.0"}
+  "async_unix" {>= "v0.16.0"}
+  "async" {>= "v0.16.0"}
+  "base" {>= "v0.16.0"}
+  "core" {with-test}
+  "core_unix" {>= "v0.16.0"}
   "cohttp" {= version}
   "conduit-async" {>= "1.2.0"}
   "magic-mime"
index 10b3133e19329f12988d27ba1767ec4b25f30fa8..494b9360b9329cc231e218cc5fc1f3dfedb317b3 100644 (file)
@@ -50,7 +50,7 @@ let serve ~info ~docroot ~index uri path =
             | `No | `Unknown ->
                 (* Do a directory listing *)
                 Sys.ls_dir file_name
-                >>= Deferred.List.map ~f:(fun f ->
+                >>= Deferred.List.map ~how:`Parallel ~f:(fun f ->
                         let file_name = file_name / f in
                         try_with (fun () ->
                             Unix.stat file_name >>| fun stat ->
index 60db20dc6a59b238e1c3cbe67d1ed0cb157ed1c8..919b1cca1da2c1382cb62381db751324ca0a079e 100644 (file)
@@ -67,7 +67,7 @@ let write_body write_body (body : t) writer =
   match body with
   | `Empty -> return ()
   | `String s -> write_body writer s
-  | `Strings sl -> Deferred.List.iter sl ~f:(write_body writer)
+  | `Strings sl -> Deferred.List.iter ~how:`Sequential sl ~f:(write_body writer)
   | `Pipe p -> Pipe.iter p ~f:(write_body writer)
 
 let pipe_of_body read_chunk ic =
index f7e8d39b9e50987cb6b5a2c3a970d7148ba3edc9..ba0089ad1a260d55250d9eb44c5b46618506e23b 100644 (file)
@@ -123,7 +123,7 @@ let callv ?interrupt ?ssl_config uri reqs =
   Connection.connect ?interrupt ?ssl_config uri >>| fun connection ->
   let responses =
     Pipe.map' ~max_queue_length:1 reqs ~f:(fun reqs ->
-        Deferred.Queue.map reqs ~f:(fun (req, body) ->
+        Deferred.Queue.map ~how:`Sequential reqs ~f:(fun (req, body) ->
             Connection.request ~body connection req))
   in
   Pipe.closed responses
index 9e11edb2f489dc25345aadfeda145be77f3948fc..cb0ad69b9c7add53efed3fb9550f15aa46b220e3 100644 (file)
@@ -18,7 +18,7 @@ open Base
 open Async_kernel
 module Writer = Async_unix.Writer
 module Reader = Async_unix.Reader
-module Format = Caml.Format
+module Format = Stdlib.Format
 
 let log_src_name = "cohttp.async.io"
 let src = Logs.Src.create log_src_name ~doc:"Cohttp Async IO module"
@@ -42,7 +42,7 @@ let default_reporter () =
       k ()
     in
     msgf @@ fun ?header:_ ?tags:_ fmt ->
-    Format.kfprintf k fmtr Caml.("@[" ^^ fmt ^^ "@]@.")
+    Format.kfprintf k fmtr Stdlib.("@[" ^^ fmt ^^ "@]@.")
   in
   { Logs.report }
 
@@ -56,11 +56,11 @@ let set_log =
      Logs.set_reporter (default_reporter ()))
 
 let check_debug norm_fn debug_fn =
-  match Caml.Sys.getenv "COHTTP_DEBUG" with
+  match Stdlib.Sys.getenv "COHTTP_DEBUG" with
   | _ ->
       Lazy.force set_log;
       debug_fn
-  | exception Caml.Not_found -> norm_fn
+  | exception Stdlib.Not_found -> norm_fn
 
 type 'a t = 'a Deferred.t
 
index 5acc2a8b030840d24ec86037906ccb784b9c1772..32a2a6aa794d20b511805c8d0b9b1e90776ad041 100644 (file)
@@ -79,7 +79,7 @@ let ts =
         reqs |> Pipe.of_list |> Client.callv uri >>= fun responses ->
         responses |> Pipe.to_list >>= fun resps ->
         resps
-        |> Deferred.List.iter ~f:(fun (_resp, body) ->
+        |> Deferred.List.iter ~how:`Sequential ~f:(fun (_resp, body) ->
                let expected_body = body_q |> Queue.dequeue_exn in
                body |> Body.to_string >>| fun body ->
                assert_equal ~printer expected_body body)
@@ -111,7 +111,7 @@ let ts =
             ("Pipe with empty strings", Pipe.of_list [ ""; ""; "" ], true);
           ]
         in
-        Deferred.List.iter tests ~f:(fun (msg, pipe, expected) ->
+        Deferred.List.iter ~how:`Sequential tests ~f:(fun (msg, pipe, expected) ->
             is_empty (`Pipe pipe) >>| fun real ->
             assert_equal ~msg expected real)
         >>= fun () ->
index dfb8f06f11ed56484ec62537f465a4c4f54f9304..1af72ffa05104e4238d97c910df463417466f477 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
index fbcd809f1ae9e74a5484b11d7e9005834320080f..776587526328e29921821e661f879087054c6df0 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
index a88bfcc78b399e8db4b8c38319c298f5f9b403da..cbfd435530c0ebeeb5a60fe5a7de5df048cd0a66 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
index d767aa50309a6bbb65c546ff0d1359d01773720a..61186f6d5837bba28f2e40eb624e768860fc2a7c 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: ["Anil Madhavapeddy" "Thomas Gazagnaire"]
index b34ebfdf3d9850302a9d7574ad48d3f6b27269a6..a2de582cd7b04d097bedda16bf18bacce4f1ea13 100644 (file)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * cohttp v5.2.0
+ * cohttp v5.3.0
  *)
 
 open Lwt.Infix
index 84b54661ec094d9a99ac5294a53040794e7fdbaa..301c634600a313627c3ee22008fdee2ada4f279c 100644 (file)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * cohttp v5.2.0
+ * cohttp v5.3.0
  *)
 
 open Lwt.Infix
index 10c87103a68e2f03bc9d28a2f130223eba91ccfc..1768bbed19d62989c0c132767346efe185fc5c3e 100644 (file)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * cohttp v5.2.0
+ * cohttp v5.3.0
  *)
 
 (** Cohttp IO implementation using Mirage channels. *)
index bba69cf66234266cbdd185bad8544366f411941c..99e8aa384c122d10a8141eafef767204b32c49b9 100644 (file)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * cohttp v5.2.0
+ * cohttp v5.3.0
  *)
 
 module Key = Mirage_kv.Key
index 9ee4763a163762a346a824aeaa75ae11aa91a696..b9e95457c7f8398e9e6e3817f44884e679a3494c 100644 (file)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * cohttp v5.2.0
+ * cohttp v5.3.0
  *)
 
 (** Serve static HTTP sites from a Mirage key-value store. *)
index d4b5b2ee0bdfbb08c03871f86038876c7c485c50..bad206ee696477ed634cc9c465d680c13b22f777 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
index 7e73c55b9f257b96d5d8886132fdd07ebd4999c4..54c07330534feb0eff22a4a2734ae6bd91f03d3e 100644 (file)
@@ -1,4 +1,4 @@
-version: "5.2.0"
+version: "5.3.0"
 opam-version: "2.0"
 maintainer: "anil@recoil.org"
 authors: [
index 3dbf6ba6888b0d16c0970effa0c9eaa661eed44c..160e9907456ac43f86b39c2efb696d8cb109075b 100644 (file)
@@ -94,7 +94,7 @@ let output t =
   Buffer.contents buf
 
 let parse_error fmt =
-  Printf.kprintf
+  Printf.ksprintf
     (fun msg ->
       Printf.eprintf "parse error: %s\n" msg;
       exit 1)
index c3014fe03457004979a885748f32fef887877a4c..b7266eddb53cf4bb0388d05ba1499d1527c3f4af 100644 (file)
@@ -1,3 +1,3 @@
 (lang dune 2.0)
 (name cohttp)
-(version v5.2.0)
+(version v5.3.0)
index 92af22612dbb31d0c534681ca2b316f708885777..8d875ddcbdd940fedcf589642d575a332cec1bfb 100644 (file)
@@ -1,6 +1,6 @@
 (executables
- (names hello_world receive_post)
- (libraries mirage-crypto cohttp-async base async_kernel))
+ (names hello_world receive_post s3_cp)
+ (libraries mirage-crypto cohttp-async base async_kernel core_unix.command_unix))
 
 (alias
  (name runtest)
index e6a620ef9b3dabb1c020184cdb9e2d049da1e9f9..1af93cf48cae8522160ad15adec64ef898c46a1f 100644 (file)
@@ -19,8 +19,8 @@ let handler ~body:_ _sock req =
   | _ -> Server.respond_string ~status:`Not_found "Route not found"
 
 let start_server port () =
-  Caml.Printf.eprintf "Listening for HTTP on port %d\n" port;
-  Caml.Printf.eprintf "Try 'curl http://localhost:%d/test?hello=xyz'\n%!" port;
+  Stdlib.Printf.eprintf "Listening for HTTP on port %d\n" port;
+  Stdlib.Printf.eprintf "Try 'curl http://localhost:%d/test?hello=xyz'\n%!" port;
   Cohttp_async.Server.create ~on_handler_error:`Raise
     (Async.Tcp.Where_to_listen.of_port port)
     handler
@@ -35,4 +35,4 @@ let () =
            (optional_with_default 8080 int)
            ~doc:"int Source port to listen on")
     start_server
-  |> Command.run
+  |> Command_unix.run
index cf0830c95aab38c2cf15974ddd03f68cbf994f6c..34ea2c183f5ca683c104c97191c9aa4e2a4f1ec6 100644 (file)
@@ -6,15 +6,15 @@ open Cohttp_async
 (* compile with: $ corebuild receive_post.native -pkg cohttp.async *)
 
 let start_server port () =
-  Caml.Printf.eprintf "Listening for HTTP on port %d\n" port;
-  Caml.Printf.eprintf "Try 'curl -X POST -d 'foo bar' http://localhost:%d\n"
+  Stdlib.Printf.eprintf "Listening for HTTP on port %d\n" port;
+  Stdlib.Printf.eprintf "Try 'curl -X POST -d 'foo bar' http://localhost:%d\n"
     port;
   Cohttp_async.Server.create ~on_handler_error:`Raise
     (Async.Tcp.Where_to_listen.of_port port) (fun ~body _ req ->
       match req |> Cohttp.Request.meth with
       | `POST ->
           Body.to_string body >>= fun body ->
-          Caml.Printf.eprintf "Body: %s" body;
+          Stdlib.Printf.eprintf "Body: %s" body;
           Server.respond `OK
       | _ -> Server.respond `Method_not_allowed)
   >>= fun _ -> Deferred.never ()
@@ -28,4 +28,4 @@ let () =
            (optional_with_default 8080 int)
            ~doc:"int Source port to listen on")
     start_server
-  |> Command.run
+  |> Command_unix.run
index 65022d323630d454b46d757b5d7bce5279e5b11a..48a6f6482a2bf35a85618a9df8a8ea0d3732da32 100644 (file)
@@ -45,6 +45,8 @@ open Async
 open Cohttp
 open Cohttp_async
 
+module Time = Time_float
+
 let ksrt (k, _) (k', _) = String.compare k k'
 
 module Compat = struct
@@ -400,4 +402,4 @@ let () =
       +> anon ("src" %: string)
       +> anon ("dst" %: string))
     main
-  |> run
+  |> Command_unix.run