wsd: do not clobber closeReason
The closeReason member isn't just for logging, it's is also broadcast back to clients. This means that it has to preserve the original reason for initiating the document closing, lest the client misbehaves. Change-Id: Iddee5dba3943d873e8658ce5c1748f4ecd47c486 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
parent
3c953faded
commit
489c942aae
1 changed files with 12 additions and 2 deletions
|
@ -570,8 +570,18 @@ void DocumentBroker::joinThread()
|
|||
|
||||
void DocumentBroker::stop(const std::string& reason)
|
||||
{
|
||||
if (_closeReason.empty())
|
||||
{
|
||||
LOG_DBG("Stopping DocumentBroker for docKey [" << _docKey << "] with reason: " << reason);
|
||||
_closeReason = reason; // used later in the polling loop
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DBG("Stopping DocumentBroker for docKey ["
|
||||
<< _docKey << "] with existing close reason: " << _closeReason
|
||||
<< " (ignoring requested reason: " << reason << ')');
|
||||
}
|
||||
|
||||
_stop = true;
|
||||
_poll->wakeup();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue