curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_VERBOSE and curl_multi_cleanup()

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 9 May 2019 08:40:00 +0200 (CEST)

On Wed, 8 May 2019, Kristoffer Gleditsch (kgledits) via curl-library wrote:

> After https://github.com/curl/curl/pull/3618 and
> https://github.com/curl/curl/pull/3598, we started getting '* Closing
> connection 0' messages on STDERR when curl_multi_cleanup() closes the
> connections in the connection cache. This is because the verbose flag is
> copied to the closure_handle but fdebug etc. are not. The reason for this
> is pretty well explained in
> https://github.com/curl/curl/pull/3598#issuecomment-466301175 , but the
> result is that we have no way controlling where the verbose output from the
> closure_handle goes.
>
> One workaround is to add and remove a dummy easy_handle with
> CURLOPT_VERBOSE=0 before doing curl_multi_cleanup(); this will at least
> silence the output on STDERR. But should there be a proper interface for
> controlling this?

Thanks Kristoffer for clearly explaining the issue. I agree that we need to do
something about this.

The concept with an internal "close handle" is a bit unfortunate since it has
its own set of options and we've opted to let it "inherit" some of the options
from the most recently added handle. It's not documented properly anywhere as
it was meant to just be an internal design descision that shouldn't affect
users, but I think in reality it does.

We decided to not copy the debug callback to the close handle since it could
come as a surprise to application that it could be called even after the
handle in which it was set had been killed. I fear that would be even worse
than what we have right now.

One *possible* fix to this would be to not to set the VERBOSE bit if the
debugcallback is set. Not sure that goes far enough.

Another option is to revert that change and go back to the previous behavior,
and then add a second bit to the CURLOPT_VERBOSE argument that then could set
VERBOSE to the close handle if set...

What do you think would be a fair fix for your case?

-- 
  / daniel.haxx.se | Get the best commercial curl support there is - from me
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-05-09