You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2011/02/26 16:32:01 UTC

svn commit: r1074871 - in /httpd/httpd/trunk: modules/experimental/mod_noloris.c modules/generators/mod_cgid.c os/bs2000/os.c os/unix/unixd.c server/mpm/prefork/prefork.c server/mpm/winnt/mpm_winnt.c server/scoreboard.c server/util_filter.c

Author: trawick
Date: Sat Feb 26 15:32:01 2011
New Revision: 1074871

URL: http://svn.apache.org/viewvc?rev=1074871&view=rev
Log:
fix some logging calls to include the server_rec
(and even the conn_rec in a couple of places)

Modified:
    httpd/httpd/trunk/modules/experimental/mod_noloris.c
    httpd/httpd/trunk/modules/generators/mod_cgid.c
    httpd/httpd/trunk/os/bs2000/os.c
    httpd/httpd/trunk/os/unix/unixd.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
    httpd/httpd/trunk/server/scoreboard.c
    httpd/httpd/trunk/server/util_filter.c

Modified: httpd/httpd/trunk/modules/experimental/mod_noloris.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/mod_noloris.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_noloris.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_noloris.c Sat Feb 26 15:32:01 2011
@@ -148,7 +148,7 @@ static int noloris_monitor(apr_pool_t *p
         if (*n >= default_max_connections) {
             /* if this isn't a trusted proxy, we mark it as bad */
             if (!apr_hash_get(trusted, ip, APR_HASH_KEY_STRING)) {
-                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, 0,
+                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s,
                        "noloris: banning %s with %d connections in READ state",
                        ip, *n);
                 strcpy(shm_rec, ip);

Modified: httpd/httpd/trunk/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgid.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgid.c Sat Feb 26 15:32:01 2011
@@ -285,11 +285,11 @@ static void cgid_maint(int reason, void 
             }
             if (!stopping) {
                 if (status == DAEMON_STARTUP_ERROR) {
-                    ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
+                    ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
                                  "cgid daemon failed to initialize");
                 }
                 else {
-                    ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf,
                                  "cgid daemon process died, restarting");
                     cgid_start(root_pool, root_server, proc);
                 }
@@ -314,7 +314,7 @@ static void cgid_maint(int reason, void 
              * guarantee the same permissions as when the socket was created.
              */
             if (unlink(sockname) < 0 && errno != ENOENT) {
-                ap_log_error(APLOG_MARK, APLOG_ERR, errno, NULL,
+                ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
                              "Couldn't unlink unix domain socket %s",
                              sockname);
             }

Modified: httpd/httpd/trunk/os/bs2000/os.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/bs2000/os.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/os/bs2000/os.c (original)
+++ httpd/httpd/trunk/os/bs2000/os.c Sat Feb 26 15:32:01 2011
@@ -124,7 +124,7 @@ pid_t os_fork(const char *user)
         pid = ufork(username);
         if (pid == -1 && errno == EPERM) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, errno,
-                         NULL, "ufork: Possible mis-configuration "
+                         ap_server_conf, "ufork: Possible mis-configuration "
                          "for user %s - Aborting.", user);
             exit(1);
         }

Modified: httpd/httpd/trunk/os/unix/unixd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/unix/unixd.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/os/unix/unixd.c (original)
+++ httpd/httpd/trunk/os/unix/unixd.c Sat Feb 26 15:32:01 2011
@@ -307,7 +307,7 @@ AP_DECLARE(apr_status_t) ap_unixd_accept
 #ifdef _OSD_POSIX
         apr_os_sock_get(&sockdes, csd);
         if (sockdes >= FD_SETSIZE) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
+            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf,
                          "new file descriptor %d is too large; you probably need "
                          "to rebuild Apache with a larger FD_SETSIZE "
                          "(currently %d)",
@@ -535,7 +535,7 @@ pid_t os_fork(const char *user)
         pid = ufork(username);
         if (pid == -1 && errno == EPERM) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, errno,
-                         NULL, "ufork: Possible mis-configuration "
+                         ap_server_conf, "ufork: Possible mis-configuration "
                          "for user %s - Aborting.", user);
             exit(1);
         }

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Sat Feb 26 15:32:01 2011
@@ -201,11 +201,11 @@ static void accept_mutex_on(void)
 
         if (my_generation !=
             ap_scoreboard_image->global->running_generation) {
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, "%s", msg);
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, ap_server_conf, "%s", msg);
             clean_child_exit(0);
         }
         else {
-            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "%s", msg);
+            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, "%s", msg);
             exit(APEXIT_CHILDFATAL);
         }
     }
