From a401f768ca8e218eef7a5c87a8f99cb1d6b4aaeb Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 14 Mar 2014 16:12:54 +0100 Subject: 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. --- dirmngr/ks-engine-hkp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'dirmngr') 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; -- cgit v1.2.3