647 |
} |
} |
648 |
|
|
649 |
|
|
650 |
|
/* Return the specified keyserver config setting @key as an integer. */ |
651 |
|
static int |
652 |
|
get_conf_kserver_int (const char *key) |
653 |
|
{ |
654 |
|
char *p; |
655 |
|
int val = 0; |
656 |
|
|
657 |
|
p = get_reg_entry_keyserver (key); |
658 |
|
if (p && *p) |
659 |
|
val = atoi (p); |
660 |
|
free_if_alloc (p); |
661 |
|
return val; |
662 |
|
} |
663 |
|
|
664 |
|
|
665 |
|
/* Read the proxy configuration and store it into @prox. */ |
666 |
|
static void |
667 |
|
read_proxy_config (keyserver_proxy_t prox) |
668 |
|
{ |
669 |
|
char *proto; |
670 |
|
|
671 |
|
if (!prox) |
672 |
|
return; |
673 |
|
|
674 |
|
proto = get_reg_entry_keyserver("Proto"); |
675 |
|
if (proto != NULL && strlen (proto) > 0) |
676 |
|
prox->proto = atoi (proto); |
677 |
|
else |
678 |
|
prox->proto = PROXY_PROTO_NONE; |
679 |
|
free_if_alloc (proto); |
680 |
|
free_if_alloc (prox->host); |
681 |
|
prox->host = get_reg_entry_keyserver ("Host"); |
682 |
|
free_if_alloc (prox->user); |
683 |
|
prox->user = get_reg_entry_keyserver ("User"); |
684 |
|
free_if_alloc (prox->pass); |
685 |
|
prox->pass = get_reg_entry_keyserver ("Pass"); |
686 |
|
prox->port = get_conf_kserver_int ("Port"); |
687 |
|
} |
688 |
|
|
689 |
|
|
690 |
/* Load the keyserver config file @conf. */ |
/* Load the keyserver config file @conf. */ |
691 |
int |
int |
692 |
kserver_load_conf (const char *conf) |
kserver_load_conf (const char *conf) |
711 |
} |
} |
712 |
no_config=1; |
no_config=1; |
713 |
} |
} |
714 |
get_reg_proxy_prefs (&proxy); |
read_proxy_config (&proxy); |
715 |
if (user && pass) |
if (user && pass) |
716 |
update_proxy_user (user, pass); |
update_proxy_user (user, pass); |
717 |
else if (user && !pass || !user && pass) { |
else if (user && !pass || !user && pass) { |