1
0
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:
William A. Rowe Jr
2000-07-25 01:06:32 +00:00
parent fc3580dd3b
commit 847b20108c
11 changed files with 30 additions and 30 deletions

View File

@@ -211,8 +211,8 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r)
result.err.status = HTTP_BAD_GATEWAY; result.err.status = HTTP_BAD_GATEWAY;
result.err.desc = ap_psprintf(r->pool, result.err.desc = ap_psprintf(r->pool,
"Destination URI refers to different " "Destination URI refers to different "
"scheme or port (%s://hostname:%d)\n" "scheme or port (%s://hostname:%d)"
"(want: %s://hostname:%d)", APR_EOL_STR "(want: %s://hostname:%d)",
comp.scheme ? comp.scheme : scheme, comp.scheme ? comp.scheme : scheme,
comp.port ? comp.port : port, comp.port ? comp.port : port,
scheme, port); scheme, port);

View File

@@ -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); rv = ap_xlate_open(&output_xlate, dc->charset_default, dc->charset_source, r->pool);
if (rv != APR_SUCCESS) { if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
"can't open translation %s->%s, error %d\n", "can't open translation %s->%s",
dc->charset_source, dc->charset_default, rv); dc->charset_source, dc->charset_default);
return HTTP_INTERNAL_SERVER_ERROR; return HTTP_INTERNAL_SERVER_ERROR;
} }
rv = ap_set_content_xlate(r, 1, output_xlate); rv = ap_set_content_xlate(r, 1, output_xlate);
if (rv != APR_SUCCESS) { if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, 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; return HTTP_INTERNAL_SERVER_ERROR;
} }
@@ -251,14 +251,14 @@ static int find_code_page(request_rec *r)
dc->charset_default, r->pool); dc->charset_default, r->pool);
if (rv != APR_SUCCESS) { if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
"can't open translation %s->%s, error %d\n", "can't open translation %s->%s",
dc->charset_default, dc->charset_source, rv); dc->charset_default, dc->charset_source);
return HTTP_INTERNAL_SERVER_ERROR; return HTTP_INTERNAL_SERVER_ERROR;
} }
rv = ap_set_content_xlate(r, 0, input_xlate); rv = ap_set_content_xlate(r, 0, input_xlate);
if (rv != APR_SUCCESS) { if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, 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 HTTP_INTERNAL_SERVER_ERROR;
} }
} }

View File

@@ -985,7 +985,7 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r,
return eFileTypeSCRIPT; return eFileTypeSCRIPT;
} }
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server, 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); "COMSPEC variable is missing from the environment.", ext);
return eFileTypeUNKNOWN; return eFileTypeUNKNOWN;
} }
@@ -1005,15 +1005,15 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r,
return eFileTypeSCRIPT; return eFileTypeSCRIPT;
else if (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY_STRICT) { else if (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY_STRICT) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server, ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
"ScriptInterpreterSource config directive set to \"registry-strict\".\n\t" "ScriptInterpreterSource config directive set to \"registry-strict\"." APR_EOL_STR
"Interpreter not found for files of type '%s'.", ext); "\tInterpreter not found for files of type '%s'.", ext);
return eFileTypeUNKNOWN; return eFileTypeUNKNOWN;
} }
else else
{ {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server, ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
"ScriptInterpreterSource config directive set to \"registry\".\n\t" "ScriptInterpreterSource config directive set to \"registry\"." APR_EOL_STR
"Interpreter not found for files of type '%s', " "\tInterpreter not found for files of type '%s', "
"trying \"script\" method...", ext); "trying \"script\" method...", ext);
} }
} }

View File

@@ -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)); This->mask.s_addr = htonl(INADDR_NONE << (32 - bits));
if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) { 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); inet_ntoa(This->addr), bits);
This->addr.s_addr &= This->mask.s_addr; This->addr.s_addr &= This->mask.s_addr;
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,

View File

