cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problem with CURLOPT_USERPWD

From: Georg Horn <horn_at_koblenz-net.de>
Date: Fri, 13 Jun 2003 18:38:53 +0200

Hi,

i have the following snippet of code:

reload:
if (Curl::easy::perform($curl) == 0) {
    my $http_code;
    Curl::easy::getinfo($curl, Curl::easy::CURLINFO_HTTP_CODE, $httpcode);
    if ($httpcode == 401) {
        # Authorization required
        Curl::easy::setopt($curl, Curl::easy::CURLOPT_USERPWD, "$user:$pwd")
        goto reload;
    }
    # ...
} else {
    # ...
}

and it doesn't work. I have set CURLOPT_VERBOSE, and i can see that the same
request is sent over and over again, without any "Authorization: Basic ..."
Header. I have to close and reopen the connection, set all the options
again (inclusive the CURLOPT_USERPWD) to make it work. What am i doing wrong,
or is this a bug? I'm still using a quite old version of curl: 7.9.8...

Bye,
Georg

-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-06-13