]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add APR_EOL_STR for a platform specific text delimiter, provided by
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 25 Jul 2000 01:06:32 +0000 (01:06 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 25 Jul 2000 01:06:32 +0000 (01:06 +0000)
  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

modules/dav/main/util.c
modules/experimental/mod_charset_lite.c
modules/http/http_core.c
modules/proxy/proxy_util.c
server/config.c
server/log.c
server/mpm/beos/beos.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm_common.c
server/util.c

index e05d27dd6984039462beb964e91b048f2109bac3..48f55bb365a6df93f86c5ef022d8ce13aee0947d 100644 (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.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);
index 282d7814d627bf29b1dff2f8176d72b973fb66a0..c0e55324ab548e8504a88bab447c20cec3be19c0 100644 (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);
     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;
         }
     }
index f6d4827d4626c82b920a5ae1ffaad1020d734477..bbda522eab297857406215e70ce7445d30d3a98f 100644 (file)
@@ -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);
         }
     }        
index 0e68a72fe8cbbe8181442f2fcf0f6350a004474e..9c2ee29a1d91f5c4341e3c4075fa31c079eb9160 100644 (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));
 
     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, 
index 6d4ce013ed126cc42b27dc9d148b85c96c221375..cc64d99b9b8efee621d40285a3e5f2e159d382d9 100644 (file)
@@ -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);
     }
 
index 880e7d1bad72603f370a2e54fee8aaf5ecdb94f7..717263c397a7e80356bbbaeb1e623446c3be7577 100644 (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 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,12 +427,11 @@ 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';
-       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
@@ -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;
 }
index e985497b4858f1be027839ff5fe46cdbb029f488..3eefd3c741f273fd3487cb3fd75e7be699f0bf0e 100644 (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) {
         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"
index c37a7681d279975214754cf7b9a2dfb64ee8034e..6c5c1992025be526466fff34b152128ac0527aca 100644 (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) {
         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"
index 8f5cdb7ea7d7af7f3505e3dfd4b13a65b701ac8b..b0c1807e2937c62eed1e328bf907475b150d30d5 100644 (file)
@@ -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;
index f99d6d7aee222fadd6c5cc074388b09062b9510d..2e1df1da9d2e810b2468b575b07dc45600025eef 100644 (file)
@@ -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);
index 061355e8e40874c816b6af15b18402fbd9c27b37..7f84a806b8783a343191161a04a96876ee7a92e3 100644 (file)
@@ -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;