AP_DECLARE_DATA scoreboard *ap_scoreboard_image = NULL;
AP_DECLARE_DATA const char *ap_scoreboard_fname = NULL;
+static ap_scoreboard_e scoreboard_type;
const char * ap_set_scoreboard(cmd_parms *cmd, void *dummy,
const char *arg)
return scoreboard_size;
}
-void ap_init_scoreboard(void *shared_score)
+AP_DECLARE(void) ap_init_scoreboard(void *shared_score)
{
char *more_storage;
int i;
/* If detach is non-zero, this is a separate child process,
* if zero, it is a forked child.
*/
-apr_status_t ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached)
+AP_DECLARE(apr_status_t) ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm,
+ int detached)
{
#if APR_HAS_SHARED_MEMORY
if (!detached) {
if (ap_scoreboard_image == NULL) {
return APR_SUCCESS;
}
- if (ap_scoreboard_image->global->sb_type == SB_SHARED) {
+ if (scoreboard_type == SB_SHARED) {
ap_cleanup_shared_mem(NULL);
}
else {
ap_init_scoreboard(sb_mem);
}
- ap_scoreboard_image->global->sb_type = sb_type;
+ scoreboard_type = sb_type;
ap_scoreboard_image->global->running_generation = 0;
ap_scoreboard_image->global->restart_time = apr_time_now();
AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid)
{
int i;
- int max_daemons_limit;
+ int max_daemons_limit = 0;
ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit);
REMOTE_NOLOOKUP, NULL), sizeof(ws->client));
copy_request(ws->request, sizeof(ws->request), r);
if (r->server) {
- apr_cpystrn(ws->vhost, r->server->server_hostname,
- sizeof(ws->vhost));
+ apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",
+ r->server->server_hostname,
+ r->connection->local_addr->port);
}
}
else if (c) {