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.
This fixes a regression in commmit 70ac43ce77,
where the original screen size would be used to scroll after the terminal had
been resized. If the screen was shrunk, this caused display problems when
running under GNU Screen.
Using output_screen size means that it stands a better chance of working on
non-default screens, too.
There should be no change in behaviour. Replaces a code block of the form:
if (a || b)
{
if (c && a)
{
/* one */
}
else if (b)
{
/* two */
}
}
with the simpler equivalent:
if (c && a)
{
/* one */
}
else if (b)
{
/* two */
}
Change remove_all_dcc_binds() so that it only removes DCC binds for the module supplied, as it's supposed to.
get_dcc_type() should ignore the first entry in dcc_types[] ("<none>") otherwise the client will try to
respond to DCC requests with that name.
Explicitly track the number of entries in the dcc_types[] array rather than using a NULL terminator. This
allows us to change dcc_types[] to use NULL entries to mark unused slots in the array, rather than pointers
to entries with a NULL .name element. Together, this means that the dcc_types[] array is only resized when it
actually needs to be grown and removal works correctly (without eg. prematurely marking the end of the array).
Make add_dcc_bind() fail if the requested DCC type has already been bound by a module (this still allows one
module at a time to rebind a built-in DCC type). Previously the behaviour was ill-defined in this case.
The idea here is that if you have a module which implements a new DCC type that is essentially
a lightly-modified version of CHAT or SEND you can reuse these functions.
This function gets the status of a single umode flag identified by umode char rather than
internal server flag number.
This also lets us remove all the USER_MODE* constants because they're no longer required.
Invert the sense of the +w check in e_wall() - we only echo our OPERWALL if we're *not* +w,
because if we are +w then the server will echo it back to us anyway.