result.err.status = HTTP_BAD_GATEWAY;
result.err.desc = ap_psprintf(r->pool,
"Destination URI refers to different "
- "scheme or port (%s://hostname:%d)\n"
- "(want: %s://hostname:%d)",
+ "scheme or port (%s://hostname:%d)"
+ APR_EOL_STR "(want: %s://hostname:%d)",
comp.scheme ? comp.scheme : scheme,
comp.port ? comp.port : port,
scheme, port);
rv = ap_xlate_open(&output_xlate, dc->charset_default, dc->charset_source, r->pool);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
- "can't open translation %s->%s, error %d\n",
- dc->charset_source, dc->charset_default, rv);
+ "can't open translation %s->%s",
+ dc->charset_source, dc->charset_default);
return HTTP_INTERNAL_SERVER_ERROR;
}
rv = ap_set_content_xlate(r, 1, output_xlate);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
- "can't set content output translation, error %d\n", rv);
+ "can't set content output translation");
return HTTP_INTERNAL_SERVER_ERROR;
}
dc->charset_default, r->pool);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
- "can't open translation %s->%s, error %d\n",
- dc->charset_default, dc->charset_source, rv);
+ "can't open translation %s->%s",
+ dc->charset_default, dc->charset_source);
return HTTP_INTERNAL_SERVER_ERROR;
}
rv = ap_set_content_xlate(r, 0, input_xlate);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
- "can't set content input translation, error %d\n", rv);
+ "can't set content input translation");
return HTTP_INTERNAL_SERVER_ERROR;
}
}
return eFileTypeSCRIPT;
}
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
- "Failed to start a '%s' file as a script.\n\t"
+ "Failed to start a '%s' file as a script.\r\n\t"
"COMSPEC variable is missing from the environment.", ext);
return eFileTypeUNKNOWN;
}
return eFileTypeSCRIPT;
else if (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY_STRICT) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
- "ScriptInterpreterSource config directive set to \"registry-strict\".\n\t"
- "Interpreter not found for files of type '%s'.", ext);
+ "ScriptInterpreterSource config directive set to \"registry-strict\"." APR_EOL_STR
+ "\tInterpreter not found for files of type '%s'.", ext);
return eFileTypeUNKNOWN;
}
else
{
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
- "ScriptInterpreterSource config directive set to \"registry\".\n\t"
- "Interpreter not found for files of type '%s', "
+ "ScriptInterpreterSource config directive set to \"registry\"." APR_EOL_STR
+ "\tInterpreter not found for files of type '%s', "
"trying \"script\" method...", ext);
}
}
This->mask.s_addr = htonl(INADDR_NONE << (32 - bits));
if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) {
- ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Warning: NetMask and IP-Addr disagree in %s/%ld\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Warning: NetMask and IP-Addr disagree in %s/%ld",
inet_ntoa(This->addr), bits);
This->addr.s_addr &= This->mask.s_addr;
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
while (curr_parent != NULL) {
errmsg = ap_psprintf(p, "%s%s%s:%u: %s> was not closed.",
errmsg,
- *errmsg == '\0' ? "" : "\n",
+ *errmsg == '\0' ? "" : APR_EOL_STR,
curr_parent->filename,
curr_parent->line_num,
curr_parent->directive);
errmsg = ap_build_config(&parms, p, ptemp, conftree);
if (errmsg) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
- "Syntax error in -C/-c directive:\n%s", errmsg);
+ "Syntax error in -C/-c directive:" APR_EOL_STR "%s",
+ errmsg);
exit(1);
}
const request_rec *r, ap_pool_t *pool,
const char *fmt, va_list args)
{
- char errstr[MAX_STRING_LEN + 1]; /* + 1 to have room for '\n' */
+ char errstr[MAX_STRING_LEN];
size_t len;
ap_file_t *logf = NULL;
/* NULL if we are logging to syslog */
if (logf) {
- /* We know that we have one more character of space available because
- * the array is sized that way */
- /* ap_assert(len < MAX_STRING_LEN) */
- errstr[len++] = '\n';
- errstr[len] = '\0';
- ap_puts(errstr, logf);
+ /* Truncate for the terminator (as ap_snprintf does) */
+ if (len > MAX_STRING_LEN - 2)
+ len = MAX_STRING_LEN - 2;
+ strcpy(errstr + len, APR_EOL_STR);
+ ap_puts(errstr, logf);
ap_flush(logf);
}
#ifdef HAVE_SYSLOG
ap_server_argv0, fname);
exit(1);
}
- ap_fprintf(pid_file, "%ld\n", (long)mypid);
+ ap_fprintf(pid_file, "%ld" APR_EOL_STR, (long)mypid);
ap_close(pid_file);
saved_pid = mypid;
}
if (ap_threads_per_child > HARD_THREAD_LIMIT) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"WARNING: ThreadsPerChild of %d exceeds compile time"
- "limit of %d threads,\n", ap_threads_per_child,
+ "limit of %d threads,", ap_threads_per_child,
HARD_THREAD_LIMIT);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
" lowering ThreadsPerChild to %d. To increase, please"
if (ap_threads_per_child > HARD_THREAD_LIMIT) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"WARNING: ThreadsPerChild of %d exceeds compile time"
- "limit of %d threads,\n", ap_threads_per_child,
+ "limit of %d threads,", ap_threads_per_child,
HARD_THREAD_LIMIT);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
" lowering ThreadsPerChild to %d. To increase, please"
ap_daemons_limit = HARD_SERVER_LIMIT;
}
else if (ap_daemons_limit < 1) {
- ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "WARNING: Require MaxClients > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "WARNING: Require MaxClients > 0, setting to 1");
ap_daemons_limit = 1;
}
return NULL;
if ((WIFEXITED(status)) &&
WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
- "Child %ld returned a Fatal error... \n"
+ "Child %ld returned a Fatal error..." APR_EOL_STR
"Apache is exiting!",
(long)pid->pid);
exit(APEXIT_CHILDFATAL);
#endif
{
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_WARNING, 0, NULL,
- "%s: gethostname() failed to detemine ServerName\n",
+ "%s: gethostname() failed to detemine ServerName",
ap_server_argv0);
}
else
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, NULL,
"%s: Could not find determine the server's fully qualified "
- "domain name, using %s for ServerName\n",
+ "domain name, using %s for ServerName",
ap_server_argv0, server_hostname);
return server_hostname;