]> jfr.im git - irc/quakenet/newserv.git/commit
Avoid triggering invalid HOOK_CHANNEL_CREATE or HOOK_CHANNEL_JOINs
authorsplidge <redacted>
Mon, 30 Jul 2007 10:52:01 +0000 (11:52 +0100)
committersplidge <redacted>
Mon, 30 Jul 2007 10:52:01 +0000 (11:52 +0100)
commite2f3cad8bb745616bd6c6e2a3192bfd035f862b8
treeaf36f70e16d46a4d1ba38badf1cf46405530b76f
parent6cf96ae36cb8140adda8ecd80c8868761c7d6ee1
Avoid triggering invalid HOOK_CHANNEL_CREATE or HOOK_CHANNEL_JOINs

When a channel is created in response to a join or create, we send out the
HOOK_CHANNEL_NEWCHANNEL message.  Some things (e.g. Q9) might choose to
kick the user off, thus destroying the channel, in response to this.  In
such an event, sending HOOK_CHANNEL_CREATE or HOOK_CHANNEL_JOIN out with
a now invalid channel pointer can cause trouble, so don't do it.

Note there is the potential problem that the chanindex * can become
"invalid" when the channel is destroyed; in practice this should not be a
problem because (a) Usually something else will be hanging off the chanindex
if it has decided to kick the user out! and (b) chanindex's are allocated
using a recycling pool allocator, so even if the chanindex has been free'd
it will still be a valid pointer.
channel/channelhandlers.c