Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt ocaml-conduit 5.0.0 #787

Merged
merged 1 commit into from
Nov 4, 2021
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
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