diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index 7874ed60..db028e7e 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -104,9 +104,12 @@ static void handle_client_connect_cmd(CLIENT_REC *client, g_free_not_null(client->nick); client->nick = g_strdup(args); } else if (strcmp(cmd, "USER") == 0) { - if (client->nick == NULL || - (*password != '\0' && !client->pass_sent)) { - /* stupid client didn't send us NICK/PASS, kill it */ + client->user_sent = TRUE; + } + + if (client->nick != NULL && client->user_sent) { + if (*password != '\0' && !client->pass_sent) { + /* client didn't send us PASS, kill it */ remove_client(client); } else { client->connected = TRUE; diff --git a/src/irc/proxy/module.h b/src/irc/proxy/module.h index 5a5c800f..3635d73f 100644 --- a/src/irc/proxy/module.h +++ b/src/irc/proxy/module.h @@ -26,6 +26,7 @@ typedef struct { LISTEN_REC *listen; IRC_SERVER_REC *server; unsigned int pass_sent:1; + unsigned int user_sent:1; unsigned int connected:1; } CLIENT_REC;