1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-29 02:22:45 +02:00

* curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform): Add

CURLOPT_USERPWD option for HTTP auth.
This commit is contained in:
David Shaw 2005-06-23 04:44:20 +00:00
parent ffa6854080
commit d65763eccd
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2005-06-23 David Shaw <dshaw@jabberwocky.com> 2005-06-23 David Shaw <dshaw@jabberwocky.com>
* curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform):
Add CURLOPT_USERPWD option for HTTP auth.
* gpgkeys_http.c (get_key), gpgkeys_oldhkp (send_key, get_key, * gpgkeys_http.c (get_key), gpgkeys_oldhkp (send_key, get_key,
search_key): No longer need to pass a proxyauth. search_key): No longer need to pass a proxyauth.

View File

@ -104,6 +104,9 @@ curl_easy_setopt(CURL *curl,CURLoption option,...)
case CURLOPT_URL: case CURLOPT_URL:
curl->url=va_arg(ap,char *); curl->url=va_arg(ap,char *);
break; break;
case CURLOPT_USERPWD:
curl->auth=va_arg(ap,char *);
break;
case CURLOPT_WRITEFUNCTION: case CURLOPT_WRITEFUNCTION:
curl->writer=va_arg(ap,write_func); curl->writer=va_arg(ap,write_func);
break; break;
@ -142,7 +145,7 @@ curl_easy_perform(CURL *curl)
if(curl->flags.post) if(curl->flags.post)
{ {
rc=http_open(&curl->hd,HTTP_REQ_POST,curl->url,0,curl->proxy); rc=http_open(&curl->hd,HTTP_REQ_POST,curl->url,curl->auth,0,curl->proxy);
if(rc==0) if(rc==0)
{ {
char content_len[50]; char content_len[50];
@ -163,7 +166,7 @@ curl_easy_perform(CURL *curl)
} }
else else
{ {
rc=http_open(&curl->hd,HTTP_REQ_GET,curl->url,0,curl->proxy); rc=http_open(&curl->hd,HTTP_REQ_GET,curl->url,curl->auth,0,curl->proxy);
if(rc==0) if(rc==0)
{ {
rc=http_wait_response(&curl->hd,&curl->status); rc=http_wait_response(&curl->hd,&curl->status);

View File

@ -36,6 +36,7 @@ typedef enum
typedef enum typedef enum
{ {
CURLOPT_URL, CURLOPT_URL,
CURLOPT_USERPWD,
CURLOPT_WRITEFUNCTION, CURLOPT_WRITEFUNCTION,
CURLOPT_FILE, CURLOPT_FILE,
CURLOPT_ERRORBUFFER, CURLOPT_ERRORBUFFER,
@ -57,6 +58,7 @@ typedef size_t (*write_func)(char *buffer,size_t size,
typedef struct typedef struct
{ {
char *url; char *url;
char *auth;
char *errorbuffer; char *errorbuffer;
char *proxy; char *proxy;
write_func writer; write_func writer;