@@ -219,14 +219,14 @@ static void accept_mutex_off(void)
 
         if (my_generation !=
             ap_scoreboard_image->global->running_generation) {
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, "%s", msg);
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, ap_server_conf, "%s", msg);
             /* don't exit here... we have a connection to
              * process, after which point we'll see that the
              * generation changed and we'll exit cleanly
              */
         }
         else {
-            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "%s", msg);
+            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, "%s", msg);
             exit(APEXIT_CHILDFATAL);
         }
     }

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Sat Feb 26 15:32:01 2011
@@ -323,7 +323,7 @@ void get_handles_from_parent(server_rec 
 
     rv = ap_reopen_scoreboard(s->process->pool, scoreboard_shm, 1);
     if (rv || !(sb_shared = apr_shm_baseaddr_get(*scoreboard_shm))) {
-        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
                      "Child %d: Unable to reopen the scoreboard from the parent", my_pid);
         exit(APEXIT_CHILDINIT);
     }

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Sat Feb 26 15:32:01 2011
@@ -180,7 +180,7 @@ static apr_status_t create_namebased_sco
 
     rv = apr_shm_create(&ap_scoreboard_shm, scoreboard_size, fname, pool);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
                      "unable to create or access scoreboard \"%s\" "
                      "(name-based shared memory failure)", fname);
         return rv;
@@ -205,7 +205,7 @@ static apr_status_t open_scoreboard(apr_
      */
     rv = apr_pool_create(&global_pool, NULL);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
                      "Fatal error: unable to create global pool "
                      "for use by the scoreboard");
         return rv;
@@ -216,7 +216,7 @@ static apr_status_t open_scoreboard(apr_
         /* make sure it's an absolute pathname */
         fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
         if (!fname) {
-            ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EBADPATH, NULL,
+            ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EBADPATH, ap_server_conf,
                          "Fatal error: Invalid Scoreboard path %s",
                          ap_scoreboard_fname);
             return APR_EBADPATH;
@@ -227,7 +227,7 @@ static apr_status_t open_scoreboard(apr_
         rv = apr_shm_create(&ap_scoreboard_shm, scoreboard_size, NULL,
                             global_pool); /* anonymous shared memory */
         if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) {
-            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
                          "Unable to create or access scoreboard "
                          "(anonymous shared memory failure)");
             return rv;
@@ -255,7 +255,7 @@ apr_status_t ap_reopen_scoreboard(apr_po
         return APR_SUCCESS;
     }
     if (apr_shm_size_get(ap_scoreboard_shm) < scoreboard_size) {
-        ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
                      "Fatal error: shared scoreboard too small for child!");
         apr_shm_detach(ap_scoreboard_shm);
         ap_scoreboard_shm = NULL;
@@ -325,7 +325,7 @@ int ap_create_scoreboard(apr_pool_t *p, 
         /* A simple malloc will suffice */
         void *sb_mem = calloc(1, scoreboard_size);
         if (sb_mem == NULL) {
-            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
+            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
                          "(%d)%s: cannot allocate scoreboard",
                          errno, strerror(errno));
             return HTTP_INTERNAL_SERVER_ERROR;

Modified: httpd/httpd/trunk/server/util_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_filter.c?rev=1074871&r1=1074870&r2=1074871&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_filter.c (original)
+++ httpd/httpd/trunk/server/util_filter.c Sat Feb 26 15:32:01 2011
@@ -291,8 +291,8 @@ static ap_filter_t *add_any_filter_handl
             outf = r_filters;
         }
         else {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
-                      "a content filter was added without a request: %s", frec->name);
+            ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c,
+                          "a content filter was added without a request: %s", frec->name);
             return NULL;
         }
     }
@@ -301,8 +301,8 @@ static ap_filter_t *add_any_filter_handl
             outf = p_filters;
         }
         else {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
-                         "a protocol filter was added without a request: %s", frec->name);
+            ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c,
+                          "a protocol filter was added without a request: %s", frec->name);
             return NULL;
         }
     }
@@ -398,8 +398,8 @@ static ap_filter_t *add_any_filter(const
         }
     }
 
-    ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
-                 "an unknown filter was not added: %s", name);
+    ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, r ? r->connection : c,
+                  "an unknown filter was not added: %s", name);
     return NULL;
 }