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

Expose closefn function #4

Open
wants to merge 1 commit into
base: v5-backports
Choose a base branch
from

Conversation

gabrielmoise17
Copy link
Owner

@gabrielmoise17 gabrielmoise17 commented Jun 7, 2024

This work has been done together by the following people:
@savvadia
@vect0r-vicall
@picojulien
@johnyob
@raphael-proust

Motivation

cohttp is not closing client-side connections on request in relay connections, which could lead to resource leak.
Exposing the close_fn function is already present in the newer v6 version, so this addition we think is necessary as it allows finer resource management and is likely to be a backport of the feature from v6 to v5.

Solution

cohttp now exposes close_fn defined by Cohttp_lwt.Client.call. This callback should be used when a newly created connection should be closed, thanks to the new Cohttp_lwt.Client.call_with_closefn function.

@gabrielmoise17 gabrielmoise17 self-assigned this Jun 7, 2024
@gabrielmoise17 gabrielmoise17 force-pushed the cohttp-expose-closefn branch from 1a79f14 to ea218db Compare June 7, 2024 14:56
@gabrielmoise17 gabrielmoise17 force-pushed the cohttp-expose-closefn branch from ea218db to 97f8a35 Compare June 10, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants