Skip to content

Commit

Permalink
Merge pull request #787 from smorimoto/conduit-5.0.0
Browse files Browse the repository at this point in the history
Adopt ocaml-conduit 5.0.0
  • Loading branch information
mseri authored Nov 4, 2021
2 parents 1d6546d + d025cbf commit 04892de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## current

- cohttp-lwt-unix: Adopt ocaml-conduit 5.0.0 (smorimoto #787)
- cohttp-mirage: fix deprecated fmt usage (tmcgilchrist #783)
- lwt_jsoo: Use logs for the warnings and document it (mseri #776)
- lwt: Use logs to warn users about leaked bodies and document it (mseri #771)
Expand Down
4 changes: 2 additions & 2 deletions cohttp-lwt-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
depends: [
"ocaml" {>= "4.08"}
"dune" {>= "2.0"}
"conduit-lwt" {>= "1.0.3"}
"conduit-lwt-unix" {>= "1.0.3"}
"conduit-lwt" {>= "5.0.0"}
"conduit-lwt-unix" {>= "5.0.0"}
"cmdliner"
"magic-mime"
"logs"
Expand Down
7 changes: 5 additions & 2 deletions cohttp-lwt-unix/src/net.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ module IO = Io
type ctx = { ctx : Conduit_lwt_unix.ctx; resolver : Resolver_lwt.t }
[@@deriving sexp_of]

let init ?(ctx = Conduit_lwt_unix.default_ctx)
let init ?(ctx = Lazy.force Conduit_lwt_unix.default_ctx)
?(resolver = Resolver_lwt_unix.system) () =
{ ctx; resolver }

let default_ctx =
{ resolver = Resolver_lwt_unix.system; ctx = Conduit_lwt_unix.default_ctx }
{
resolver = Resolver_lwt_unix.system;
ctx = Lazy.force Conduit_lwt_unix.default_ctx;
}

let connect_uri ~ctx:{ ctx; resolver } uri =
Resolver_lwt.resolve_uri ~uri resolver >>= fun endp ->
Expand Down

0 comments on commit 04892de

Please sign in to comment.