curl / Mailing Lists / curl-library / Single Mail


CURLOPT_VERBOSE and curl_multi_cleanup()

From: Kristoffer Gleditsch \(kgledits\) via curl-library <>
Date: Wed, 8 May 2019 10:27:51 +0000


We are using libcurl and multi handles in an application where we want
debugging output and control over where that output is sent. We do
this by setting CURLOPT_VERBOSE and CURLOPT_DEBUGFUNCTION, which sends
all the output to our logging code.

After and, 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 , 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?


Received on 2019-05-08