cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_HTTPAUTH turned into a bitmask

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 17 Jun 2003 19:45:48 +0200 (CEST)

Hey

Ok, to allow libcurl-using applications to pick one or more authentication
methods, I made CURLOPT_HTTPAUTH a bitmask instead:

To enforce Basic:

 curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

To enforce Digest:

 curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);

To make libcurl pick one of Basic or Digest:

 curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);

If only one method is set, libcurl will use that immediately without checking
what the remote site wants. If more than one is selected, libcurl will fetch
the page and then pick one of the selected alternatives in an order libcurl
decides.

CURLAUTH_ANY sets all types (including future ones we might add) and
CURLAUTH_ANYSAFE sets all except Basic.

I've added two simple test cases for this (69 and 70) and the basics seems to
be working.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Received on 2003-06-17