Prepare ougoing xml's buffer before adding it to queue to reduce stream mutex contention.

git-svn-id: http://yate.null.ro/svn/yate/trunk@5805 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2014-03-21 09:23:00 +00:00
parent 3c7346a548
commit 50eb96f454
1 changed files with 4 additions and 2 deletions

View File

@ -561,9 +561,11 @@ bool JBStream::sendStanza(XmlElement*& xml)
TelEngine::destruct(xml);
return false;
}
Lock lock(this);
m_pending.append(new XmlElementOut(xml));
XmlElementOut* xo = new XmlElementOut(xml);
xml = 0;
xo->prepareToSend();
Lock lock(this);
m_pending.append(xo);
sendPending();
return true;
}