From 7dfcffd6853547eb2e73d161916d5a289069baf2 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 17 May 2013 01:31:32 +0100 Subject: Start to replace MAXBUF with . --- configure | 7 ++----- include/configreader.h | 8 +++++--- make/configure.pm | 3 --- src/configreader.cpp | 10 ++++++++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/configure b/configure index ed301c988..5bad741c6 100755 --- a/configure +++ b/configure @@ -54,7 +54,7 @@ use make::configure; ############################################################################################### our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_ports, $opt_epoll, $opt_kqueue, - $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_maxbuf, $opt_freebsd_port, $opt_system, $opt_uid); + $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_freebsd_port, $opt_system, $opt_uid); our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir, $opt_data_dir, $opt_log_dir); @@ -80,7 +80,6 @@ GetOptions ( 'disable-epoll' => \$opt_noepoll, 'disable-kqueue' => \$opt_nokqueue, 'with-cc=s' => \$opt_cc, - 'with-maxbuf=i' => \$opt_maxbuf, 'enable-freebsd-ports-openssl' => \$opt_freebsd_port, 'prefix=s' => \$opt_base_dir, 'config-dir=s' => \$opt_config_dir, @@ -123,7 +122,6 @@ our $interactive = !( (defined $opt_nokqueue) || (defined $opt_noepoll) || (defined $opt_noports) || - (defined $opt_maxbuf) || (defined $opt_system) || (defined $opt_uid) || (defined $opt_use_gnutls) || @@ -250,7 +248,6 @@ our $exec = $config{CC} . " -dumpversion | cut -c 1"; chomp($config{GCCVER} = `$exec`); # Major GCC Version $exec = $config{CC} . " -dumpversion | cut -c 3"; chomp($config{GCCMINOR} = `$exec`); -$config{MAXBUF} = "512"; # Max buffer size if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)(?:[a-z])?(?:\-[a-z][0-9])?/) { $config{HAS_OPENSSL} = $1; @@ -836,7 +833,7 @@ sub writefiles { #define MOD_PATH "$config{MODULE_DIR}" EOF -print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; +print FILEHANDLE "#define MAXBUF 514\n"; if ($config{OSNAME} =~ /SunOS/i) { print FILEHANDLE "#define IS_SOLARIS\n"; diff --git a/include/configreader.h b/include/configreader.h index cc1412096..b9ca6940e 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -93,14 +93,16 @@ class ServerLimits size_t MaxGecos; /** Maximum away message length */ size_t MaxAway; + /** Maximum line length */ + size_t MaxLine; /** Creating the class initialises it to the defaults * as in 1.1's ./configure script. Reading other values * from the config will change these values. */ - ServerLimits() : NickMax(31), ChanMax(64), MaxModes(20), IdentMax(12), MaxQuit(255), MaxTopic(307), MaxKick(255), MaxGecos(128), MaxAway(200) - { - } + ServerLimits() : NickMax(31), ChanMax(64), MaxModes(20), IdentMax(12), + MaxQuit(255), MaxTopic(307), MaxKick(255), MaxGecos(128), MaxAway(200), + MaxLine(512) { } }; struct CommandLineConf diff --git a/make/configure.pm b/make/configure.pm index d76b1143d..2ae9c7fa0 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -297,9 +297,6 @@ InspIRCd 1.0.x, are also allowed. to select() [not set] --with-cc=[filename] Use an alternative compiler to build InspIRCd [g++] - --with-maxbuf=[n] Change the per message buffer size [512] - DO NOT ALTER THIS OPTION WITHOUT GOOD REASON - AS IT *WILL* BREAK CLIENTS!!! --prefix=[directory] Base directory to install into (if defined, can automatically define config, module, bin and library dirs as subdirectories of prefix) diff --git a/src/configreader.cpp b/src/configreader.cpp index a8c0abe89..bd8320137 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -367,10 +367,15 @@ void ServerConfig::Fill() else { if (ServerName != ConfValue("server")->getString("name")) - throw CoreException("You must restart to change the server name or SID"); + throw CoreException("You must restart to change the server name"); + std::string nsid = ConfValue("server")->getString("id"); if (!nsid.empty() && nsid != sid) - throw CoreException("You must restart to change the server name or SID"); + throw CoreException("You must restart to change the server id"); + + if (Limits.MaxLine != static_cast(ConfValue("limits")->getInt("maxline", 512))) + throw CoreException("You must restart to change the maximum line length"); + } diepass = ConfValue("power")->getString("diepass"); restartpass = ConfValue("power")->getString("restartpass"); @@ -423,6 +428,7 @@ void ServerConfig::Fill() Limits.MaxKick = ConfValue("limits")->getInt("maxkick", 255); Limits.MaxGecos = ConfValue("limits")->getInt("maxgecos", 128); Limits.MaxAway = ConfValue("limits")->getInt("maxaway", 200); + Limits.MaxLine = ConfValue("limits")->getInt("maxline", 512); InvBypassModes = options->getBool("invitebypassmodes", true); NoSnoticeStack = options->getBool("nosnoticestack", false); -- cgit v1.2.3