summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-07-01 08:02:48 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-07-01 08:02:48 +0300
commit1d5715ed627f0575c64b41765b2b574191c4f512 (patch)
tree9619cfa6bbc7c66fdaee72664bc3aeb059dbc63a /protocols/JabberG
parentc6df3a4627f2f49515672b30427274275adf361d (diff)
protocols: jabber: xep-0198
- additional counters reset before clean enabling to avoid inconsistent counters state
Diffstat (limited to 'protocols/JabberG')
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_strm_mgmt.cpp b/protocols/JabberG/src/jabber_strm_mgmt.cpp
index 10a1172e70..8fcd128f73 100755
--- a/protocols/JabberG/src/jabber_strm_mgmt.cpp
+++ b/protocols/JabberG/src/jabber_strm_mgmt.cpp
@@ -186,6 +186,8 @@ void strm_mgmt::OnProcessFailed(HXML node, ThreadData * info) //used failed inst
void strm_mgmt::CheckStreamFeatures(HXML node)
{
+ if (!IsResumeIdPresent())
+ ResetState(); //this may be necessary to reset counters if session resume id is not set
if (mir_wstrcmp(XmlGetName(node), L"sm") || !XmlGetAttrValue(node, L"xmlns") || mir_wstrcmp(XmlGetAttrValue(node, L"xmlns"), L"urn:xmpp:sm:3")) //we work only with version 3 or higher of sm
return;
if (!(proto->m_bJabberOnline))
@@ -244,7 +246,7 @@ void strm_mgmt::EnableStrmMgmt()
XmlAddAttr(enable_sm, L"xmlns", L"urn:xmpp:sm:3");
XmlAddAttr(enable_sm, L"resume", L"true"); //enable resumption (most useful part of this xep)
proto->m_ThreadInfo->send(enable_sm);
- m_nStrmMgmtLocalSCount = 1; //TODO: this MUST be 0, i have bug somewhere.
+ m_nStrmMgmtLocalSCount = 1; //TODO: this MUST be 0, i have bug somewhere, feel free to fix it.
}
else //resume session
{