@@ -1077,7 +1077,7 @@ API_EXPORT(const char *) ap_build_config(cmd_parms *parms,
while (curr_parent != NULL) { while (curr_parent != NULL) {
errmsg = ap_psprintf(p, "%s%s%s:%u: %s> was not closed.", errmsg = ap_psprintf(p, "%s%s%s:%u: %s> was not closed.",
errmsg, errmsg,
*errmsg == '\0' ? "" : "\n", *errmsg == '\0' ? "" : APR_EOL_STR,
curr_parent->filename, curr_parent->filename,
curr_parent->line_num, curr_parent->line_num,
curr_parent->directive); 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); errmsg = ap_build_config(&parms, p, ptemp, conftree);
if (errmsg) { if (errmsg) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 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); exit(1);
} }

View File

@@ -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 request_rec *r, ap_pool_t *pool,
const char *fmt, va_list args) 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; size_t len;
ap_file_t *logf = NULL; ap_file_t *logf = NULL;
@@ -427,12 +427,11 @@ static void log_error_core(const char *file, int line, int level,
/* NULL if we are logging to syslog */ /* NULL if we are logging to syslog */
if (logf) { if (logf) {
/* We know that we have one more character of space available because /* Truncate for the terminator (as ap_snprintf does) */
* the array is sized that way */ if (len > MAX_STRING_LEN - 2)
/* ap_assert(len < MAX_STRING_LEN) */ len = MAX_STRING_LEN - 2;
errstr[len++] = '\n'; strcpy(errstr + len, APR_EOL_STR);
errstr[len] = '\0'; ap_puts(errstr, logf);
ap_puts(errstr, logf);
ap_flush(logf); ap_flush(logf);
} }
#ifdef HAVE_SYSLOG #ifdef HAVE_SYSLOG
@@ -528,7 +527,7 @@ void ap_log_pid(ap_pool_t *p, const char *fname)
ap_server_argv0, fname); ap_server_argv0, fname);
exit(1); exit(1);
} }
ap_fprintf(pid_file, "%ld\n", (long)mypid); ap_fprintf(pid_file, "%ld" APR_EOL_STR, (long)mypid);
ap_close(pid_file); ap_close(pid_file);
saved_pid = mypid; saved_pid = mypid;
} }

View File

@@ -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) { if (ap_threads_per_child > HARD_THREAD_LIMIT) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"WARNING: ThreadsPerChild of %d exceeds compile time" "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); HARD_THREAD_LIMIT);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
" lowering ThreadsPerChild to %d. To increase, please" " lowering ThreadsPerChild to %d. To increase, please"

View File

@@ -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) { if (ap_threads_per_child > HARD_THREAD_LIMIT) {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"WARNING: ThreadsPerChild of %d exceeds compile time" "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); HARD_THREAD_LIMIT);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
" lowering ThreadsPerChild to %d. To increase, please" " lowering ThreadsPerChild to %d. To increase, please"

View File

@@ -1307,7 +1307,7 @@ static const char *set_server_limit (cmd_parms *cmd, void *dummy,
ap_daemons_limit = HARD_SERVER_LIMIT; ap_daemons_limit = HARD_SERVER_LIMIT;
} }
else if (ap_daemons_limit < 1) { 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; ap_daemons_limit = 1;
} }
return NULL; return NULL;

View File

@@ -232,7 +232,7 @@ void ap_process_child_status(ap_proc_t *pid, ap_wait_t status)
if ((WIFEXITED(status)) && if ((WIFEXITED(status)) &&
WEXITSTATUS(status) == APEXIT_CHILDFATAL) { WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf, 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!", "Apache is exiting!",
(long)pid->pid); (long)pid->pid);
exit(APEXIT_CHILDFATAL); exit(APEXIT_CHILDFATAL);

View File

@@ -1893,7 +1893,7 @@ char *ap_get_local_host(ap_pool_t *a)
#endif #endif
{ {
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_WARNING, 0, NULL, 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); ap_server_argv0);
} }
else 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, ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, NULL,
"%s: Could not find determine the server's fully qualified " "%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); ap_server_argv0, server_hostname);
return server_hostname; return server_hostname;