mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* ksutil.h, ksutil.c (curl_writer), gpgkeys_curl.c (get_key): Pass a
context to curl_writer so we can support multiple fetches in a single session.
This commit is contained in:
parent
f50e99ed7b
commit
5609f5eafd
4 changed files with 39 additions and 18 deletions
|
@ -48,6 +48,9 @@ get_key(char *getkey)
|
|||
CURLcode res;
|
||||
char errorbuffer[CURL_ERROR_SIZE];
|
||||
char request[MAX_URL];
|
||||
struct curl_writer_ctx ctx;
|
||||
|
||||
memset(&ctx,0,sizeof(ctx));
|
||||
|
||||
if(strncmp(getkey,"0x",2)==0)
|
||||
getkey+=2;
|
||||
|
@ -62,7 +65,8 @@ get_key(char *getkey)
|
|||
|
||||
curl_easy_setopt(curl,CURLOPT_URL,request);
|
||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
||||
curl_easy_setopt(curl,CURLOPT_FILE,output);
|
||||
ctx.stream=output;
|
||||
curl_easy_setopt(curl,CURLOPT_FILE,&ctx);
|
||||
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errorbuffer);
|
||||
|
||||
res=curl_easy_perform(curl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue