Message handlers should return void.
Also fix up some return values and stuff to use bool (or void if nothing). I just did it whilst I was here. According to jilles, the return value used to signify whether or not the client had exited. This was error-prone and was fixed a long, long time ago, but the return value was left int for historical reasons. Since the return type is not used (and has no clear use case anyway), it's safe to just get rid of it.
This commit is contained in:
parent
eeabf33a7c
commit
3c7d6fcce7
99 changed files with 1339 additions and 1691 deletions
|
@ -39,7 +39,7 @@
|
|||
static const char user_desc[] =
|
||||
"Provides the USER command to register a new connection";
|
||||
|
||||
static int mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
|
||||
struct Message user_msgtab = {
|
||||
"USER", 0, 0, 0, 0,
|
||||
|
@ -49,8 +49,8 @@ struct Message user_msgtab = {
|
|||
mapi_clist_av1 user_clist[] = { &user_msgtab, NULL };
|
||||
DECLARE_MODULE_AV2(user, NULL, NULL, user_clist, NULL, NULL, NULL, NULL, user_desc);
|
||||
|
||||
static int do_local_user(struct Client *client_p, struct Client *source_p,
|
||||
const char *username, const char *realname);
|
||||
static void do_local_user(struct Client *client_p, struct Client *source_p,
|
||||
const char *username, const char *realname);
|
||||
|
||||
/* mr_user()
|
||||
* parv[1] = username (login name, account)
|
||||
|
@ -58,7 +58,7 @@ static int do_local_user(struct Client *client_p, struct Client *source_p,
|
|||
* parv[3] = server host name (ignored)
|
||||
* parv[4] = users gecos
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
static char buf[BUFSIZE];
|
||||
|
@ -67,11 +67,11 @@ mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
if (strlen(client_p->id) == 3)
|
||||
{
|
||||
exit_client(client_p, client_p, client_p, "Mixing client and server protocol");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if(source_p->flags & FLAGS_SENTUSER)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if((p = strchr(parv[1], '@')))
|
||||
*p = '\0';
|
||||
|
@ -81,10 +81,9 @@ mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
source_p->localClient->fullcaps = rb_strdup(buf);
|
||||
|
||||
do_local_user(client_p, source_p, parv[1], parv[4]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
do_local_user(struct Client *client_p, struct Client *source_p,
|
||||
const char *username, const char *realname)
|
||||
{
|
||||
|
@ -104,8 +103,6 @@ do_local_user(struct Client *client_p, struct Client *source_p,
|
|||
if(source_p->name[0])
|
||||
{
|
||||
/* NICK already received, now I have USER... */
|
||||
return register_local_user(client_p, source_p);
|
||||
register_local_user(client_p, source_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue