diff options
author | David Shaw <[email protected]> | 2004-12-22 18:07:21 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-12-22 18:07:21 +0000 |
commit | 0361c6f01b94ebf6a390caf4524b2369233218ae (patch) | |
tree | 2d179a37c255cde99f1d939d7accd915f01b1840 /keyserver/gpgkeys_curl.c | |
parent | * keyserver.c (keyserver_typemap): New. Map certain keyserver types to a (diff) | |
download | gnupg-0361c6f01b94ebf6a390caf4524b2369233218ae.tar.gz gnupg-0361c6f01b94ebf6a390caf4524b2369233218ae.zip |
* 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.
Diffstat (limited to 'keyserver/gpgkeys_curl.c')
-rw-r--r-- | keyserver/gpgkeys_curl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/keyserver/gpgkeys_curl.c b/keyserver/gpgkeys_curl.c index c1e2840ff..1d206e0c5 100644 --- a/keyserver/gpgkeys_curl.c +++ b/keyserver/gpgkeys_curl.c @@ -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); |