1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* gpgkeys_curl.c (get_key, writer): New function to wrap around fwrite to

avoid DLL access problem on win32.

* gpgkeys_http.c (main, get_key): Properly pass authentication info
through to the http library.
This commit is contained in:
David Shaw 2004-12-22 18:07:21 +00:00
parent b96038387b
commit 0361c6f01b
3 changed files with 24 additions and 4 deletions

View file

@ -62,6 +62,14 @@ curl_err_to_gpg_err(CURLcode error)
}
}
/* We wrap fwrite so to avoid DLL problems on Win32 (see curl faq for
more). */
static size_t
writer(const void *ptr,size_t size,size_t nmemb,void *stream)
{
return fwrite(ptr,size,nmemb,stream);
}
static int
get_key(char *getkey)
{
@ -77,7 +85,7 @@ get_key(char *getkey)
host,port[0]?":":"",port[0]?port:"",path[0]?"":"/",path);
curl_easy_setopt(curl,CURLOPT_URL,request);
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,fwrite);
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,writer);
curl_easy_setopt(curl,CURLOPT_FILE,output);
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errorbuffer);