summaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-http.c
diff options
context:
space:
mode:
Diffstat (limited to 'dirmngr/ks-engine-http.c')
-rw-r--r--dirmngr/ks-engine-http.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/dirmngr/ks-engine-http.c b/dirmngr/ks-engine-http.c
index c96625d..bb7a033 100644
--- a/dirmngr/ks-engine-http.c
+++ b/dirmngr/ks-engine-http.c
@@ -179,7 +179,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, unsigned int flags,
{
xfree (request_buffer);
err = http_prepare_redirect (&redirinfo, http_get_status_code (http),
- http_get_header (http, "Location"),
+ http_get_header (http, "Location", 0),
&request_buffer);
if (err)
goto leave;
@@ -192,14 +192,16 @@ ks_http_fetch (ctrl_t ctrl, const char *url, unsigned int flags,
}
goto once_more;
- case 413: /* Payload too large */
- err = gpg_error (GPG_ERR_TOO_LARGE);
- goto leave;
-
default:
log_error (_("error accessing '%s': http status %u\n"),
url, http_get_status_code (http));
- err = gpg_error (GPG_ERR_NO_DATA);
+ switch (http_get_status_code (http))
+ {
+ case 401: err = gpg_error (GPG_ERR_NO_AUTH); break;
+ case 407: err = gpg_error (GPG_ERR_BAD_AUTH); break;
+ case 413: err = gpg_error (GPG_ERR_TOO_LARGE); break;
+ default: err = gpg_error (GPG_ERR_NO_DATA); break;
+ }
goto leave;
}