cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-3077599 ] Add curl_easy_setoptv

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 28 Sep 2010 22:11:03 +0000

Bugs item #3077599, was opened at 2010-09-28 14:41
Message generated for change (Comment added) made by dfandrich
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3077599&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: portability problem
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jeff A. Marr (jamarr81)
Assigned to: Daniel Stenberg (bagder)
Summary: Add curl_easy_setoptv

Initial Comment:
I am writing a small c++ wrapper for curl and came across an issue with curl_easy_setopt. There is no va_list alternative version of this function making it impossible to encapsulate; see: http://c-faq.com/varargs/handoff.html. To fix this we simply create a va_list version of this function: curl_easy_setoptv. I have attached a very small patch to fix this issue.

----------------------------------------------------------------------

>Comment By: Dan Fandrich (dfandrich)
Date: 2010-09-28 15:11

Message:
Every curl_easy_setopt option except one takes a single argument in the
"variable" argument section (the outlier takes no arguments at all--any
argument will be ignored). So there isn't a problem in encapsulating the
function due to the number of parameters, only the parameter's type, and
that's easy to overcome with polymorphism.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2010-09-28 14:52

Message:
It is not impossible at all. In fact it's even fairly easy. See the
src/main.c:_my_setopt() function for how we do it within the curl tool
source code.

Your function does make it easier but with the fancy type checks we have
for curl_easy_setopt() now and the fact that we can easily work around this
little flaw, I'm not at all convinced we should add this new function you
suggest.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3077599&group_id=976
Received on 2010-09-29

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET