mirror of
https://github.com/osmarks/ngircd.git
synced 2025-04-28 21:53:11 +00:00
Make the maximum /list reply length a configurable limit.
This commit is contained in:
parent
23572af942
commit
32f63abb59
@ -100,6 +100,10 @@
|
|||||||
# maximum nick name length!
|
# maximum nick name length!
|
||||||
;MaxNickLength = 9
|
;MaxNickLength = 9
|
||||||
|
|
||||||
|
# Maximum number of channels returned in response to a /list
|
||||||
|
# command (0: unlimited):
|
||||||
|
;MaxListSize = 100
|
||||||
|
|
||||||
# After <PingTimeout> seconds of inactivity the server will send a
|
# After <PingTimeout> seconds of inactivity the server will send a
|
||||||
# PING to the peer to test whether it is alive or not.
|
# PING to the peer to test whether it is alive or not.
|
||||||
;PingTimeout = 120
|
;PingTimeout = 120
|
||||||
|
@ -350,6 +350,7 @@ Conf_Test( void )
|
|||||||
printf(" MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
|
printf(" MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
|
||||||
printf(" MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
|
printf(" MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
|
||||||
printf(" MaxNickLength = %u\n", Conf_MaxNickLength - 1);
|
printf(" MaxNickLength = %u\n", Conf_MaxNickLength - 1);
|
||||||
|
printf(" MaxListSize = %d\n", Conf_MaxListSize);
|
||||||
printf(" PingTimeout = %d\n", Conf_PingTimeout);
|
printf(" PingTimeout = %d\n", Conf_PingTimeout);
|
||||||
printf(" PongTimeout = %d\n", Conf_PongTimeout);
|
printf(" PongTimeout = %d\n", Conf_PongTimeout);
|
||||||
puts("");
|
puts("");
|
||||||
@ -706,6 +707,7 @@ Set_Defaults(bool InitServers)
|
|||||||
Conf_MaxConnectionsIP = 5;
|
Conf_MaxConnectionsIP = 5;
|
||||||
Conf_MaxJoins = 10;
|
Conf_MaxJoins = 10;
|
||||||
Conf_MaxNickLength = CLIENT_NICK_LEN_DEFAULT;
|
Conf_MaxNickLength = CLIENT_NICK_LEN_DEFAULT;
|
||||||
|
Conf_MaxListSize = 100;
|
||||||
Conf_PingTimeout = 120;
|
Conf_PingTimeout = 120;
|
||||||
Conf_PongTimeout = 20;
|
Conf_PongTimeout = 20;
|
||||||
|
|
||||||
@ -1457,6 +1459,12 @@ Handle_LIMITS(int Line, char *Var, char *Arg)
|
|||||||
Conf_MaxNickLength = Handle_MaxNickLength(Line, Arg);
|
Conf_MaxNickLength = Handle_MaxNickLength(Line, Arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (strcasecmp(Var, "MaxListSize") == 0) {
|
||||||
|
Conf_MaxListSize = atoi(Arg);
|
||||||
|
if (!Conf_MaxListSize && strcmp(Arg, "0"))
|
||||||
|
Config_Error_NaN(Line, Var);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (strcasecmp(Var, "PingTimeout") == 0) {
|
if (strcasecmp(Var, "PingTimeout") == 0) {
|
||||||
Conf_PingTimeout = atoi(Arg);
|
Conf_PingTimeout = atoi(Arg);
|
||||||
if (Conf_PingTimeout < 5) {
|
if (Conf_PingTimeout < 5) {
|
||||||
|
@ -220,6 +220,9 @@ GLOBAL int Conf_MaxConnectionsIP;
|
|||||||
/** Maximum length of a nick name */
|
/** Maximum length of a nick name */
|
||||||
GLOBAL unsigned int Conf_MaxNickLength;
|
GLOBAL unsigned int Conf_MaxNickLength;
|
||||||
|
|
||||||
|
/** Maximum number of channels returned to /list */
|
||||||
|
GLOBAL int Conf_MaxListSize;
|
||||||
|
|
||||||
#ifndef STRICT_RFC
|
#ifndef STRICT_RFC
|
||||||
|
|
||||||
/** Require "AUTH PING-PONG" on login */
|
/** Require "AUTH PING-PONG" on login */
|
||||||
|
@ -181,9 +181,6 @@
|
|||||||
|
|
||||||
/* Defaults and limits for IRC commands */
|
/* Defaults and limits for IRC commands */
|
||||||
|
|
||||||
/** Max. number of LIST replies. */
|
|
||||||
#define MAX_RPL_LIST 100
|
|
||||||
|
|
||||||
/** Max. number of elemets allowed in channel invite and ban lists. */
|
/** Max. number of elemets allowed in channel invite and ban lists. */
|
||||||
#define MAX_HNDL_CHANNEL_LISTS 50
|
#define MAX_HNDL_CHANNEL_LISTS 50
|
||||||
|
|
||||||
|
@ -679,8 +679,9 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
|
|||||||
if (!strchr(Channel_Modes(chan), 's')
|
if (!strchr(Channel_Modes(chan), 's')
|
||||||
|| Channel_IsMemberOf(chan, from)
|
|| Channel_IsMemberOf(chan, from)
|
||||||
|| (!Conf_MorePrivacy && Client_OperByMe(Client))) {
|
|| (!Conf_MorePrivacy && Client_OperByMe(Client))) {
|
||||||
if (IRC_CheckListTooBig(from, count,
|
if ((Conf_MaxListSize > 0)
|
||||||
MAX_RPL_LIST,
|
&& IRC_CheckListTooBig(from, count,
|
||||||
|
Conf_MaxListSize,
|
||||||
"LIST"))
|
"LIST"))
|
||||||
break;
|
break;
|
||||||
if (!IRC_WriteStrClient(from,
|
if (!IRC_WriteStrClient(from,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user