* ircd/m_endburst.c (ms_endofburst): Avoid dereferencing 'chan'
after it may be freed (in sub1_from_channel).
+ * ircd/s_user.c (register_user): Rearrange code to reduce number
+ of "if (MyConnect(sptr))" checks.
+
2005-05-12 Michael Poole <mdpoole@troilus.org>
* configure.in: Do not try to outsmart the default CFLAGS.
return exit_client(cptr, sptr, &me, "USER: Bad username");
}
Count_unknownbecomesclient(sptr, UserStats);
- }
- else {
- ircd_strncpy(user->username, username, USERLEN);
- Count_newremoteclient(UserStats, user->server);
- }
- SetUser(sptr);
- if (IsInvisible(sptr))
- ++UserStats.inv_clients;
- if (IsOper(sptr))
- ++UserStats.opers;
-
- if (MyConnect(sptr)) {
+ SetUser(sptr);
cli_handler(sptr) = CLIENT_HANDLER;
release_dns_reply(sptr);
SetLocalNumNick(sptr);
m_lusers(sptr, sptr, 1, parv);
update_load();
motd_signon(sptr);
-/* nextping = CurrentTime; */
if (cli_snomask(sptr) & SNO_NOISY)
set_snomask(sptr, cli_snomask(sptr) & SNO_NOISY, SNO_ADD);
if (feature_bool(FEAT_CONNEXIT_NOTICES))
break;
case 'i':
SetInvisible(sptr);
- ++UserStats.inv_clients;
break;
case 'd':
SetDeaf(sptr);
}
}
}
- else
- /* if (IsServer(cptr)) */
- {
+ else {
struct Client *acptr;
+ ircd_strncpy(user->username, username, USERLEN);
+ Count_newremoteclient(UserStats, user->server);
+
acptr = user->server;
if (cli_from(acptr) != cli_from(sptr))
{
* FIXME: This can be sped up - its stupid to check it for
* every NICK message in a burst again --Run.
*/
- for (acptr = user->server; acptr != &me; acptr = cli_serv(acptr)->up)
+ for (; acptr != &me; acptr = cli_serv(acptr)->up)
{
if (IsBurst(acptr) || Protocol(acptr) < 10)
break;
sptr, cli_name(&me));
return exit_client(cptr, sptr, &me,"Too many connections from your host -- throttled");
}
+ SetUser(sptr);
}
+
+ if (IsInvisible(sptr))
+ ++UserStats.inv_clients;
+ if (IsOper(sptr))
+ ++UserStats.opers;
+
tmpstr = umode_str(sptr);
/* Send full IP address to IPv6-grokking servers. */
sendcmdto_flag_serv_butone(user->server, CMD_NICK, cptr,