From 9dd46372ff722a54d70ae383b79542f6d3c60200 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 6 Dec 2001 15:11:08 +0000 Subject: Allow sending USER before NICK when logging in. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2198 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/proxy/listen.c | 9 ++++++--- src/irc/proxy/module.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) 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; -- cgit v1.2.3