]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Correctly handle "CAP END", new client type CLIENT_WAITCAPEND
authorAlexander Barton <alex@barton.de>
Sat, 31 Mar 2012 14:37:31 +0000 (16:37 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 31 Mar 2012 14:37:31 +0000 (16:37 +0200)
src/ngircd/client.h
src/ngircd/irc-cap.c
src/ngircd/login.c
src/ngircd/parse.c

index bdad9ce93530ace226d5da1885cdb54cafa67ee9..4dbcc7a072232eacfe7cf45020cd2136fb774eb2 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef STRICT_RFC
 # define CLIENT_WAITAUTHPING 512       /* waiting for AUTH PONG from client */
 #endif
+#define CLIENT_WAITCAPEND 1024         /* waiting for "CAP END" command */
 
 #define CLIENT_TYPE int
 
index 926943c859ab5f265ac3dda585e62ea2ff2bb4cb..956b359930330347df3b601b8418ca762359f63f 100644 (file)
@@ -180,7 +180,7 @@ Handle_CAP_END(CLIENT *Client)
                /* User is still logging in ... */
                Client_CapDel(Client, CLIENT_CAP_PENDING);
 
-               if (Client_Type(Client) == CLIENT_GOTUSER) {
+               if (Client_Type(Client) == CLIENT_WAITCAPEND) {
                        /* Only "CAP END" was missing: log in! */
                        return Login_User(Client);
                }
index ad45219eca164aeb16cd3cf6f3ad485fe880439c..38089976aaae785a2450e2506970a1d4cfc8a0fb 100644 (file)
@@ -80,8 +80,11 @@ Login_User(CLIENT * Client)
 #endif
 
        /* Still waiting for "CAP END" command? */
-       if (Client_Cap(Client) & CLIENT_CAP_PENDING)
+       if (Client_Cap(Client) & CLIENT_CAP_PENDING) {
+               Client_SetType(Client, CLIENT_WAITCAPEND);
+               LogDebug("Connection %d: Waiting for CAP END ...", conn);
                return CONNECTED;
+       }
 
 #ifdef PAM
        if (!Conf_PAM) {
index 41e3872f66be7a07bff7ab424c46f77fe848d9f6..66bfef53052322dd9c986d0dee19af9372f12e75 100644 (file)
@@ -114,7 +114,7 @@ static COMMAND My_Commands[] =
        { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, 0, 0 },
 #endif
 #ifndef STRICT_RFC
-       { "CAP", IRC_CAP, CLIENT_UNKNOWN|CLIENT_GOTNICK|CLIENT_GOTPASS|CLIENT_GOTUSER|CLIENT_USER, 0, 0, 0 },
+       { "CAP", IRC_CAP, 0xFFFF, 0, 0, 0 },
        { "GET",  IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
        { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
 #endif