]> granicus.if.org Git - apache/commitdiff
Merge r1788032, r1788033, r1783764, r1707512, r1783770 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 2 May 2017 11:01:17 +0000 (11:01 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 2 May 2017 11:01:17 +0000 (11:01 +0000)
Save a few bytes in the conf pool.

'push_item' and 'add_alt' already duplicate their parameters, so we can safely use the temp_pool here.

Use 'ap_cstr_casecmp' to simplify code.

Remove useless case. We know that to can not be NULL at this point.

Follow up to r1772812: update APLOGNO().

* modules/ssl/ssl_engine_kernel.c: Constify the ssl_hook_Fixup_vars array itself.

winnt/service: each log message should use its own APLOGNO.
Submitted by: jailletc36, ylavic, jorton, ylavic
Reviewed by: jailletc36, covener, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1793466 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/generators/mod_autoindex.c
modules/session/mod_session_crypto.c
modules/ssl/ssl_engine_kernel.c
server/mpm/winnt/service.c

diff --git a/STATUS b/STATUS
index 216559963e18cd14c91bcf33d87a2cc9dd620335..d8d7db46fdc4196de569fde49af9d0337475b348 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -125,19 +125,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Easy patches: synch 2.4.x and trunk
-     - mod_autoindex: Save a few bytes in the conf pool.
-     - mod_autoindex: Use 'ap_cstr_casecmp' to simplify code + remove dead code
-     - mod_session_crypto: Add missing APLOGNO
-     - mod_ssl: Constify the ssl_hook_Fixup_vars array itself
-     - winnt/service: each log message should use its own APLOGNO.
-     trunk patch: http://svn.apache.org/r1788032
-                  http://svn.apache.org/r1788033
-                  http://svn.apache.org/r1783764
-                  http://svn.apache.org/r1707512 
-                  http://svn.apache.org/r1783770
-     2.4.x patch: trunk works
-     +1: jailletc36, covener, jim
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
index 58de7ddd286539a7d5d11104178079ef26926080..9094e307f2f4029cb39bac8115aab9767a60d2a7 100644 (file)
@@ -156,9 +156,9 @@ static char c_by_encoding, c_by_type, c_by_path;
 static APR_INLINE int response_is_html(request_rec *r)
 {
     char *ctype = ap_field_noparam(r->pool, r->content_type);
-    ap_str_tolower(ctype);
-    return !strcmp(ctype, "text/html")
-        || !strcmp(ctype, "application/xhtml+xml");
+
+    return !ap_cstr_casecmp(ctype, "text/html")
+        || !ap_cstr_casecmp(ctype, "application/xhtml+xml");
 }
 
 /*
@@ -214,11 +214,8 @@ static void push_item(apr_array_header_t *arr, char *type, const char *to,
     if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
         p->apply_to = apr_pstrcat(arr->pool, "*", to, NULL);
     }
-    else if (to) {
-        p->apply_to = apr_pstrdup(arr->pool, to);
-    }
     else {
-        p->apply_to = NULL;
+        p->apply_to = apr_pstrdup(arr->pool, to);
     }
 }
 
@@ -231,7 +228,7 @@ static const char *add_alt(cmd_parms *cmd, void *d, const char *alt,
         }
     }
     if (cmd->info == BY_ENCODING) {
-        char *tmp = apr_pstrdup(cmd->pool, to);
+        char *tmp = apr_pstrdup(cmd->temp_pool, to);
         ap_str_tolower(tmp);
         to = tmp;
     }
@@ -244,7 +241,7 @@ static const char *add_alt(cmd_parms *cmd, void *d, const char *alt,
 static const char *add_icon(cmd_parms *cmd, void *d, const char *icon,
                             const char *to)
 {
-    char *iconbak = apr_pstrdup(cmd->pool, icon);
+    char *iconbak = apr_pstrdup(cmd->temp_pool, icon);
 
     if (icon[0] == '(') {
         char *alt;
@@ -253,7 +250,7 @@ static const char *add_icon(cmd_parms *cmd, void *d, const char *icon,
         if (cl == NULL) {
             return "missing closing paren";
         }
-        alt = ap_getword_nc(cmd->pool, &iconbak, ',');
+        alt = ap_getword_nc(cmd->temp_pool, &iconbak, ',');
         *cl = '\0';                             /* Lose closing paren */
         add_alt(cmd, d, &alt[1], to);
     }
