curl / Mailing Lists / curl-library / Single Mail


Re: print curl_easy_setopt in debug function

From: Tejas <>
Date: Mon, 11 Jun 2018 13:30:55 -0400

> > > If libcurl should do this, I think I'd argue for requiring some extra knob to
> > >
> > > be turned on first before it gets sent to the debug callback/output.
> > How about printing it with a new enum in curl_infotype::CURLINFO_OPTIONS, so
> >
> > people who want it can print it out and have their own switch for it.
> I don't understand what you mean. Can you show with some psedo code or
> something how to imagine that would work?
> > I Experimented a bit by adding Curl_debug(...) to Curl_vsetopt(...) but it
> >
> > seems that it requires struct connectdata*, How could I get this data in
> >
> > Curl_vsetopt(...)?
> You can't. curl_easy_setopt() is called before there is any connection.
> Curl_debug() needs to be adjusted to be able to work without a struct
> connectdata* pointer for this to work.

I will probably provide a pseudo-code in some time if I can.
I feel that Curl_debug should not need the struct connectdata. It is only using it to get "data->set.printhost && conn && conn->host.dispname" And "data->set.printhost" is always 0.

The corresponding code to set it in lib/url.c seems to have been removed in 5e0d9aea3 ("Support for FTP third party transfers is now dropped", 2006-09-30)

- Tejas

Received on 2018-06-11