summaryrefslogtreecommitdiff
path: root/memcached.c
diff options
context:
space:
mode:
authorpkarumanchi9 <prudhviraj9@gmail.com>2020-07-09 00:59:44 +0000
committerdormando <dormando@rydia.net>2020-10-30 15:41:54 -0700
commit4c0d45a95c9ba8fb8ea0630b96f4e006ef1698a1 (patch)
treeb4f7a33e7f7ad7a80bdafedfb5d5bdea901cbb85 /memcached.c
parente5817664738e613155078ddea66c9dde73339ac1 (diff)
downloadmemcached-4c0d45a95c9ba8fb8ea0630b96f4e006ef1698a1.tar.gz
fix connection limit tests
Also changes the maxconns_fast test to check against the highest fd
Diffstat (limited to 'memcached.c')
-rw-r--r--memcached.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/memcached.c b/memcached.c
index 4cbbc6c..2d6200b 100644
--- a/memcached.c
+++ b/memcached.c
@@ -3219,12 +3219,12 @@ static void drive_machine(conn *c) {
bool reject;
if (settings.maxconns_fast) {
- STATS_LOCK();
- reject = stats_state.curr_conns + stats_state.reserved_fds >= settings.maxconns - 1;
+ reject = sfd >= settings.maxconns - 1;
if (reject) {
+ STATS_LOCK();
stats.rejected_conns++;
+ STATS_UNLOCK();
}
- STATS_UNLOCK();
} else {
reject = false;
}