@@ -263,7 +260,7 @@ static const char *add_icon(cmd_parms *cmd, void *d, const char *icon,
         }
     }
     if (cmd->info == BY_ENCODING) {
-        char *tmp = apr_pstrdup(cmd->pool, to);
+        char *tmp = apr_pstrdup(cmd->temp_pool, to);
         ap_str_tolower(tmp);
         to = tmp;
     }
index 9231a5e8220bf863aeaf4ab29066d1d9e01ab8f9..996620d5106e29c32889dcd758c9a20ad1346d6d 100644 (file)
@@ -381,7 +381,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
 
     /* sanity check - decoded too short? */
     if (decodedlen < (AP_SIPHASH_DSIZE + sizeof(apr_uuid_t))) {
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO()
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(10005)
                 "too short to decrypt, aborting");
         return APR_ECRYPT;
     }
@@ -403,7 +403,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
          */
         compute_auth(slider, len, passphrase, passlen, auth);
         if (!ap_crypto_equals(auth, decoded, AP_SIPHASH_DSIZE)) {
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO()
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(10006)
                     "auth does not match, skipping");
             continue;
         }
index da2776f4c52e802f151fe17311c2435dd475f879..e8484ed4d3d4c3bc9c907c2f4183d4b86fa6c8ce 100644 (file)
@@ -1287,7 +1287,7 @@ int ssl_hook_Auth(request_rec *r)
  *   Fixup Handler
  */
 
-static const char *ssl_hook_Fixup_vars[] = {
+static const char *const ssl_hook_Fixup_vars[] = {
     "SSL_VERSION_INTERFACE",
     "SSL_VERSION_LIBRARY",
     "SSL_PROTOCOL",
index 22f044dd2f7f8ef262e4a9dcc685ecedb6322b62..121aca1fa865760eadecfab297172cdc6ed871c8 100644 (file)
@@ -467,7 +467,7 @@ static void __stdcall service_nt_main_fn(DWORD argc, LPSTR *argv)
         {
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 
                      apr_get_os_error(), NULL, 
-                     APLOGNO(00365) "Failure registering service handler");
+                     APLOGNO(10008) "Failure registering service handler");
         return;
     }
 
@@ -956,7 +956,7 @@ apr_status_t mpm_service_uninstall(void)
     if (!schSCManager) {
         rv = apr_get_os_error();
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, rv, NULL,
-                     APLOGNO(00369)  "Failed to open the Windows service "
+                     APLOGNO(10009)  "Failed to open the Windows service "
                      "manager, perhaps you forgot to log in as Adminstrator?");
         return (rv);
     }
@@ -976,7 +976,7 @@ apr_status_t mpm_service_uninstall(void)
     if (!schService) {
         rv = apr_get_os_error();
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, rv, NULL,
-                     APLOGNO(00373) "Failed to open the '%s' service",
+                     APLOGNO(10010) "Failed to open the '%s' service",
                      mpm_display_name);
         return (rv);
     }
@@ -1046,7 +1046,7 @@ apr_status_t mpm_service_start(apr_pool_t *ptemp, int argc,
     if (!schSCManager) {
         rv = apr_get_os_error();
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, rv, NULL,
-                     APLOGNO(00369)  "Failed to open the Windows service "
+                     APLOGNO(10011)  "Failed to open the Windows service "
                      "manager, perhaps you forgot to log in as Adminstrator?");
         return (rv);
     }
@@ -1068,7 +1068,7 @@ apr_status_t mpm_service_start(apr_pool_t *ptemp, int argc,
     if (!schService) {
         rv = apr_get_os_error();
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, rv, NULL, 
-                     APLOGNO(00373) "Failed to open the '%s' service",
+                     APLOGNO(10012) "Failed to open the '%s' service",
                      mpm_display_name);
         CloseServiceHandle(schSCManager);
         return (rv);
@@ -1156,7 +1156,7 @@ void mpm_signal_service(apr_pool_t *ptemp, int signal)
     if (!schSCManager) {
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP,
                      apr_get_os_error(), NULL,
-                     APLOGNO(00369)  "Failed to open the Windows service "
+                     APLOGNO(10013)  "Failed to open the Windows service "
                      "manager, perhaps you forgot to log in as Adminstrator?");
         return;
     }
@@ -1183,7 +1183,7 @@ void mpm_signal_service(apr_pool_t *ptemp, int signal)
         /* Could not open the service */
         ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP,
                      apr_get_os_error(), NULL,
-                     APLOGNO(00373) "Failed to open the '%s' service",
+                     APLOGNO(10014) "Failed to open the '%s' service",
                      mpm_display_name);
         CloseServiceHandle(schSCManager);
         return;