+Mon May 2 10:42:49 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
+
+ * Added default limit how many channels client can join,
+ default is 50. Added 'channel_join_limit' configuration
+ option to server too. Affected files are apps/silcd/command.c
+ and serverconfig.[ch].
+
Sun May 1 17:42:55 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
* --without-silc -> --with-silc, --without-irssi -> --with-irssi.
goto out;
}
+#ifndef SILC_DIST_INPLACE
+ /* Limit how many channels client can join */
+ if (entry->channels && silc_hash_table_count(entry->channels) >=
+ server->config->param.chlimit) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
+ SILC_STATUS_ERR_RESOURCE_LIMIT,
+ 0);
+ goto out;
+ }
+#endif /* SILC_DIST_INPLACE */
+
silc_free(client_id);
client_id = silc_id_dup(entry->id, SILC_ID_CLIENT);
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 1997 - 2004 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
SET_PARAM_DEFAULT(qos_bytes_limit, SILC_SERVER_QOS_BYTES_LIMIT);
SET_PARAM_DEFAULT(qos_limit_sec, SILC_SERVER_QOS_LIMIT_SEC);
SET_PARAM_DEFAULT(qos_limit_usec, SILC_SERVER_QOS_LIMIT_USEC);
+ SET_PARAM_DEFAULT(chlimit, SILC_SERVER_CH_JOIN_LIMIT);
#undef SET_PARAM_DEFAULT
}
else if (!strcmp(name, "qos_limit_usec")) {
config->param.qos_limit_usec = *(SilcUInt32 *)val;
}
+ else if (!strcmp(name, "channel_join_limit")) {
+ config->param.chlimit = *(SilcUInt32 *)val;
+ }
else if (!strcmp(name, "debug_string")) {
CONFIG_IS_DOUBLE(config->debug_string);
config->debug_string = (*(char *)val ? strdup((char *) val) : NULL);
{ "qos_bytes_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "qos_limit_sec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "qos_limit_usec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
+ { "channel_join_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "debug_string", SILC_CONFIG_ARG_STR, fetch_generic, NULL },
{ 0, 0, 0, 0 }
};
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 1997 - 2002 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
SilcUInt32 qos_bytes_limit;
SilcUInt32 qos_limit_sec;
SilcUInt32 qos_limit_usec;
+ SilcUInt32 chlimit;
unsigned int key_exchange_pfs : 1;
unsigned int reconnect_keep_trying : 1;
unsigned int anonymous : 1;