mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:15:11 +00:00
[MOD] Be stringent about OIDs, use fmemopen
This commit is contained in:
parent
55674c369b
commit
3366fcb759
8 changed files with 76 additions and 122 deletions
|
|
@ -88,14 +88,33 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
|||
from = NULL;
|
||||
decode_from = NULL;
|
||||
from_matrix = NULL;
|
||||
Log(LOG_DEBUG, "<message> usage=%d", MemoryAllocated());
|
||||
|
||||
from = HashMapGet(stanza->attrs, "from");
|
||||
if (ParseeManageBan(args, from, NULL))
|
||||
{
|
||||
XMLFreeElement(stanza);
|
||||
Log(LOG_DEBUG, "<message/> usage=%d (%s:%d)", MemoryAllocated(), __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ServerHasXEP421(args, from))
|
||||
{
|
||||
XMLElement *occupant = XMLookForTKV(
|
||||
stanza, "occupant-id",
|
||||
"xmlns", "urn:xmpp:occupant-id:0"
|
||||
);
|
||||
char *occ_id = occupant ? HashMapGet(occupant->attrs, "id") : NULL;
|
||||
if (occ_id)
|
||||
{
|
||||
Log(LOG_DEBUG,
|
||||
"'%s' has support for XEP-421, fetching OID=%s",
|
||||
from, occ_id
|
||||
);
|
||||
ParseePushOIDTable(from, occ_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (StrEquals(type, "error"))
|
||||
{
|
||||
char *type, *text, *user, *parsee;
|
||||
|
|
@ -132,6 +151,7 @@ end_error:
|
|||
Free(parsee);
|
||||
Free(room);
|
||||
Free(user);
|
||||
Log(LOG_DEBUG, "<message/> usage=%d (%s:%d)", MemoryAllocated(), __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -402,6 +422,7 @@ end:
|
|||
Free(decode_from);
|
||||
Free(room);
|
||||
Free(to);
|
||||
Log(LOG_DEBUG, "<message/> usage=%d (%s:%d)", MemoryAllocated(), __FILE__, __LINE__);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue