channame = strtok_r(channame, ",", &lastchan);
/* Make sure that "channame" is not the empty string ("JOIN :") */
- if (!channame) {
- IRC_SetPenalty(Client, 2);
+ if (!channame)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
while (channame) {
flags = NULL;
chan = strtok(Req->argv[0], ",");
/* Make sure that "chan" is not the empty string ("PART :") */
- if (!chan) {
- IRC_SetPenalty(Client, 2);
+ if (!chan)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
while (chan) {
Channel_Part(target, Client, chan,
assert( Req != NULL );
/* Bad number of parameters? */
- if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
/* Compatibility kludge */
if (Req->argc == 5)
} else if (Client_Type(Client) == CLIENT_UNKNOWN ||
Client_Type(Client) == CLIENT_UNKNOWNSERVER) {
/* Unregistered connection, but wrong number of arguments: */
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
} else {
/* Server or service introduces new client */
/* Bad number of parameters? */
- if (Req->argc != 2 && Req->argc != 7) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 2 && Req->argc != 7)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
if (Req->argc >= 7) {
/* RFC 2813 compatible syntax */
/* Search the target */
target = Client_Search(Req->argv[0]);
- if (!target || Client_Type(target) != CLIENT_USER) {
+ if (!target || Client_Type(target) != CLIENT_USER)
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->argv[0]);
- }
if (Client_Conn(target) <= NONE) {
/* We have to forward the message to the server handling
*/
#define _IRC_ARGC_EQ_OR_RETURN_(Client, Req, Count) \
if (Req->argc != Count) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_LE_OR_RETURN_(Client, Req, Max) \
if (Req->argc > Max) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_GE_OR_RETURN_(Client, Req, Min) \
if (Req->argc < Min) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, Min, Max) \
if (Req->argc < Min || Req->argc > Max) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
* mode, because most other servers don't do
* it as well and some clients send "wired"
* MODE commands like "MODE #chan -ooo nick". */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
nickCount--;
}
} else {
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
/* Bad number of parameters? */
if (Req->argc != 1 && Req->argc != 2 && Req->argc != 3 &&
- Req->argc != 5 && Req->argc != 6) {
- IRC_SetPenalty(Client, 2);
+ Req->argc != 5 && Req->argc != 6)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
/* Invalid port number? */
- if ((Req->argc > 1) && atoi(Req->argv[1]) < 1) {
- IRC_SetPenalty(Client, 2);
+ if ((Req->argc > 1) && atoi(Req->argv[1]) < 1)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
if (Client_Type(Client) != CLIENT_SERVER
&& !Client_HasMode(Client, 'o'))
assert(Req != NULL);
/* Bad number of parameters? */
- if (Req->argc != 1 && Req->argc != 3) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 1 && Req->argc != 3)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
from = Op_Check(Client, Req);
if (!from)
LogDebug("Connection %d: got SERVER command (new server link) ...",
Client_Conn(Client));
- if (Req->argc != 2 && Req->argc != 3) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 2 && Req->argc != 3)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client),
Req->command);
- }
/* Get configuration index of new remote server ... */
for (i = 0; i < MAX_SERVERS; i++)
{
/* New server is being introduced to the network */
- if (Req->argc != 4) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 4)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
/* check for existing server with same ID */
if (!Client_CheckID(Client, Req->argv[0]))
Client_MyToken(c), Client_Info(c));
return CONNECTED;
- } else {
- IRC_SetPenalty(Client, 2);
+ } else
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
} /* IRC_SERVER */
/*
if (Req->argc > 2) {
if (!SendErrors)
return CONNECTED;
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
}
if (Req->argc < cmd->min_argc ||
- (cmd->max_argc != -1 && Req->argc > cmd->max_argc)) {
- IRC_SetPenalty(client, 2);
- return IRC_WriteStrClient(client, ERR_NEEDMOREPARAMS_MSG,
+ (cmd->max_argc != -1 && Req->argc > cmd->max_argc))
+ return IRC_WriteErrClient(client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(client), Req->command);
- }
/* Command is allowed for this client: call it and count
* generated bytes in output */