- while (current->BufferIsReady())
- {
- // use GetBuffer to copy single lines into the sanitized string
- std::string single_line = current->GetBuffer();
- current->bytes_in += single_line.length();
- current->cmds_in++;
- if (single_line.length() > MAXBUF - 2) // MAXBUF is 514 to allow for neccessary line terminators
- single_line.resize(MAXBUF - 2); // So to trim to 512 here, we use MAXBUF - 2
-
- // ProcessBuffer returns false if the user has gone over penalty
- if (!ServerInstance->Parser->ProcessBuffer(single_line, current) || one_only)
- break;
- }
-}
-
-bool CommandParser::ProcessCommand(User *user, std::string &cmd)
-{
- std::vector<std::string> command_p;
- irc::tokenstream tokens(cmd);
- std::string command, token;
- tokens.GetToken(command);
-
- /* A client sent a nick prefix on their command (ick)
- * rhapsody and some braindead bouncers do this --
- * the rfc says they shouldnt but also says the ircd should
- * discard it if they do.
- */
- if (command[0] == ':')
- tokens.GetToken(command);
-
- while (tokens.GetToken(token) && (command_p.size() <= MAXPARAMETERS))
- command_p.push_back(token);
-
- std::transform(command.begin(), command.end(), command.begin(), ::toupper);
-