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
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:
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");
}
/*
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);
}
}
}
}
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;
}
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;
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);
}
}
}
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;
}
/* 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;
}
*/
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;
}
* 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",
{
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;
}
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);
}
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);
}
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);
}
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);
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;
}
/* 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;