Skip to content

Commit

Permalink
Tie the names of the states to the enums
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Feb 11, 2014
1 parent 7c5e50c commit bad2892
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/include/radiusd.h
Expand Up @@ -188,6 +188,7 @@ typedef enum {
REQUEST_STOP_PROCESSING,
REQUEST_COUNTED
} rad_master_state_t;
#define REQUEST_MASTER_NUM_STATES (REQUEST_COUNTED + 1)

typedef enum {
REQUEST_QUEUED = 1,
Expand All @@ -197,6 +198,7 @@ typedef enum {
REQUEST_CLEANUP_DELAY,
REQUEST_DONE
} rad_child_state_t;
#define REQUEST_CHILD_NUM_STATES (REQUEST_DONE + 1)

struct request {
#ifndef NDEBUG
Expand Down
4 changes: 2 additions & 2 deletions src/main/process.c
Expand Up @@ -68,14 +68,14 @@ static char const *action_codes[] = {
#ifdef DEBUG_STATE_MACHINE
#define TRACE_STATE_MACHINE if (debug_flag) printf("(%u) ********\tSTATE %s action %s live M-%s C-%s\t********\n", request->number, __FUNCTION__, action_codes[action], master_state_names[request->master_state], child_state_names[request->child_state])

static char const *master_state_names[4] = {
static char const *master_state_names[REQUEST_MASTER_NUM_STATES] = {
"?",
"active",
"stop-processing",
"counted"
};

static char const *child_state_names[7] = {
static char const *child_state_names[REQUEST_CHILD_NUM_STATES] = {
"?",
"queued",
"running",
Expand Down

0 comments on commit bad2892

Please sign in to comment.