cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Debugging tip for HTTPAUTH problem? ---- INCORRECT

From: mitz wark <peb_p2000_at_yahoo.com>
Date: Wed, 14 Jan 2004 11:28:11 -0800 (PST)

My sincere appologies for my previous false email.......
We didn't discover an alternative workaround. My co-worker was using.
CURLOPT_FAILONERROR --- disabled. Duh!!!
 
I'm sorry....
 
mitz
 
 

mitz wark <peb_p2000_at_yahoo.com> wrote:
Hi Daniel and All,
 
Oh..I'm sorry I didn't occur to me this would be in the known_bug list.
 
Incidentally my co-worker discovered an alternative workaround although we don't completely understand why it works:
curl_easy_setopt(mCurlHandle, CURLOPT_NOBODY, (long) 0);
 
Apparently, NODOBY - 0 makes curl uses PUT in the request, insated of HEAD. And it works even if CURLOPT_FAILONERROR enabled. (I verified for Digest authentication).
 
The server is Apache2 on RH9. (if that matters).
 
Thank you,
mitz

Daniel Stenberg <daniel-curl_at_haxx.se> wrote: On Tue, 13 Jan 2004, mitz wark wrote:

> I hope this is not a too trivial question, but I am trying to make 'digest'
> authentication work by using these relatively new curl opt.
>
> curl_easy_setopt(mCurlHandle, CURLOPT_USERPWD, user_pass.c_str());
> curl_easy_setopt(mCurlHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
>
> But appearantly, server is returning, HTTP401 to me, and always fails in this block in 'transfer.c'.
> if (data->set.http_fail_on_error && (k->httpcode >= 400))
> { ........ ..... ....
> return CURLE_HTTP_RETURNED_ERROR
> }

You're experiencing a bug: CURLOPT_FAILONERROR doesn't work with a non-Basic
authentication! This is in fact mentioned in the KNOWN_BUGS document.

Fixing this flaw is not trivial, and this bug is still present in the current
development version.

The work-around is simply to not use CURLOPT_FAILONERROR for these cases.

-- 
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: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
 
 
---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Received on 2004-01-14