From 5fad8375bda29e4740720438a38815b773023a38 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 22 Apr 2017 19:14:33 +0200 Subject: server: Log out on *all* invalid logins --- command.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command.c b/command.c index 2a75e7f..bcfa2e8 100644 --- a/command.c +++ b/command.c @@ -32,6 +32,11 @@ static bool cmd_login(struct conn_data *data,const char *tag,const char **args){ i64 userid=db_find_user(args[0]); if(userid==-1){ net_send_error(data->fd,tag,"User not found"); + if(data->userid!=-1){ + userdata_unregister(data->userid,data->fd); + broadcast_online_change(data->userid); + data->userid=-1; + } return false; } char *pass=db_get_pass(userid); -- cgit v1.2.3-70-g09d2