wsd: preserve close reason when disconnected from Kit
If we already have a closeReason, we should preserve it upon disconnecting from the Kit instance. For example when unloading, we request the disconnection ourselves, so no need to clobber the real reason for closing in that case. Change-Id: Ie71faed5a4051659b426e3ba6bbf30950d21c328 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
parent
ada1dd1a0b
commit
6abd8d114a
1 changed files with 12 additions and 3 deletions
|
@ -3437,9 +3437,18 @@ void DocumentBroker::closeDocument(const std::string& reason)
|
|||
|
||||
void DocumentBroker::disconnectedFromKit()
|
||||
{
|
||||
LOG_INF("DocBroker " << _docKey << " Disconnected from Kit. Flagging to close.");
|
||||
_docState.setDisconnected();
|
||||
closeDocument("docdisconnected");
|
||||
_docState.setDisconnected(); // Always set the disconnected flag.
|
||||
if (_closeReason.empty())
|
||||
{
|
||||
// If we have a reason to close, no advantage in clobbering it.
|
||||
LOG_INF("DocBroker [" << _docKey << "] Disconnected from Kit. Flagging to close");
|
||||
closeDocument("docdisconnected");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INF("DocBroker [" << _docKey << "] Disconnected from Kit while closing with reason ["
|
||||
<< _closeReason << ']');
|
||||
}
|
||||
}
|
||||
|
||||
std::size_t DocumentBroker::broadcastMessage(const std::string& message) const
|
||||
|
|
Loading…
Reference in a new issue