#define HAVE_XML_STOPPARSER
#endif
-struct xmpp_event *xmpp_queue = NULL;
HashList *XMPP_StartHandlers = NULL;
HashList *XMPP_EndHandlers = NULL;
HashList *XMPP_SupportedNamespaces = NULL;
-HashList *XMPP_NameSpaces = 0;
+HashList *XMPP_NameSpaces = NULL;
HashList *FlatToken = NULL;
int XMPPSrvDebugEnable = 0;
/*
* TLS encryption (but only if it isn't already active)
*/
-/*
+
#ifdef HAVE_OPENSSL
if (!CC->redirect_ssl) {
XPUT("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'></starttls>");
}
#endif
-*/
+ //*/
if (!CC->logged_in) {
/* If we're not logged in yet, offer SASL as our feature set */
xmpp_output_auth_mechs();
XMPP->bind_requested = 1;
}
-void xmpp_start_iq(void *data, const char *supplied_el, const char **attr)
-{
-/*
- int i;
- for (i=0; attr[i] != NULL; i+=2) {
- if (!strcasecmp(attr[i], "type")) {
- safestrncpy(XMPP->iq_type, attr[i+1], sizeof XMPP->iq_type);
- }
- else if (!strcasecmp(attr[i], "id")) {
- safestrncpy(XMPP->iq_id, attr[i+1], sizeof XMPP->iq_id);
- }
- else if (!strcasecmp(attr[i], "from")) {
- safestrncpy(XMPP->iq_from, attr[i+1], sizeof XMPP->iq_from);
- }
- else if (!strcasecmp(attr[i], "to")) {
- safestrncpy(XMPP->iq_to, attr[i+1], sizeof XMPP->iq_to);
- }
- }
-*/
-}
-
void xmpp_start_auth(void *data, const char *supplied_el, const char **attr)
{
int i;
}
}
}
-
+/*
void xmpp_start_message(void *data, const char *supplied_el, const char **attr)
{
int i;
}
}
}
-
+*/
void xmpp_start_html(void *data, const char *supplied_el, const char **attr)
{
++XMPP->html_tag_level;
if (GetHash(th->Properties, attr[i], strlen(attr[i]), &pv))
{
PropertyHandler* ph = pv;
- char *val;
+ void *val;
StrBuf **pVal;
long len;
XMPPSrvDebugEnable = n;
}
const char *CitadelServiceXMPP="XMPP";
-extern void xmpp_cleanup_events(void);
Put(ThisNamespace, Token, TLen, th, HDeleteTokenHandler);
}
- Put(th->Properties, Property, PLen, h, HFreePropertyHandler);
+
+ if (PLen > 0)
+ Put(th->Properties, Property, PLen, h, HFreePropertyHandler);
/*
if (!GetHash(FlatToken, Token, TLen, &pv))
{
*/
}
-
+void xmpp_cleanup(void)
+{
+ DeleteHash(&XMPP_StartHandlers);
+ DeleteHash(&XMPP_EndHandlers);
+ DeleteHash(&XMPP_SupportedNamespaces);
+ DeleteHash(&XMPP_NameSpaces);
+ DeleteHash(&FlatToken);
+}
CTDL_MODULE_INIT(xmpp)
{
AddXMPPStartHandler(HKEY("stream"), xmpp_stream_start, 0);
AddXMPPStartHandler(HKEY("query"), xmpp_start_query, 0);
AddXMPPStartHandler(HKEY("bind"), xmpp_start_bind, 0);
- AddXMPPStartHandler(HKEY("iq"), xmpp_start_iq, 0);
AddXMPPStartHandler(HKEY("auth"), xmpp_start_auth, 0);
- AddXMPPStartHandler(HKEY("message"), xmpp_start_message, 0);
+/// AddXMPPStartHandler(HKEY("message"), xmpp_start_message, 0);
AddXMPPStartHandler(HKEY("html"), xmpp_start_html, 0);
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 90);
CtdlRegisterSessionHook(xmpp_login_hook, EVT_UNSTEALTH, PRIO_UNSTEALTH + 1);
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_STEALTH, PRIO_STEALTH + 1);
- CtdlRegisterCleanupHook(xmpp_cleanup_events);
+ CtdlRegisterCleanupHook(xmpp_cleanup);
}
/* return our module name for the log */