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);
}
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);
}
* 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);
}
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);
}
#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)",
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);
}
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);
}
}
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);
}
}
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);
}
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;
*/
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;
/* 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;
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;
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;
/* 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;
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;
}
}
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;
}
}
}
}
- 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;
}