summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-14 03:38:59 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-14 03:38:59 +0000
commit523ed6dd706b13780e32becf54406e1687b62ecb (patch)
tree996ffa04735ff280a52fcbabcf3b43b4351f5a6b
parent193f50ab6c9115399bbfd85d6c50683f0af38660 (diff)
Added senddelay directive to memoserv block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1446 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--data/example_new.conf9
-rw-r--r--include/extern.h2
-rw-r--r--src/config.c4
3 files changed, 12 insertions, 3 deletions
diff --git a/data/example_new.conf b/data/example_new.conf
index c198dc0a2..460709ca0 100644
--- a/data/example_new.conf
+++ b/data/example_new.conf
@@ -460,4 +460,13 @@ memoserv
* by default, and normal users can set any limit they want.
*/
maxmemos = 20
+
+ /*
+ * The delay between consecutive uses of the MemoServ SEND command. This can help prevent spam
+ * as well as denial-of-service attacks from sending large numbers of memos and filling up disk
+ * space (and memory). The default 3-second wait means a maximum average of 150 bytes of memo
+ * per second per user under the current IRC protocol. This directive is optional, but
+ * recommended.
+ */
+ senddelay = 3s
}
diff --git a/include/extern.h b/include/extern.h
index d52145275..3870dee09 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -355,7 +355,7 @@ E bool CSRestrictGetPass;
E bool CSOpersOnly;
E int MSMaxMemos;
-E int MSSendDelay;
+E time_t MSSendDelay;
E int MSNotifyAll;
E int MSMemoReceipt;
diff --git a/src/config.c b/src/config.c
index 27f28baf5..b27cab2e3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -157,7 +157,7 @@ bool CSRestrictGetPass;
bool CSOpersOnly;
int MSMaxMemos;
-int MSSendDelay;
+time_t MSSendDelay;
int MSNotifyAll;
int MSMemoReceipt;
@@ -597,6 +597,7 @@ int ServerConfig::Read(bool bail)
{"memoserv", "nick", "MemoServ", new ValueContainerChar(&s_MemoServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"memoserv", "description", "Memo Service", new ValueContainerChar(&desc_MemoServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"memoserv", "maxmemos", "0", new ValueContainerInt(&MSMaxMemos), DT_INTEGER, NoValidation},
+ {"memoserv", "senddelay", "0", new ValueContainerTime(&MSSendDelay), DT_TIME, NoValidation},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1262,7 +1263,6 @@ Directive directives[] = {
{{PARAM_STRING, PARAM_RELOAD, &ModulesDelayed}}},
{"MOTDFile", {{PARAM_STRING, PARAM_RELOAD, &MOTDFilename}}},
{"MSNotifyAll", {{PARAM_SET, PARAM_RELOAD, &MSNotifyAll}}},
- {"MSSendDelay", {{PARAM_TIME, PARAM_RELOAD, &MSSendDelay}}},
{"MSMemoReceipt", {{PARAM_POSINT, PARAM_RELOAD, &MSMemoReceipt}}},
{"NetworkName", {{PARAM_STRING, PARAM_RELOAD, &NetworkName}}},
{"NewsCount", {{PARAM_POSINT, PARAM_RELOAD, &NewsCount}}},