aboutsummaryrefslogtreecommitdiffstats
path: root/keyserver/gpgkeys_finger.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyserver/gpgkeys_finger.c')
-rw-r--r--keyserver/gpgkeys_finger.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/keyserver/gpgkeys_finger.c b/keyserver/gpgkeys_finger.c
index d0755edaa..43158cf90 100644
--- a/keyserver/gpgkeys_finger.c
+++ b/keyserver/gpgkeys_finger.c
@@ -44,6 +44,7 @@
#define INCLUDED_BY_MAIN_MODULE 1
#include "util.h"
#include "keyserver.h"
+#include "ksutil.h"
#ifdef _WIN32
#define sock_close(a) closesocket(a)
@@ -51,7 +52,6 @@
#define sock_close(a) close(a)
#endif
-
extern char *optarg;
extern int optind;
@@ -65,7 +65,6 @@ static FILE *input, *output, *console;
#define BEGIN "-----BEGIN PGP PUBLIC KEY BLOCK-----"
#define END "-----END PGP PUBLIC KEY BLOCK-----"
-
#ifdef _WIN32
static void
deinit_sockets (void)
@@ -364,6 +363,7 @@ main(int argc,char *argv[])
int arg,action=-1,ret=KEYSERVER_INTERNAL_ERROR;
char line[MAX_LINE];
char *thekey=NULL;
+ unsigned int timeout=DEFAULT_KEYSERVER_TIMEOUT;
console=stderr;
@@ -472,11 +472,24 @@ main(int argc,char *argv[])
else
verbose++;
}
+ else if(strncasecmp(start,"timeout",7)==0)
+ {
+ if(no)
+ timeout=0;
+ else
+ timeout=atoi(&start[8]);
+ }
continue;
}
}
+ if(timeout && register_timeout()==-1)
+ {
+ fprintf(console,"gpgkeys: unable to register timeout handler\n");
+ return KEYSERVER_INTERNAL_ERROR;
+ }
+
/* 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. */
@@ -534,6 +547,8 @@ main(int argc,char *argv[])
fprintf(console,"Command:\tGET\n");
}
+ set_timeout(timeout);
+
ret = get_key(thekey);
fail: