curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Behaviour with CURLOPT_FRESH_CONNECT when libcurl performs a request internally

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 3 Dec 2018 10:38:55 +0100 (CET)

On Thu, 29 Nov 2018, John Smith via curl-library wrote:

> - degraded mode where CURLOPT_FRESH_CONNECT is enabled on every HTTP
> request

> I'm having an issue in this mode when the server responds with "HTTP/1.1 401
> Unauthorized" to a GET request I just performed. In that case, libcurl is
> internally performing an HTTP request to send the authorization; and that
> request is made using an already existing connection somehow ignoring the
> FRESH_CONNECT option I passed to the original request.
>
> Is there a way I could force libcurl to open a new connection also when it
> performs a request internally (generally or at least when handling 401)?

Thanks for this report!

Presumably you're also using NTLM or Negotiate authentication too where
disconnecting is really breaking things?

But no, we don't have any external way to change this behavior. I would rather
consider this a bug that we should handle ourselves without the application
having to do anything at all about it. There's code in libcurl that attempts
to act "correctly" when then apparently isn't enough?

https://github.com/curl/curl/blob/847b13024417ea42b0123fcdb33ce53bf12619f7/lib/url.c#L3878

Can you figure out why?

Do you have any public URL we can reproduce this on?

Also, please post this as an issue on github
(https://github.com/curl/curl/issues) so that we don't forget about it!

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