Correctly handle "CAP END", new client type CLIENT_WAITCAPEND

This commit is contained in:
Alexander Barton 2012-03-31 16:37:31 +02:00
parent bd3a7ccb15
commit da4c1ebe81
4 changed files with 7 additions and 3 deletions

View 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

View 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);
}

View 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) {

View 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