Skip to content

Commit

Permalink
Use a bool for the accepting_conns stat.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Mar 30, 2009
1 parent 3d540bd commit 0bdda0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions memcached.c
Expand Up @@ -161,7 +161,7 @@ static void stats_init(void) {
stats.curr_items = stats.total_items = stats.curr_conns = stats.total_conns = stats.conn_structs = 0;
stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = stats.evictions = 0;
stats.curr_bytes = stats.listen_disabled_num = 0;
stats.accepting_conns = 1; /* assuming we start in this state. */
stats.accepting_conns = true; /* assuming we start in this state. */

/* make the time we started always be 2 seconds before we really
did, so time(0) - time.started is never zero. if so, things
Expand Down Expand Up @@ -3248,11 +3248,11 @@ void accept_new_conns(const bool do_accept) {

if (do_accept) {
STATS_LOCK();
stats.accepting_conns = 1;
stats.accepting_conns = true;
STATS_UNLOCK();
} else {
STATS_LOCK();
stats.accepting_conns = 0;
stats.accepting_conns = false;
stats.listen_disabled_num++;
STATS_UNLOCK();
}
Expand Down
2 changes: 1 addition & 1 deletion memcached.h
Expand Up @@ -109,7 +109,7 @@ struct stats {
uint64_t get_misses;
uint64_t evictions;
time_t started; /* when the process was started */
unsigned int accepting_conns; /* whether we are currently accepting */
bool accepting_conns; /* whether we are currently accepting */
uint64_t listen_disabled_num;
};

Expand Down

0 comments on commit 0bdda0d

Please sign in to comment.