Show total channel memory use for /CHANST -ALL (previously it just showed the size of a single channel struct).
Fix stray cyan-coloured [ for /CHANST -ALL.
Fix display of "Channel created" and "in memory", which were displayed the wrong way around.
A queued CSET is one that is set before the matching channel is joined. The CSetList is allocated and linked to
the cset_queue list.
The use-after-free bug was caused because the CSetList wasn't removed from the cset_queue after it was attached
to a joined channel. If the channel is parted, it eventually ages out of the Whowas-Chan-List and the CSetList
is freed, but there is now a dangling pointer to it in the cset_queue. This is fixed by removing the CSetList
from the cset_queue when it is attached to a channel, so the net result of /CSET #chan ; /JOIN #chan is the same
as doing the reverse.
Queued wildcard CSETs never worked properly - the queued CSET with the wildcard name would end up attached to any
subsequent matching channel that was joined. Channel names with wildcards in them are legal anyway, so the best
medium-term solution (pending a full redesign of the whole CSET command) is to just enforce that queued CSETs are
always literal channel names, not wildcards.
Needed to bump it to 16 anyway (the RFC says 15 plus the protocol command itself, so 16), but EPIC5 bumped it
up to 20 based on a report from users of RusNet so we might as well go up to that as well.
The previous handling for this had the : prefixing the last protocol argument reappear after
a PasteArgs() call. This caused problems with the inspircd server, which prefixes the final
argument for every protocol message with :. In particular the MODE command was problematic.
See https://github.com/inspircd/inspircd/issues/1636
Reported-by: trn
The intention is to display this message when the client has failed to
connect to enough servers that it has to start back at the initially
requested server again.
The old code instead had some quite odd conditions.
The previous code relied on server[i].retries being equal to one less than the
number of connection attempts that had been made on entry to advance_server(), but
this was false for the initial connection attempt.
Change the code instead so that on entry to advance_server(), server[i].retries is
always the number of previous connection attempts that have been made. This does the
right thing for initial connection attempts since .retries starts at zero.
finalize_server_connect() can fail for SSL connections, because SSL_connect() can fail. Without this change, the client won't
try to reconnect after an initial SSL connection failure - it'll just wait forever.
Reported by g0z, thanks!
The new implementation calls into strlen() and memmove(), and is safe to use even if the arguments don't
point into the same string.
The return value is now the same as the first argument (just like strcpy()), but no existing callers care
about the return value anyway.
This code contained a bug where any argument to /HISTORY that _didn't_ start with "-CL" would clear history,
so no number or pattern argument could successfully be passed.
With this fix only an argument that case-insensitively matches "-clear" will clear history, so a pattern
argument will also work correctly.
This should have no functional effect, but groups together the variables required to
'rewind' prepare_display() to a particular point in the source string all together.
This also counts beeps, tabs and non-destructive spaces in the same way.
To maintain historical behaviour, BEEP_MAX of zero indicates no beeps allowed (the same
as /SET BEEP OFF), but TAB_MAX and ND_SPACE_MAX of zero indicates no limit.