From 36a687c1ed3ce55520bdf28cd2fa1f653360068d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 18 Jun 2010 16:37:09 +0100 Subject: [PATCH] director: If same user gets redirected to two hosts, don't crash later. --HG-- branch : HEAD --- src/director/director-connection.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/director/director-connection.c b/src/director/director-connection.c index b398497c2f..4fff94e684 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -175,7 +175,13 @@ director_user_refresh(struct director *dir, unsigned int username_hash, "%s and %s", username_hash, net_ip2addr(&user->host->ip), net_ip2addr(&host->ip)); + + /* change the host anyway. we'll also need to remove the user + from the old host's user_count, because we can't keep track + of the user for more than one host */ + user->host->user_count--; user->host = host; + user->host->user_count++; ret = TRUE; } *user_r = user; -- 2.47.3