child_slot = i;
for (j = 0; j < HARD_THREAD_LIMIT; j++) {
- ap_reset_connection_status(i * HARD_THREAD_LIMIT + j);
+ ap_dexter_force_reset_connection_status(i * HARD_THREAD_LIMIT + j);
}
break;
}
ap_pid_fname = DEFAULT_PIDLOG;
ap_lock_fname = DEFAULT_LOCKFILE;
max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
+ ap_dexter_set_maintain_connection_status(1);
ap_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
}
return NULL;
}
+static const char *set_maintain_connection_status(cmd_parms *cmd,
+ core_dir_config *d, int arg)
+{
+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+ if (err != NULL) {
+ return err;
+ }
+
+ ap_dexter_set_maintain_connection_status(arg != 0);
+ return NULL;
+}
+
static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
{
struct stat finfo;
"Maximum number of threads per child" },
{ "MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF, TAKE1,
"Maximum number of requests a particular child serves before dying." },
+{ "ConnectionStatus", set_maintain_connection_status, NULL, RSRC_CONF, FLAG,
+ "Whether or not to maintain status information on current connections"},
{ "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1,
"The location of the directory Apache changes to before dumping core" },
{ NULL }
* Above code is shmem code. Below code is interacting with the shmem
****/
-void ap_reset_connection_status(long conn_id)
+static int maintain_connection_status = 1;
+
+void ap_dexter_set_maintain_connection_status(int flag) {
+ maintain_connection_status = flag;
+ return;
+}
+
+/* Useful to erase the status of children that might be from previous
+ * generations */
+void ap_dexter_force_reset_connection_status(long conn_id)
{
int i;
}
}
+void ap_reset_connection_status(long conn_id)
+{
+ if (maintain_connection_status) {
+ ap_dexter_force_reset_connection_status(conn_id);
+ }
+}
+
/* Don't mess with the string you get back from this function */
const char *ap_get_connection_status(long conn_id, const char *key)
{
int i = 0;
status_table_entry *ss;
+ if (!maintain_connection_status) return "";
while (i < STATUSES_PER_CONNECTION) {
ss = &(ap_scoreboard_image->table[conn_id][i]);
if (ss->key[0] == '\0') {
int i = 0;
status_table_entry *ss;
+ if (!maintain_connection_status) return;
while (i < STATUSES_PER_CONNECTION) {
ss = &(ap_scoreboard_image->table[conn_id][i]);
if (ss->key[0] == '\0') {
status_table_entry *ss;
server_status = ap_make_array(p, 0, sizeof(ap_status_table_row_t));
+
+ /* Go ahead and return what's in the connection status table even if we
+ * aren't maintaining it. We can at least look at what children from
+ * previous generations are up to. */
+
for (i = 0; i < max_daemons_limit*HARD_THREAD_LIMIT; i++) {
if (ap_scoreboard_image->table[i][0].key[0] == '\0')
continue;