mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* ksutil.h, ksutil.c (ks_action_to_string): New. (free_ks_options): Only
free if options exist.
This commit is contained in:
parent
8ba895c763
commit
4f347281a9
3 changed files with 31 additions and 13 deletions
|
@ -85,13 +85,16 @@ init_ks_options(void)
|
|||
void
|
||||
free_ks_options(struct ks_options *opt)
|
||||
{
|
||||
free(opt->host);
|
||||
free(opt->port);
|
||||
free(opt->scheme);
|
||||
free(opt->auth);
|
||||
free(opt->path);
|
||||
free(opt->ca_cert_file);
|
||||
free(opt);
|
||||
if(opt)
|
||||
{
|
||||
free(opt->host);
|
||||
free(opt->port);
|
||||
free(opt->scheme);
|
||||
free(opt->auth);
|
||||
free(opt->path);
|
||||
free(opt->ca_cert_file);
|
||||
free(opt);
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns 0 if we "ate" the line. Returns >0, a KEYSERVER_ error
|
||||
|
@ -109,11 +112,6 @@ parse_ks_options(char *line,struct ks_options *opt)
|
|||
char path[URLMAX_PATH+1];
|
||||
char option[MAX_OPTION+1];
|
||||
|
||||
#if 0
|
||||
if(sscanf(line,"%c",&hash)==1 && hash=='#')
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if(line[0]=='#')
|
||||
return 0;
|
||||
|
||||
|
@ -267,3 +265,17 @@ parse_ks_options(char *line,struct ks_options *opt)
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *
|
||||
ks_action_to_string(enum ks_action action)
|
||||
{
|
||||
switch(action)
|
||||
{
|
||||
case KS_UNKNOWN: return "UNKNOWN";
|
||||
case KS_GET: return "GET";
|
||||
case KS_SEND: return "SEND";
|
||||
case KS_SEARCH: return "SEARCH";
|
||||
}
|
||||
|
||||
return "?";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue