mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Add APR_EOL_STR for a platform specific text delimiter, provided by
apr.h (defined in apr.h.in and apr.hw). This is needed -only- in APR created files (true raw files) such as logs. It is not required in any splat to screen (stderr/stdout) formatting, nor any html markup. Some other modules slipped through in the prior apr_strings.h commit. Sorry 'bout that. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -211,8 +211,8 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r)
|
||||
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);
|
||||
|
@@ -229,14 +229,14 @@ static int find_code_page(request_rec *r)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -251,14 +251,14 @@ static int find_code_page(request_rec *r)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -985,7 +985,7 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r,
|
||||
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;
|
||||
}
|
||||
@@ -1005,15 +1005,15 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@@ -885,7 +885,7 @@ int ap_proxy_is_ipaddr(struct dirconn_entry *This, ap_pool_t *p)
|
||||
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,
|
||||
|
@@ -1077,7 +1077,7 @@ API_EXPORT(const char *) ap_build_config(cmd_parms *parms,
|
||||
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);
|
||||
@@ -1273,7 +1273,8 @@ static void process_command_config(server_rec *s, ap_array_header_t *arr,
|
||||
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);
|
||||
}
|
||||
|
||||
|
13
server/log.c
13
server/log.c
@@ -322,7 +322,7 @@ static void log_error_core(const char *file, int line, int level,
|
||||
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;
|
||||
|
||||
@@ -427,11 +427,10 @@ static void log_error_core(const char *file, int line, int level,
|
||||
|
||||
/* 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';
|
||||
/* 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);
|
||||
}
|
||||
@@ -528,7 +527,7 @@ void ap_log_pid(ap_pool_t *p, const char *fname)
|
||||
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;
|
||||
}
|
||||
|
@@ -991,7 +991,7 @@ static const char *set_threads_per_child (cmd_parms *cmd, void *dummy, const cha
|
||||
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"
|
||||
|
@@ -985,7 +985,7 @@ static const char *set_threads_per_child (cmd_parms *cmd, void *dummy, char *arg
|
||||
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"
|
||||
|
@@ -1307,7 +1307,7 @@ static const char *set_server_limit (cmd_parms *cmd, void *dummy,
|
||||
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;
|
||||
|
@@ -232,7 +232,7 @@ void ap_process_child_status(ap_proc_t *pid, ap_wait_t status)
|
||||
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);
|
||||
|
@@ -1893,7 +1893,7 @@ char *ap_get_local_host(ap_pool_t *a)
|
||||
#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
|
||||
@@ -1919,7 +1919,7 @@ char *ap_get_local_host(ap_pool_t *a)
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user