dirmngr: Better for error code for http status 413.
authorWerner Koch <wk@gnupg.org>
Fri, 29 Mar 2019 13:20:47 +0000 (14:20 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 29 Mar 2019 13:20:47 +0000 (14:20 +0100)
* dirmngr/ks-engine-hkp.c (send_request): New case for 413.
* dirmngr/ks-engine-http.c (ks_http_fetch): Ditto.
* dirmngr/ocsp.c (do_ocsp_request): Ditto.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/ks-engine-hkp.c
dirmngr/ks-engine-http.c
dirmngr/ocsp.c

index 4d660b8..0a360f0 100644 (file)
@@ -1313,6 +1313,10 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
       err = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
       goto leave;
 
+    case 413:  /* Payload too large */
+      err = gpg_error (GPG_ERR_TOO_LARGE);
+      goto leave;
+
     default:
       log_error (_("error accessing '%s': http status %u\n"),
                  request, http_get_status_code (http));
index 0f3e2db..a84a3a1 100644 (file)
@@ -174,6 +174,10 @@ 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));
index 79c252d..dbd8c97 100644 (file)
@@ -238,6 +238,10 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
               }
               break;
 
+            case 413:  /* Payload too large */
+              err = gpg_error (GPG_ERR_TOO_LARGE);
+              break;
+
             default:
               log_error (_("error accessing '%s': http status %u\n"),
                          url, http_get_status_code (http));