[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

@ -16,7 +16,7 @@ extern StanzaBuilder * SetStanzaID(StanzaBuilder *builder, char *id);
extern StanzaBuilder * SetStanzaXParsee(StanzaBuilder *builder, HashMap *e);
extern StanzaBuilder * AddStanzaElem(StanzaBuilder *builder, XMLElement *item);
extern XMLElement * ExportStanza(StanzaBuilder *builder);
extern void WriteoutStanza(StanzaBuilder *builder, XMPPComponent *jabber);
extern void WriteoutStanza(StanzaBuilder *builder, XMPPComponent *jabber, size_t max);
extern void DestroyStanzaBuilder(StanzaBuilder *builder);
#endif

View file

@ -30,11 +30,12 @@ extern XMPPComponent * XMPPInitialiseCompStream(char *host, int port);
extern bool XMPPAuthenticateCompStream(XMPPComponent *comp, char *shared);
/** Writes an XML stanza through a component, while making sure any locking
* work is done.
* work is done. If {max} is non-zero, then this function will not send
* stanzas beyond {max} bytes.
* -----------------------
* Modifies: {comp}, the XMPP stream
* See-Also: XMPPInitialiseCompStream, XMPPAuthenticateCompStream, XMPP-core RFC */
extern void XMPPSendStanza(XMPPComponent *comp, XMLElement *stanza);
extern void XMPPSendStanza(XMPPComponent *comp, XMLElement *stanza, size_t max);
/* Makes a user join/leave a MUC */
extern bool XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, char *hash, int secs, bool ret);