diff options
Diffstat (limited to 'keyserver/gpgkeys_curl.c')
-rw-r--r-- | keyserver/gpgkeys_curl.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/keyserver/gpgkeys_curl.c b/keyserver/gpgkeys_curl.c index 1d206e0c5..1d7544550 100644 --- a/keyserver/gpgkeys_curl.c +++ b/keyserver/gpgkeys_curl.c @@ -123,6 +123,7 @@ main(int argc,char *argv[]) char line[MAX_LINE]; char *thekey=NULL; unsigned int timeout=DEFAULT_KEYSERVER_TIMEOUT; + long follow_redirects=5; console=stderr; @@ -269,8 +270,19 @@ main(int argc,char *argv[]) { if(no) timeout=0; - else + else if(start[7]=='=') timeout=atoi(&start[8]); + else if(start[7]=='\0') + timeout=DEFAULT_KEYSERVER_TIMEOUT; + } + else if(strncasecmp(start,"follow-redirects",16)==0) + { + if(no) + follow_redirects=0; + else if(start[16]=='=') + follow_redirects=atoi(&start[17]); + else if(start[16]=='\0') + follow_redirects=-1; } continue; @@ -312,6 +324,14 @@ main(int argc,char *argv[]) goto fail; } + if(follow_redirects) + { + curl_easy_setopt(curl,CURLOPT_FOLLOWLOCATION,1); + if(follow_redirects>0) + curl_easy_setopt(curl,CURLOPT_MAXREDIRS,follow_redirects); + } + + /* If it's a GET or a SEARCH, the next thing to come in is the keyids. If it's a SEND, then there are no keyids. */ |