Skip to content

Expose CURL handle to write function via Handler #613

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bdbai
Copy link

@bdbai bdbai commented Jun 15, 2025

This PR adds a new provided method write_context to Handler. In addition to the data buffer, it passes a context reference to the Handler which allows the Handler to act on the raw handle inside the callback.

I need this capability to as part of the ongoing WebSockets support. When working with the writefunction model, users should be able to get metadata from curl_ws_meta or perform a blocking send using curl_ws_send from inside the write function callback. With the context object, we can park these two methods under there.

While this PR is not directly related to WebSockets, the access to the raw handle would be handy in certain cases.

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.

1 participant