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

cohttp-lwt: Don't leak asynchronous exceptions. #995

Merged
merged 1 commit into from
Aug 8, 2023
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
8 changes: 4 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Unreleased

- cohttp-lwt: Do not leak `Retry` exceptions to `Lwt.async_exception_hook`. (mefyl #992)
- cohttp-lwt: Do not leak exceptions to `Lwt.async_exception_hook`. (mefyl #992, #995)

## v6.0.0~alpha2 (2023-07-1)
- http.header: introduce "iter_ord" to guarantee iteration following the order of the entries in the headers (mseri #986)
Expand Down Expand Up @@ -34,7 +34,7 @@
- cohttp-eio: convert to Eio.Buf_read (talex5 #882)
- cohttp lwt client: Connection cache and explicit pipelining (madroach #853)
- http: add Http.Request.make and simplify Http.Response.make (bikallem mseri #878)
- http: add pretty printer functions (bikallem #880)
- http: add pretty printer functions (bikallem #880)
- New eio based client and server on top of the http library (bikallem #857)
- New curl based clients (rgrinberg #813)
+ cohttp-curl-lwt for an Lwt backend
Expand Down Expand Up @@ -117,10 +117,10 @@
+ ```clean_dup``` enables the user to clean headers that follows the {{:https://tools.ietf.org/html/rfc7230#section-3.2.2} RFC7230§3.2.2} (no duplicate, except ```set-cookie```)
+ ```get_multi_concat``` has been added to get a result similar to the previous ```get``` function.

- Cohttp.Header: performance improvement (mseri, anuragsoni #778)
- Cohttp.Header: performance improvement (mseri, anuragsoni #778)
**Breaking** the headers are no-longer lowercased when parsed, the headers key comparison is case insensitive instead.

- cohttp-lwt-unix: Adopt ocaml-conduit 5.0.0 (smorimoto #787)
- cohttp-lwt-unix: Adopt ocaml-conduit 5.0.0 (smorimoto #787)
**Breaking** `Conduit_lwt_unix.connect`'s `ctx` param type chaged from `ctx` to `ctx Lazy.t`

- cohttp-mirage: fix deprecated fmt usage (tmcgilchrist #783)
Expand Down
7 changes: 4 additions & 3 deletions cohttp-lwt/src/connection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,13 @@ module Make (Net : S.Net) : S.Connection with module Net = Net = struct
persistent;
}
in
let on_failure e = connection.state <- Failed e in
Lwt.on_any channels
(fun channels ->
connection.state <- Full channels;
Lwt.async (fun () -> reader connection);
Lwt.async (fun () -> writer connection))
(fun e -> connection.state <- Failed e);
Lwt.dont_wait (fun () -> reader connection) on_failure;
Lwt.dont_wait (fun () -> writer connection) on_failure)
on_failure;
connection

let connect ?finalise ?persistent ?ctx uri =
Expand Down
Loading