commit da4c1ebe81bbd1335356ef40c91741b953c9f8d8 from: Alexander Barton date: Sat Mar 31 14:37:31 2012 UTC Correctly handle "CAP END", new client type CLIENT_WAITCAPEND commit - bd3a7ccb158c9f2eac1af77804529b76d99c3e79 commit + da4c1ebe81bbd1335356ef40c91741b953c9f8d8 blob - bdad9ce93530ace226d5da1885cdb54cafa67ee9 blob + 4dbcc7a072232eacfe7cf45020cd2136fb774eb2 --- src/ngircd/client.h +++ src/ngircd/client.h @@ -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 blob - 926943c859ab5f265ac3dda585e62ea2ff2bb4cb blob + 956b359930330347df3b601b8418ca762359f63f --- src/ngircd/irc-cap.c +++ src/ngircd/irc-cap.c @@ -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); } blob - ad45219eca164aeb16cd3cf6f3ad485fe880439c blob + 38089976aaae785a2450e2506970a1d4cfc8a0fb --- src/ngircd/login.c +++ src/ngircd/login.c @@ -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) { blob - 41e3872f66be7a07bff7ab424c46f77fe848d9f6 blob + 66bfef53052322dd9c986d0dee19af9372f12e75 --- src/ngircd/parse.c +++ src/ngircd/parse.c @@ -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