mirror of
https://github.com/apache/httpd.git
synced 2025-07-29 12:25:29 +00:00
fix some logging calls to include the server_rec
(and even the conn_rec in a couple of places) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1074871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -148,7 +148,7 @@ static int noloris_monitor(apr_pool_t *pool, server_rec *s)
|
||||
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);
|
||||
|
@ -285,11 +285,11 @@ static void cgid_maint(int reason, void *data, apr_wait_t status)
|
||||
}
|
||||
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 *data, apr_wait_t status)
|
||||
* 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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ AP_DECLARE(apr_status_t) ap_unixd_accept(void **accepted, ap_listen_rec *lr,
|
||||
#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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ void get_handles_from_parent(server_rec *s, HANDLE *child_exit_event,
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ static apr_status_t create_namebased_scoreboard(apr_pool_t *pool,
|
||||
|
||||
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_pool_t *pconf)
|
||||
*/
|
||||
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_pool_t *pconf)
|
||||
/* 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_pool_t *pconf)
|
||||
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_pool_t *p, apr_shm_t **shm, int detached)
|
||||
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, ap_scoreboard_e sb_type)
|
||||
/* 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;
|
||||
|
@ -291,8 +291,8 @@ static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx,
|
||||
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_handle(ap_filter_rec_t *frec, void *ctx,
|
||||
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 char *name, void *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user