Skip to content

Commit

Permalink
director: Fix off-by-one when checking if user weakness is stuck
Browse files Browse the repository at this point in the history
When the weakness was exactly at the second, the weakness wasn't detected
and the next expiration timeout was removed entirely. This shouldn't have
caused any bigger problems, because another user lookup on the following
second would have then detected the weakness, removed the user and restored
the next expiration timeout.
  • Loading branch information
sirainen committed Nov 7, 2017
1 parent d17e247 commit 2786a96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/director/user-directory.c
Expand Up @@ -82,7 +82,7 @@ static bool user_directory_user_has_connections(struct user_directory *dir,
}

if (user->weak) {
if (expire_timestamp + USER_NEAR_EXPIRING_MAX >= ioloop_time) {
if (expire_timestamp + USER_NEAR_EXPIRING_MAX > ioloop_time) {
*retry_secs_r = expire_timestamp +
USER_NEAR_EXPIRING_MAX - ioloop_time;
return TRUE;
Expand Down

0 comments on commit 2786a96

Please sign in to comment.