Commit 80374e0a authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1788032, r1788033, r1783764, r1707512, r1783770 from trunk:

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
parent a76b97bf
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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:
+8 −11
Original line number Diff line number Diff line
@@ -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;
    }
+2 −2
Original line number Diff line number Diff line
@@ -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;
        }
+1 −1
Original line number Diff line number Diff line
@@ -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",
+7 −7
Original line number Diff line number Diff line
@@ -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;