1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* gpgkeys_curl.c, gpgkeys_finger.c, gpgkeys_ldap.c: Start using

parse_ks_options and remove a lot of common code.

* ksutil.h, ksutil.c (parse_ks_options): Parse OPAQUE, and default
debug with no arguments to 1.
This commit is contained in:
David Shaw 2005-03-17 16:42:41 +00:00
parent 166876a9fd
commit efa0dd21a2
6 changed files with 253 additions and 478 deletions

View file

@ -110,6 +110,7 @@ parse_ks_options(char *line,struct ks_options *opt)
char scheme[MAX_SCHEME+1];
char auth[MAX_AUTH+1];
char path[URLMAX_PATH+1];
char opaque[MAX_OPAQUE+1];
char option[MAX_OPTION+1];
if(line[0]=='#')
@ -174,6 +175,15 @@ parse_ks_options(char *line,struct ks_options *opt)
return 0;
}
if(sscanf(line,"OPAQUE %" MKSTRING(MAX_OPAQUE) "s\n",opaque)==1)
{
opaque[MAX_OPAQUE]='\0';
opt->opaque=strdup(opaque);
if(!opt->opaque)
return KEYSERVER_NO_MEMORY;
return 0;
}
if(sscanf(line,"VERSION %d\n",&version)==1)
{
if(version!=KEYSERVER_PROTO_VERSION)
@ -236,6 +246,8 @@ parse_ks_options(char *line,struct ks_options *opt)
opt->debug=0;
else if(start[5]=='=')
opt->debug=atoi(&start[6]);
else if(start[5]=='\0')
opt->debug=1;
}
else if(strncasecmp(start,"timeout",7)==0)
{