diff options
author | NIIBE Yutaka <[email protected]> | 2023-05-01 02:39:24 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-05-01 02:39:24 +0000 |
commit | 0fe99d69f0c8c6d882305d03032bbdaaa1f06954 (patch) | |
tree | 54d897b5c54d27ccae804aef0d06ef8e4cd8b1cc | |
parent | common: Fix parsing ECC key. (diff) | |
download | gnupg-0fe99d69f0c8c6d882305d03032bbdaaa1f06954.tar.gz gnupg-0fe99d69f0c8c6d882305d03032bbdaaa1f06954.zip |
dirmngr: Fix API of functions wrt their error type.
* dirmngr/crlcache.h (fakecrl_isvalid): Fix return type.
* dirmngr/http.c (parse_response): Fix return type to gpg_error_t,
modifying the function implementation.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | dirmngr/crlcache.h | 6 | ||||
-rw-r--r-- | dirmngr/http.c | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/dirmngr/crlcache.h b/dirmngr/crlcache.h index 375943462..9cc063aff 100644 --- a/dirmngr/crlcache.h +++ b/dirmngr/crlcache.h @@ -70,9 +70,9 @@ gpg_error_t crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert); /*-- fakecrl.c --*/ -crl_cache_result_t fakecrl_isvalid (ctrl_t ctrl, - const char *issuer_hash, - const char *cert_id); +gpg_error_t fakecrl_isvalid (ctrl_t ctrl, + const char *issuer_hash, + const char *cert_id); diff --git a/dirmngr/http.c b/dirmngr/http.c index 20f71f61b..b4c501736 100644 --- a/dirmngr/http.c +++ b/dirmngr/http.c @@ -2555,7 +2555,7 @@ http_get_header_names (http_t hd) * Parse the response from a server. * Returns: Errorcode and sets some files in the handle */ -static gpg_err_code_t +static gpg_error_t parse_response (http_t hd) { char *line, *p, *p2; @@ -2579,11 +2579,11 @@ parse_response (http_t hd) len = es_read_line (hd->fp_read, &hd->buffer, &hd->buffer_size, &maxlen); line = hd->buffer; if (!line) - return gpg_err_code_from_syserror (); /* Out of core. */ + return gpg_error_from_syserror (); /* Out of core. */ if (!maxlen) - return GPG_ERR_TRUNCATED; /* Line has been truncated. */ + return gpg_error (GPG_ERR_TRUNCATED); /* Line has been truncated. */ if (!len) - return GPG_ERR_EOF; + return gpg_error (GPG_ERR_EOF); if (opt_debug || (hd->flags & HTTP_FLAG_LOG_RESP)) log_debug_string (line, "http.c:response:\n"); @@ -2623,10 +2623,10 @@ parse_response (http_t hd) len = es_read_line (hd->fp_read, &hd->buffer, &hd->buffer_size, &maxlen); line = hd->buffer; if (!line) - return gpg_err_code_from_syserror (); /* Out of core. */ + return gpg_error_from_syserror (); /* Out of core. */ /* Note, that we can silently ignore truncated lines. */ if (!len) - return GPG_ERR_EOF; + return gpg_error (GPG_ERR_EOF); /* Trim line endings of empty lines. */ if ((*line == '\r' && line[1] == '\n') || *line == '\n') *line = 0; @@ -2637,7 +2637,7 @@ parse_response (http_t hd) { gpg_err_code_t ec = store_header (hd, line); if (ec) - return ec; + return gpg_error (ec); } } while (len && *line); |