From 2878ef4482bd7436f3327639d1d35420b14110f3 Mon Sep 17 00:00:00 2001 From: Hans Zandbelt Date: Wed, 8 Nov 2023 17:22:01 +0100 Subject: [PATCH] 2.4.15rc4: improve error message in case of curl timeouts Signed-off-by: Hans Zandbelt --- ChangeLog | 4 ++++ configure.ac | 2 +- src/util.c | 12 ++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 784ce0fc..62da5c3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +11/08/2023 +- improve error message in case of curl timeouts +- bump to 2.4.15rc4 + 11/02/2023 - apply ISO-8859-1 ("latin1") as default encoding mechanism for claim values passed in headers and environment variables to comply with https://www.rfc-editor.org/rfc/rfc5987; see #957; use "OIDCPassClaimsAs none" diff --git a/configure.ac b/configure.ac index c0961ace..2dc82613 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mod_auth_openidc],[2.4.15rc3],[hans.zandbelt@openidc.com]) +AC_INIT([mod_auth_openidc],[2.4.15rc4],[hans.zandbelt@openidc.com]) AC_SUBST(NAMEVER, AC_PACKAGE_TARNAME()-AC_PACKAGE_VERSION()) diff --git a/src/util.c b/src/util.c index ddfc3d3d..d6ba5e32 100644 --- a/src/util.c +++ b/src/util.c @@ -1228,12 +1228,16 @@ static apr_byte_t oidc_util_http_call(request_rec *r, const char *url, rv = TRUE; break; } + if (res == CURLE_OPERATION_TIMEDOUT) { + /* in case of a request/transfer timeout (which includes the connect timeout) we'll not retry */ + oidc_error(r, + "curl_easy_perform failed with a timeout for %s: [%s]; won't retry", + url, curlError[0] ? curlError : ""); + break; + } oidc_error(r, "curl_easy_perform(%d/%d) failed for %s with: [%s]", i + 1, http_timeout->retries + 1, url, curlError[0] ? curlError : ""); - /* in case of a request/transfer timeout (which includes the connect timeout) we'll not retry */ - if (res == CURLE_OPERATION_TIMEDOUT) - break; /* in case of a connectivity/network glitch we'll back off before retrying */ if (i < http_timeout->retries) apr_sleep(http_timeout->retry_interval); @@ -1249,7 +1253,7 @@ static apr_byte_t oidc_util_http_call(request_rec *r, const char *url, /* set and log the response */ oidc_debug(r, "response=%s", *response ? *response : ""); - end: +end: /* cleanup and return the result */ if (h_list != NULL)