From: curl-library <curl-library-boun...@cool.haxx.se> On Behalf Of Idan 
Freiberg via curl-library
Sent: Samstag, 6. Februar 2021 07:23

> I'm using the multi-stack interface in order to read a large response body in 
> chunk, with the help of the CURLOPT_WRITEFUNCTION and some code similar to 
> the one in fcurl project.
> I wonder if its possible to fetch info like response code, cookies, response 
> headers before the running easy handle is done (which means all the response 
> body was read).

> The thing is i'm not sure how to check they are fully received after a 
> curl_multi_perform() call?

I'd use CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION to handle headers and 
body data separately. With that setup, I think it should be safe to assume that 
the response code and all headers are "stable" once the first data chunk has 
been received via the CURLOPT_WRITEFUNCTION.
So just mark the transfer in some way once it has received the first data chunk 
and then check this mark after curl_multi_perform returns.
(You could do a linear scan over all pending transfers. Or, if you have a lot 
of concurrently pending transfers, you could use a "ready list" where you 
insert transfers that have just received their first data chunk.)

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it. Dynatrace Austria GmbH (registration number FN 91482h) is a 
company registered in Linz whose registered office is at 4020 Linz, Austria, Am 
Fünfundzwanziger Turm 20

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to