[ADD] Proper stanza limits

This commit is contained in:
LDA 2024-10-25 18:03:05 +02:00
commit 7c60ab28cb
18 changed files with 74 additions and 39 deletions

View file

@ -228,16 +228,20 @@ ExportStanza(StanzaBuilder *builder)
}
void
WriteoutStanza(StanzaBuilder *builder, XMPPComponent *jabber)
WriteoutStanza(StanzaBuilder *builder, XMPPComponent *jabber, size_t max)
{
XMLElement *elem;
if (!builder || !jabber)
{
return;
}
if (!max)
{
max = 10000; /* XMPP recommended limit */
}
elem = ExportStanza(builder);
XMPPSendStanza(jabber, elem);
XMPPSendStanza(jabber, elem, max);
XMLFreeElement(elem);
}