]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1881379, r1892422, r1893011, r1897270, r1897271 from trunk
authorChristophe Jaillet <jailletc36@apache.org>
Thu, 24 Feb 2022 20:37:08 +0000 (20:37 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Thu, 24 Feb 2022 20:37:08 +0000 (20:37 +0000)
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
modules/filters/regexp.h
modules/ssl/ssl_engine_vars.c
server/util.c
test/time-sem.c

index 7aac19d86e38ba68a7e89806b5d376f852eb4513..7afd8dda16a031f9249606b74c506a8e22d4dd9e 100644 (file)
@@ -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 */
index 6af89120d0e8e475d8bab76311329e1c32112be0..dc4993a08cdd3aec9eb37df404809faf1ad5fc93 100644 (file)
@@ -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"
index 99b22a2c7df0c4d062d3995585b1e738b3a61075..418d849e00e185035df18f0f145814463f28891b 100644 (file)
@@ -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;
 
index 1dc512b1d4a72f4319f58ade4965e427cca0f2d8..424a28a59f3b70674a3a7a99b3b4a54976a83218 100644 (file)
@@ -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;
index 7bd0501ee5cfe404971731fe464a8253088d0c90..60e59826773bdfb8c32bb13c5c42ec4d0a099dc5 100644 (file)
@@ -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);
     }