cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: unsetting/resetting parameters

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 15 Dec 2003 09:58:12 +0100 (CET)

On Mon, 15 Dec 2003, Roch Mangenot wrote:

> I am using libcurl in one of my applications to perform HTTP requests. I
> read documentation on how to set options with curl_easy_setopt and found out
> that those options are "not in any way reset between transfers". So I was
> wondering if there were any way to reset or unset some options so that they
> are not used in the following tranfers.

Most (if not all) options that take a pointer, accept a NULL as a way to reset
back to the internal defaults.

Options that take a number don't have any easy ways to revert back to default.
You need to set them to a value you prefer.

> I encountered problems with the TIMECONDITION that I want to use on some
> transfers but not on every ones. I then set the time value to 0 (Thu, 01 Jan
> 1970 00:00:00) on transfers I did not want to set TIMECONDITION but it
> sounds like an odd way to me.

TIMEVALUE cannot be used to disable TIMEECONDITION. You should however be able
to set TIMECONDITION to CURL_TIMECOND_NONE to disable the use of time
conditions.

> And now I am looking for a way to unset USERPWD option for transfers that
> dont require autentification. setting USERPWD to "" do prompt me for
> password and I can't allow that in my application...

You're using a too old libcurl! ;-) USERPWD set to NULL in a recent version
will reset it back to internal default: no password, no user.

Previous versions of libcurl had password prompting functionality, but that
was then.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-15