Skip to content
Merged
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
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/ma
script: bash -ex ./.travis-docker.sh
env:
global:
- EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git"
- PINS="cohttp-top:. cohttp-async:. cohttp-lwt-unix:. cohttp-lwt-jsoo:. cohttp-lwt:. cohttp-mirage:. cohttp:."
- PINS="cohttp-top.dev:. cohttp-async.dev:. cohttp-lwt-unix.dev:. cohttp-lwt-jsoo.dev:. cohttp-lwt.dev:. cohttp-mirage.dev:. cohttp.dev:."
matrix:
- PACKAGE="cohttp" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp-async" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt-unix" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt-jsoo" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp-mirage" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
- PACKAGE="cohttp" DISTRO="ubuntu-lts" OCAML_VERSION="4.08" DEPOPTS="cohttp-async cohttp-lwt-unix cohttp-mirage"
- PACKAGE="cohttp" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="cohttp-async" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt-unix" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt-jsoo" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="cohttp-lwt" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="cohttp-mirage" DISTRO="alpine" OCAML_VERSION="4.07"
- PACKAGE="cohttp" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp-async" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp-lwt-unix" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp-lwt-jsoo" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp-lwt" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp-mirage" DISTRO="alpine" OCAML_VERSION="4.06"
- PACKAGE="cohttp" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp-async" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp-lwt-unix" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp-lwt-jsoo" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp-lwt" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp-mirage" DISTRO="debian-unstable" OCAML_VERSION="4.05"
- PACKAGE="cohttp" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="cohttp-async" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="cohttp-lwt-unix" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## dev

- use conduit-mirage instead of mirage-conduit, which was renamed
upstream in conduit. The minimum OCaml version supported for
conduit-mirage is now OCaml 4.07 and higher. (@avsm)
- remove deprecation warnings in OCaml 4.08.0 using stdlib-shims (@avsm)

## v2.1.3 (2019-07-12)

- support uri.3.0.0 that has optional sexp support (#668 @avsm)
Expand Down
5 changes: 3 additions & 2 deletions cohttp-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"dune" {>= "1.1.0"}
"async_kernel" {>= "v0.11.0"}
"async_unix" {>= "v0.11.0"}
"async_extra" {>= "v0.11.0"}
"base" {>= "v0.11.0"}
"core" {with-test}
"cohttp"
"cohttp" {=version}
"conduit-async" {>="1.2.0"}
"magic-mime"
"logs"
"fmt" {>= "0.8.2"}
"sexplib0"
"stdlib-shims"
"ppx_sexp_conv" {>= "v0.9.0"}
"ounit" {with-test}
"uri" {>= "2.0.0"}
Expand Down
2 changes: 1 addition & 1 deletion cohttp-async/bin/cohttp_curl_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let make_net_req uri meth' body () =
show_headers (Cohttp.Response.headers res);
body
|> Body.to_pipe
|> Pipe.iter ~f:(fun b -> Caml.Pervasives.print_string b; return ())
|> Pipe.iter ~f:(fun b -> Stdlib.print_string b; return ())
Comment thread
avsm marked this conversation as resolved.

let _ =
(* enable logging to stdout *)
Expand Down
6 changes: 3 additions & 3 deletions cohttp-lwt-jsoo.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"cohttp" {>= "1.0.0"}
"cohttp-lwt" {>= "1.0.0"}
"dune" {>= "1.1.0"}
"cohttp" {=version}
"cohttp-lwt" {=version}
"lwt" {>= "3.0.0"}
"js_of_ocaml" {>= "3.3.0"}
"js_of_ocaml-ppx" {>= "3.3.0"}
Expand Down
4 changes: 2 additions & 2 deletions cohttp-lwt-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"dune" {>= "1.1.0"}
"conduit-lwt-unix" {>= "1.0.3"}
"cmdliner"
"magic-mime"
"logs"
"fmt" {>= "0.8.2"}
"cohttp-lwt"
"cohttp-lwt" {=version}
"lwt" {>= "3.0.0"}
"base-unix"
"ounit" {with-test}
Expand Down
11 changes: 9 additions & 2 deletions cohttp-lwt-unix/src/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ let respond_file ?headers ~fname () =
respond_not_found ()
| exn -> Lwt.fail exn)

let create ?timeout ?backlog ?stop ?on_exn ?(ctx=Net.default_ctx)
let log_on_exn =
function
| Unix.Unix_error (error, func, arg) ->
Logs.warn (fun m -> m "Client connection error %s: %s(%S)"
(Unix.error_message error) func arg)
| exn -> Logs.err (fun m -> m "Unhandled exception: %a" Fmt.exn exn)

