From: Art Cancro Date: Mon, 22 Feb 2010 19:02:14 +0000 (+0000) Subject: * more debugging X-Git-Tag: v7.86~390 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d82fe20d6fa89efc51aac93ce60577ab23bb4059 * more debugging --- diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/modules/xmpp/serv_xmpp.c index 0b7da46e9..c239ee56b 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/modules/xmpp/serv_xmpp.c @@ -207,7 +207,7 @@ void xmpp_xml_end(void *data, const char *supplied_el) { } } - if (!strcasecmp(el, "username")) { /* NON SASL ONLY */ + else if (!strcasecmp(el, "username")) { /* NON SASL ONLY */ if (XMPP->chardata_len > 0) { safestrncpy(XMPP->iq_client_username, XMPP->chardata, sizeof XMPP->iq_client_username); @@ -215,7 +215,7 @@ void xmpp_xml_end(void *data, const char *supplied_el) { } } - if (!strcasecmp(el, "password")) { /* NON SASL ONLY */ + else if (!strcasecmp(el, "password")) { /* NON SASL ONLY */ if (XMPP->chardata_len > 0) { safestrncpy(XMPP->iq_client_password, XMPP->chardata, sizeof XMPP->iq_client_password); @@ -253,10 +253,13 @@ void xmpp_xml_end(void *data, const char *supplied_el) { } /* - * Unknown queries ... return the XML equivalent of a blank stare + * Unknown query ... return the XML equivalent of a blank stare */ else { - CtdlLogPrintf(CTDL_DEBUG, "Unknown query; \n"); + CtdlLogPrintf(CTDL_DEBUG, + "Unknown query <%s> - returning \n", + el + ); cprintf("", XMPP->iq_id); cprintf("" "" @@ -374,12 +377,12 @@ void xmpp_xml_end(void *data, const char *supplied_el) { else if (!strcasecmp(el, "starttls")) { #ifdef HAVE_OPENSSL - cprintf(""); - CtdlModuleStartCryptoMsgs(NULL, NULL, NULL); - if (!CC->redirect_ssl) CC->kill_me = 1; + cprintf(""); + CtdlModuleStartCryptoMsgs(NULL, NULL, NULL); + if (!CC->redirect_ssl) CC->kill_me = 1; #else - cprintf(""); - CC->kill_me = 1; + cprintf(""); + CC->kill_me = 1; #endif } @@ -387,6 +390,10 @@ void xmpp_xml_end(void *data, const char *supplied_el) { XMPP->ping_requested = 1; } + else { + CtdlLogPrintf(CTDL_DEBUG, "Ignoring unknown tag <%s>\n", el); + } + XMPP->chardata_len = 0; if (XMPP->chardata_alloc > 0) { XMPP->chardata[0] = 0; diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index 5bfe7ae11..6dad562b3 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -158,17 +158,21 @@ void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_x ); } + /* + * If we didn't hit any known query namespaces then we should deliver a + * "service unavailable" error (see RFC3921 section 2.4 and 11.1.5.4) + */ + else { - CtdlLogPrintf(CTDL_DEBUG, "Unknown namespace; returning \n"); + CtdlLogPrintf(CTDL_DEBUG, + "Unknown query namespace '%s' - returning \n", + query_xmlns + ); cprintf("" "" "" ); } - /* - * End of query result. If we didn't hit any known namespaces then we should - * deliver a "service unavailable" error (see RFC3921 section 2.4 and 11.1.5.4) - */ cprintf(""); }