Skip to content

Commit 5a3f762

Browse files
Actually change whether we're locked if we can't read the lock key
1 parent b63d799 commit 5a3f762

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

redis_session.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ static void refresh_lock_status(RedisSock *redis_sock, redis_session_lock_status
345345
if (lock_status->is_locked && INI_INT("redis.session.lock_expire") == 0)
346346
return;
347347

348+
/* Command to get our lock key value and compare secrets */
348349
cmdlen = REDIS_SPPRINTF(&cmd, "GET", "s", lock_status->lock_key,
349350
strlen(lock_status->lock_key));
350351

@@ -353,6 +354,8 @@ static void refresh_lock_status(RedisSock *redis_sock, redis_session_lock_status
353354
if (reply != NULL) {
354355
lock_status->is_locked = IS_LOCK_SECRET(reply, replylen, lock_status->lock_secret);
355356
efree(reply);
357+
} else {
358+
lock_status->is_locked = 0;
356359
}
357360

358361
/* Issue a warning if we're not locked. We don't attempt to refresh the lock

0 commit comments

Comments
 (0)