curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Range requests and proxies

From: Samuel Hurst via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 3 Oct 2018 14:33:49 +0100

Hi Daniel,

Thanks for the quick response!

On 03/10/18 13:51, Daniel Stenberg wrote:
> You *can* actually use CURLINFO_RESPONSE_CODE or
> CURLINFO_HTTP_CONNECTCODE as soon as libcurl has received those status
> lines (and thus parsed and stored the number).
>
> I think we should update the docs to make it clear that these two
> informations will be available as soon as libcurl has parsed them.
> Before that, they will return zero.

So in my particular case, would you suggest getting
CURLINFO_RESPONSE_CODE in the first call to write_callback? Or could I
loop on calling it in my header callback until RESPONSE_CODE returns
non-zero? How is that handled lower down, I'm guessing curl knows that
the first response will be from the proxy, and will only fill in the
response code when it's sure it's talking to the intended origin?

-Sam
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-10-03