curl / Mailing Lists / curl-library / Single Mail


Re: CURLOPT_VERBOSE and curl_multi_cleanup()

From: Kristoffer Gleditsch via curl-library <>
Date: Thu, 09 May 2019 13:06:52 +0200

Daniel Stenberg writes:

> 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?

For our particular case, a number of different approaches would work:

If the share handle offered a way to access the closure handle, we would
probably use that to set DEBUGFUNCTION on it and get the debug output
sent where we want it.

Debug output from teardown is not critical to us, so just never setting
VERBOSE on the closure handle would be OK as well.

Adding bits to the CURLOPT_VERBOSE parameter to control the verbose flag
in the closure handle would also work. It wouldn't help someone for
whom the previous paragraph isn't true, though, i.e. someone who needs
that debugging output sent to their DEBUGFUNCTION.


Received on 2019-05-09