curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

libcurl multi - PUSHFUNCTION callback

From: Jonathan Cardoso via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 25 Jun 2020 22:07:50 -0300

Hi everyone.

From looking at the source code related to the CURLMOPT_PUSHFUNCTION callback, looks like there is no way to signal libcurl to cancel the request with an error from inside it, is that the case? 

The value returned from the callback is simply "ignored":
https://github.com/curl/curl/blob/646cc574f0b72723906224824a57cd37ee88e9df/lib/http2.c#L553-L571

https://github.com/curl/curl/blob/646cc574f0b72723906224824a57cd37ee88e9df/lib/http2.c#L605-L606

https://github.com/curl/curl/blob/646cc574f0b72723906224824a57cd37ee88e9df/lib/http2.c#L738-L746

Is that by design?

Context: I'm adding this option to the Node.js bindings of libcurl (node-libcurl), and I need to handle the scenario where the binding user's callback throws an error. Currently looks like the only thing that can be done is to DENY the pushed frame, but I wanted to cancel the connection and return an error to the user (curl_multi_info_read data.result would give me something other than CURLE_OK).

Thanks in advance for any help.

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-06-26