From 668deeded9742e811a786f97a917c59793fcd9ff Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 19 Sep 2023 16:14:01 +0200 Subject: dirmngr: Improve error codes returned from http fetching. * dirmngr/ks-engine-http.c (ks_http_fetch): Return better error codes. * dirmngr/ks-engine-hkp.c (send_request): Ditto. * dirmngr/t-http.c (main): New option --try-proxy. --- dirmngr/t-http.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dirmngr/t-http.c') diff --git a/dirmngr/t-http.c b/dirmngr/t-http.c index 7f3aa005d..f9c59783f 100644 --- a/dirmngr/t-http.c +++ b/dirmngr/t-http.c @@ -288,6 +288,11 @@ main (int argc, char **argv) my_http_flags |= HTTP_FLAG_FORCE_TOR; argc--; argv++; } + else if (!strcmp (*argv, "--try-proxy")) + { + my_http_flags |= HTTP_FLAG_TRY_PROXY; + argc--; argv++; + } else if (!strcmp (*argv, "--no-out")) { no_out = 1; -- cgit v1.2.3 From 53bdb7440cbe18f73548169528167190d70998ed Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 2 Oct 2023 12:53:41 +0200 Subject: dirmngr: Extended the http_get_header function. * dirmngr/http.c (send_request): Add arg 'skip'. Adjust all callers. -- GnuPG-bug-id: 6719 --- dirmngr/t-http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dirmngr/t-http.c') diff --git a/dirmngr/t-http.c b/dirmngr/t-http.c index f9c59783f..3cc4be23a 100644 --- a/dirmngr/t-http.c +++ b/dirmngr/t-http.c @@ -463,7 +463,7 @@ main (int argc, char **argv) log_fatal ("http_get_header_names failed: %s\n", gpg_strerror (gpg_error_from_syserror ())); for (i = 0; names[i]; i++) - printf ("HDR: %s: %s\n", names[i], http_get_header (hd, names[i])); + printf ("HDR: %s: %s\n", names[i], http_get_header (hd, names[i], 0)); xfree (names); } fflush (stdout); @@ -489,7 +489,7 @@ main (int argc, char **argv) case 301: case 302: case 307: - log_info ("Redirected to: %s\n", http_get_header (hd, "Location")); + log_info ("Redirected to: %s\n", http_get_header (hd, "Location", 0)); break; } http_close (hd, 0); -- cgit v1.2.3