let create ?timeout ?backlog ?stop ?(on_exn=log_on_exn) ?(ctx=Net.default_ctx)
?(mode=`TCP (`Port 8080)) spec =
Conduit_lwt_unix.serve ?backlog ?timeout ?stop ?on_exn ~ctx:ctx.Net.ctx
Conduit_lwt_unix.serve ?backlog ?timeout ?stop ~on_exn ~ctx:ctx.Net.ctx
~mode (callback spec)
4 changes: 2 additions & 2 deletions cohttp-lwt-unix/src/server.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ val respond_file :

Every connection will be served in a new lightweight thread that
is invoked via the callback defined in [t]. If the callback raises
an exception, it is passed to [on_exn] (by default, to
!Lwt.async_exception_hook). *)
an exception, it is passed to [on_exn] (by default, to a function
that logs the exceptiom using the {!Logs} library). *)
val create :
?timeout:int ->
?backlog:int ->
Expand Down
4 changes: 2 additions & 2 deletions cohttp-lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"cohttp" {>= "1.0.0"}
"dune" {>= "1.1.0"}
"cohttp" {=version}
"lwt" {>= "2.5.0"}
"sexplib0"
"ppx_sexp_conv" {>= "v0.9.0"}
Expand Down
4 changes: 2 additions & 2 deletions cohttp-mirage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Please see <https://mirage.io> for a self-hosted explanation
and instructions on how to use this library."""
depends: [
"ocaml" {>= "4.05.0"}
"dune" {build & >= "1.1.0"}
"dune" {>= "1.1.0"}
"mirage-flow-lwt" {>= "1.2.0"}
"mirage-channel-lwt" {>= "3.0.0"}
"conduit" {>= "0.99"}
"mirage-conduit" {>= "3.0.0"}
"conduit-mirage"
"mirage-kv-lwt" {>= "2.0.0"}
"lwt" {>= "2.4.3"}
"cohttp"
Expand Down
2 changes: 1 addition & 1 deletion cohttp-mirage/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
(public_name cohttp-mirage)
(synopsis "Mirage backend for cohttp")
(wrapped false)
(libraries cohttp-lwt mirage-channel-lwt mirage-conduit sexplib
(libraries cohttp-lwt mirage-channel-lwt conduit-mirage sexplib
mirage-flow-lwt magic-mime astring))
4 changes: 2 additions & 2 deletions cohttp-top.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"cohttp"
"dune" {>= "1.1.0"}
"cohttp" {=version}
]
build: [
["dune" "subst"] {pinned}
Expand Down
3 changes: 2 additions & 1 deletion cohttp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ doc: "https://mirage.github.io/ocaml-cohttp/"
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.1.0"}
"dune" {>= "1.1.0"}
"re" {>= "1.9.0"}
"uri" {>= "2.0.0"}
"uri-sexp"
Expand All @@ -43,6 +43,7 @@ depends: [
"ppx_sexp_conv" {>= "v0.9.0"}
"stringext"
"base64" {>= "3.1.0"}
"stdlib-shims"
"fmt" {with-test}
"jsonm" {build}
"alcotest" {with-test}
Expand Down
2 changes: 1 addition & 1 deletion cohttp/src/connection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ let create () =
incr count;
!count

let compare (a:t) (b:t) = Pervasives.compare a b
let compare (a:t) (b:t) = Stdlib.compare a b
2 changes: 1 addition & 1 deletion cohttp/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(public_name cohttp)
(synopsis "Co-operative Client/Server HTTP library.")
(preprocess (pps ppx_fields_conv ppx_sexp_conv))
(libraries re stringext uri uri-sexp fieldslib sexplib0 bytes base64))
(libraries re stringext uri uri-sexp fieldslib sexplib0 bytes base64 stdlib-shims))

(ocamllex accept_lexer)
(ocamlyacc accept_parser)
2 changes: 1 addition & 1 deletion cohttp/src/header.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type t = string list StringMap.t

let user_agent = Printf.sprintf "ocaml-cohttp/%s" Conf.version

let compare = StringMap.compare Pervasives.compare
let compare = StringMap.compare Stdlib.compare

let headers_with_list_values = Array.map LString.of_string [|
"accept";"accept-charset";"accept-encoding";"accept-language";
Expand Down