WHOIS command: make sure the reply ends with RPL_ENDOFWHOIS
authorAlexander Barton <alex@barton.de>
Wed, 4 Jan 2012 23:22:57 +0000 (00:22 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 4 Jan 2012 23:22:57 +0000 (00:22 +0100)
Up to now, each reply for itself ended in RPL_ENDOFWHOIS and queries
for unknown nick names lacked the RPL_ENDOFWHOIS -- both is wrong.

src/ngircd/irc-info.c

index 5e56949f553b92d1ed3154863313bd3700b56668..c2f4910e47645807251c82e9815e61ccdbc08279 100644 (file)
@@ -1109,8 +1109,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
                                    Client_Away(c)))
                        return DISCONNECTED;
 
-       return IRC_WriteStrClient(from, RPL_ENDOFWHOIS_MSG,
-                                 Client_ID(from), Client_ID(c));
+       return CONNECTED;
 } /* IRC_WHOIS_SendReply */
 
 
@@ -1219,10 +1218,12 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
                }
 
                if (match_count == 0)
-                       return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
-                               Client_ID(Client), Req->argv[Req->argc - 1]);
+                       IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
+                                          Client_ID(Client),
+                                          Req->argv[Req->argc - 1]);
        }
-       return CONNECTED;
+       return IRC_WriteStrClient(from, RPL_ENDOFWHOIS_MSG,
+                                 Client_ID(from), Req->argv[Req->argc - 1]);
 } /* IRC_WHOIS */