cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http headers free and multi

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Sat, 14 Oct 2006 07:09:07 -0500

> All these values are set with "curl_easy_setopt(CURLOPT_FOO)".
> Why can't they be retrieved with "curl_easy_getopt(CURLOPT_FOO).
> No new constants need be invented.

Not all of the setopt's make sense as getopt's.
For instance, if I do a simple http download without
explicitly setting the port number, what would you
expect curl_easy_getinfo(CURLOPT_PORT) to return?
Some people might think 80, because that's the port
libcurl used, others might think 0, because the
port wasn't specified. Of course, you could argue
to only return values for (potentially) dynamic data,
but that sounds a bit tricky to document. If
I don't set USER_AGENT, but I pass a header list
that contains a "User-Agent: foo" field, what
does curl_easy_getinfo(CURLOPT_USERAGENT) return?
If it's NULL, does that mean the header was ignored?
If it's non-null, should it be free'd?

Sounds like a real can of worms to me...

 - Jeff
Received on 2006-10-14