# HG changeset patch # User Timo Sirainen # Date 1276875429 -3600 # Node ID ecf195115922e8eaa6667101cef361b5125f9f62 # Parent 6aa749b789efc019eb623e315d656f93bc3f7c64 director: If same user gets redirected to two hosts, don't crash later. diff -r 6aa749b789ef -r ecf195115922 src/director/director-connection.c --- a/src/director/director-connection.c Fri Jun 18 16:28:49 2010 +0100 +++ b/src/director/director-connection.c Fri Jun 18 16:37:09 2010 +0100 @@ -175,7 +175,13 @@ "%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;