aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-hkp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-03-14 15:12:54 +0000
committerWerner Koch <[email protected]>2014-03-14 15:12:54 +0000
commita401f768ca8e218eef7a5c87a8f99cb1d6b4aaeb (patch)
treed8d9b285a3f2c18cb310f1bd853af85e7f146427 /dirmngr/ks-engine-hkp.c
parentdirmngr: Default to a user socket name and enable autostart. (diff)
downloadgnupg-a401f768ca8e218eef7a5c87a8f99cb1d6b4aaeb.tar.gz
gnupg-a401f768ca8e218eef7a5c87a8f99cb1d6b4aaeb.zip
gpg: Print the actual used keyserver address.
* dirmngr/ks-engine-hkp.c (ks_hkp_search, ks_hkp_get): Print SOURCE status lines. * g10/call-dirmngr.c (ks_status_parm_s): New. (ks_search_parm_s): Add field stparm. (ks_status_cb): New. (ks_search_data_cb): Send source to the data callback. (gpg_dirmngr_ks_search): Change callback prototope to include the SPECIAL arg. Adjust all users. Use ks_status_cb. (gpg_dirmngr_ks_get): Add arg r_source and use ks_status_cb. * g10/keyserver.c (search_line_handler): Adjust callback and print "data source" disgnostic. (keyserver_get): Print data source diagnostic. -- It has often been requested that the actually used IP of a keyservers is shown in with gpg --recv-key and --search-key. This is helpful if the keyserver is actually a pool of keyservers. This patch does this.
Diffstat (limited to 'dirmngr/ks-engine-hkp.c')
-rw-r--r--dirmngr/ks-engine-hkp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 28b05e919..5c4543575 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -454,8 +454,7 @@ mark_host_dead (const char *name)
/* Mark a host in the hosttable as dead or - if ALIVE is true - as
- alive. If the host NAME does not exist a warning status message is
- printed. */
+ alive. */
gpg_error_t
ks_hkp_mark_host (ctrl_t ctrl, const char *name, int alive)
{
@@ -974,6 +973,10 @@ ks_hkp_search (ctrl_t ctrl, parsed_uri_t uri, const char *pattern,
if (err)
goto leave;
+ err = dirmngr_status (ctrl, "SOURCE", hostport, NULL);
+ if (err)
+ goto leave;
+
/* Peek at the response. */
{
int c = es_getc (fp);
@@ -1082,6 +1085,10 @@ ks_hkp_get (ctrl_t ctrl, parsed_uri_t uri, const char *keyspec, estream_t *r_fp)
if (err)
goto leave;
+ err = dirmngr_status (ctrl, "SOURCE", hostport, NULL);
+ if (err)
+ goto leave;
+
/* Return the read stream and close the HTTP context. */
*r_fp = fp;
fp = NULL;