From 4a0e77df1e16a258a47d468bea7f2b24edca6c05 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Thu, 24 Feb 2022 20:37:08 +0000 Subject: [PATCH] Merge r1881379, r1892422, r1893011, r1897270, r1897271 from trunk Easy patches: synch 2.4.x and trunk - mod_ssl: Fix a few warnings on 64 bits windows compilation - ap_escape_quotes(): Remove unneeded checks to improve performance - test/time-sem.c: unlock the accept mutex before exiting (error conditions) - mod_ext_filter: Fix a spurious -1 used as a APR_SIZE_T_FMT in an error message - mod_sed: fix some format string (s/lld/APR_INT64_T_FMT/) Submitted by: jailletc36, rpluem, ylavic, jailletc36, jailletc36 Reviewed by: jailletc36, icing, rpluem Backported by: jailletc36 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898391 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_ext_filter.c | 6 ++---- modules/filters/regexp.h | 4 ++-- modules/ssl/ssl_engine_vars.c | 3 ++- server/util.c | 8 +++----- test/time-sem.c | 2 ++ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index 7aac19d86e3..7afd8dda16a 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -655,8 +655,7 @@ static apr_status_t drain_available_output(ap_filter_t *f, if (rv && !APR_STATUS_IS_EAGAIN(rv)) lvl = APLOG_DEBUG; ap_log_rerror(APLOG_MARK, lvl, rv, r, APLOGNO(01460) - "apr_file_read(child output), len %" APR_SIZE_T_FMT, - !rv ? len : -1); + "apr_file_read(child output), len %" APR_SIZE_T_FMT, len); if (rv != APR_SUCCESS) { return rv; } @@ -810,8 +809,7 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) if (rv && !APR_STATUS_IS_EOF(rv) && !APR_STATUS_IS_EAGAIN(rv)) lvl = APLOG_ERR; ap_log_rerror(APLOG_MARK, lvl, rv, r, APLOGNO(01466) - "apr_file_read(child output), len %" APR_SIZE_T_FMT, - !rv ? len : -1); + "apr_file_read(child output), len %" APR_SIZE_T_FMT, len); if (APR_STATUS_IS_EAGAIN(rv)) { if (eos) { /* should not occur, because we have an APR timeout in place */ diff --git a/modules/filters/regexp.h b/modules/filters/regexp.h index 6af89120d0e..dc4993a08cd 100644 --- a/modules/filters/regexp.h +++ b/modules/filters/regexp.h @@ -93,8 +93,8 @@ extern void command_errf(sed_commands_t *commands, const char *fmt, ...) #define SEDERR_COMES "cannot open %s" #define SEDERR_CCMES "cannot create %s" #define SEDERR_TMLNMES "too many line numbers" -#define SEDERR_TMAMES "too many appends after line %lld" -#define SEDERR_TMRMES "too many reads after line %lld" +#define SEDERR_TMAMES "too many appends after line %" APR_INT64_T_FMT +#define SEDERR_TMRMES "too many reads after line %" APR_INT64_T_FMT #define SEDERR_DOORNG "``\\digit'' out of range: %s" #define SEDERR_EDMOSUB "ending delimiter missing on substitution: %s" #define SEDERR_EDMOSTR "ending delimiter missing on string: %s" diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index 99b22a2c7df..418d849e00e 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -630,7 +630,8 @@ static char *ssl_var_lookup_ssl_cert_dn(apr_pool_t *p, X509_NAME *xsname, static char *ssl_var_lookup_ssl_cert_san(apr_pool_t *p, X509 *xs, char *var) { - int type, numlen; + int type; + apr_size_t numlen; const char *onf = NULL; apr_array_header_t *entries; diff --git a/server/util.c b/server/util.c index 1dc512b1d4a..424a28a59f3 100644 --- a/server/util.c +++ b/server/util.c @@ -2548,7 +2548,7 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring) * If we find a slosh, and it's not the last byte in the string, * it's escaping something - advance past both bytes. */ - if ((*inchr == '\\') && (inchr[1] != '\0')) { + else if ((*inchr == '\\') && (inchr[1] != '\0')) { inchr++; newlen++; } @@ -2565,12 +2565,10 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring) if (*inchr == '"') { *outchr++ = '\\'; } - if ((*inchr == '\\') && (inchr[1] != '\0')) { - *outchr++ = *inchr++; - } - if (*inchr != '\0') { + else if ((*inchr == '\\') && (inchr[1] != '\0')) { *outchr++ = *inchr++; } + *outchr++ = *inchr++; } *outchr = '\0'; return outstring; diff --git a/test/time-sem.c b/test/time-sem.c index 7bd0501ee5c..60e59826773 100644 --- a/test/time-sem.c +++ b/test/time-sem.c @@ -548,6 +548,7 @@ void main (int argc, char **argv) exit (0); } else if (pid == -1) { perror ("fork"); + accept_mutex_off (); exit (1); } } @@ -555,6 +556,7 @@ void main (int argc, char **argv) /* a quick test to see that nothing is screwed up */ if (*shared_counter != 0) { puts ("WTF! shared_counter != 0 before the children have been started!"); + accept_mutex_off (); exit (1); } -- 2.47.2