mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 13:45:10 +00:00
[ADD] Proper stanza limits
This commit is contained in:
parent
ce8bbb5540
commit
7c60ab28cb
18 changed files with 74 additions and 39 deletions
|
|
@ -23,11 +23,12 @@ Main(Array *args, HashMap *env)
|
|||
int flag, code = EXIT_FAILURE;
|
||||
int port = 5347;
|
||||
size_t lmdb_size = 0;
|
||||
size_t max_stanza = 10000;
|
||||
|
||||
listen = "localhost";
|
||||
|
||||
ArgParseStateInit(&state);
|
||||
while ((flag = ArgParse(&state, args, "H:J:s:d:p:m:l:S:")) != -1)
|
||||
while ((flag = ArgParse(&state, args, "H:J:s:d:p:m:l:S:M:")) != -1)
|
||||
{
|
||||
switch (flag)
|
||||
{
|
||||
|
|
@ -56,6 +57,12 @@ Main(Array *args, HashMap *env)
|
|||
case 'S':
|
||||
lmdb_size = strtol(state.optArg, NULL, 10) * 1024 * 1024;
|
||||
break;
|
||||
case 'M':
|
||||
max_stanza = strtol(state.optArg, NULL, 10);
|
||||
if (max_stanza < 10000)
|
||||
{
|
||||
max_stanza = 10000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,6 +78,7 @@ Main(Array *args, HashMap *env)
|
|||
"-l [Host/IP to listen as] "
|
||||
"-p [XMPP component port=5347] "
|
||||
"-J [parsee.xmppserver.ex]",
|
||||
"-M [max stanza size>=10000]",
|
||||
"-S [LMDB size]",
|
||||
ArrayGet(args, 0)
|
||||
);
|
||||
|
|
@ -109,6 +117,7 @@ Main(Array *args, HashMap *env)
|
|||
|
||||
JsonSet(json, JsonValueString(jabber), 1, "component_host");
|
||||
JsonSet(json, JsonValueInteger(port), 1, "component_port");
|
||||
JsonSet(json, JsonValueInteger(max_stanza), 1, "max_stanza_size");
|
||||
|
||||
JsonSet(json, JsonValueString(jcp), 1, "shared_secret");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue