summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2022-01-14 13:23:32 -0500
committerMichael Meeks <michael.meeks@collabora.com>2022-01-22 17:44:25 +0000
commit632049c3c0dffbe5cc71817bca72f0138183de41 (patch)
treef70b761c5edfd7b406e6f797c6cc833455f9342b
parentwsd: test: improve TileCacheTests::testTileInvalidatedOutside (diff)
downloadonline-632049c3c0dffbe5cc71817bca72f0138183de41.tar.gz
online-632049c3c0dffbe5cc71817bca72f0138183de41.zip
wsd: dump the state of the sessions of DocBroker
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk> (cherry picked from commit bb85464d585b53fa68d5cdff0c303afaaceb54cd) Change-Id: I98b287e1cbbcd463e76885672f1520b93c25751e
-rw-r--r--wsd/DocumentBroker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 4e5c0fe385..6cc46ef44c 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1173,6 +1173,7 @@ void DocumentBroker::handleSaveResponse(const std::string& sessionId, bool succe
// DocBroker will have to decide to upload or skip.
const std::string oldName = _storage->getRootFilePathToUpload();
const std::string newName = _storage->getRootFilePathUploading();
+
if (rename(oldName.c_str(), newName.c_str()) < 0)
{
// It's not an error if there was no file to rename, when the document isn't modified.
@@ -2093,6 +2094,7 @@ size_t DocumentBroker::removeSession(const std::string& id)
<< " active). IsReadOnly: " << session->isReadOnly()
<< ", IsViewLoaded: " << session->isViewLoaded()
<< ", IsWaitDisconnected: " << session->inWaitDisconnected()
+ << ", Unloading: " << _docState.isUnloadRequested()
<< ", MarkToDestroy: " << _docState.isMarkedToDestroy()
<< ", LastEditableSession: " << lastEditableSession
<< ", DontSaveIfUnmodified: " << dontSaveIfUnmodified
@@ -3253,6 +3255,7 @@ void DocumentBroker::dumpState(std::ostream& os)
auto now = std::chrono::steady_clock::now();
+ os << std::boolalpha;
os << " Broker: " << LOOLWSD::anonymizeUrl(_filename) << " pid: " << getPid();
if (_docState.isMarkedToDestroy())
os << " *** Marked to destroy ***";
@@ -3281,6 +3284,7 @@ void DocumentBroker::dumpState(std::ostream& os)
if (_docState.activity() == DocumentState::Activity::Rename)
os << "\n (new name: " << _renameFilename << ')';
os << "\n unload requested: " << _docState.isUnloadRequested();
+ os << "\n marked to destroy: " << _docState.isMarkedToDestroy();
os << "\n last saved: " << Util::getSteadyClockAsString(_storageManager.getLastSaveTime());
os << "\n last save request: "
<< Util::getSteadyClockAsString(_saveManager.lastSaveRequestTime());
@@ -3304,12 +3308,15 @@ void DocumentBroker::dumpState(std::ostream& os)
#if !MOBILEAPP
// Bit nasty - need a cleaner way to dump state.
+ os << "\n Sessions:";
for (auto &it : _sessions)
{
auto proto = it.second->getProtocol();
auto proxy = dynamic_cast<ProxyProtocolHandler *>(proto.get());
if (proxy)
proxy->dumpProxyState(os);
+ else
+ std::static_pointer_cast<MessageHandlerInterface>(it.second)->dumpState(os);
}
#endif
}