From 681126055acd747349453a57bbed6624420e0c6e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Oct 2013 20:37:58 +0000 Subject: Jabber IQ handlers: ability to handle the same packet by two or more handlers git-svn-id: http://svn.miranda-ng.org/main/trunk@6314 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_iq.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'protocols/JabberG/src/jabber_iq.cpp') diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 6af37f07a3..e5dbecfe31 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -185,8 +185,11 @@ BOOL CJabberIqManager::ExpireIq(int nIqId) { CJabberIqInfo *pInfo = DetachInfo(nIqId); if (pInfo) { - ExpireInfo(pInfo); - delete pInfo; + do { + ExpireInfo(pInfo); + delete pInfo; + } + while ((pInfo = DetachInfo(nIqId)) != NULL); return TRUE; } return FALSE; @@ -263,7 +266,10 @@ BOOL CJabberIqManager::HandleIq(int nIqId, HXML pNode) return FALSE; CJabberIqInfo *pInfo = DetachInfo(nIqId); - if (pInfo) { + if (pInfo == NULL) + return FALSE; + + do { pInfo->m_nIqType = nIqType; if (nIqType == JABBER_IQ_TYPE_RESULT) { if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NODE) @@ -288,9 +294,9 @@ BOOL CJabberIqManager::HandleIq(int nIqId, HXML pNode) (ppro->*(pInfo->m_pHandler))(pNode, pInfo); delete pInfo; - return TRUE; } - return FALSE; + while ((pInfo = DetachInfo(nIqId)) != NULL); + return TRUE; } BOOL CJabberIqManager::HandleIqPermanent(HXML pNode) -- cgit v1.2.3