[Libreoffice-commits] online.git: loolwsd/MasterProcessSession.cpp loolwsd/TileCache.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Tue Apr 26 10:41:59 UTC 2016
loolwsd/MasterProcessSession.cpp | 6 +++---
loolwsd/TileCache.cpp | 13 ++++++-------
2 files changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 5cfc7b6580d466c2a518e0cfaff475915a32c2fc
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Mon Apr 25 22:44:58 2016 -0400
loolwsd: logging and cosmetics
Change-Id: Idb2cdc22555d237a162b58cacbfd1986f8bc7656
Reviewed-on: https://gerrit.libreoffice.org/24383
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 58e1910..f85b4f3 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -727,19 +727,19 @@ void MasterProcessSession::dispatchChild()
void MasterProcessSession::forwardToPeer(const char *buffer, int length)
{
const auto message = getAbbreviatedMessage(buffer, length);
- Log::trace(getName() + " Forward: " + message);
auto peer = _peer.lock();
if (!peer)
{
- throw Poco::ProtocolException(getName() + ": no peer to forward to.");
+ throw Poco::ProtocolException(getName() + ": no peer to forward to: [" + message + "].");
}
else if (peer->isCloseFrame())
{
- Log::trace(getName() + ": peer begin the closing handshake");
+ Log::trace(getName() + ": peer began the closing handshake. Dropping forward message [" + message + "].");
return;
}
+ Log::trace(getName() + " -> " + peer->getName() + ": " + message);
peer->sendBinaryFrame(buffer, length);
}
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index a400981..562eeed 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -51,7 +51,9 @@ TileCache::TileCache(const std::string& docURL,
_docURL(docURL),
_cacheDir(cacheDir)
{
- Log::info("TileCache ctor for uri [" + _docURL + "] modifiedTime=" + std::to_string(modifiedTime.raw()/1000000) + " getLastModified()=" + std::to_string(getLastModified().raw()/1000000));
+ Log::info() << "TileCache ctor for uri [" << _docURL
+ << "] modifiedTime=" << (modifiedTime.raw()/1000000)
+ << " getLastModified()=" << (getLastModified().raw()/1000000) << Log::end;
File directory(_cacheDir);
if (directory.exists() &&
(getLastModified() < modifiedTime ||
@@ -86,12 +88,9 @@ std::shared_ptr<TileCache::TileBeingRendered> TileCache::findTileBeingRendered(i
{
const std::string cachedName = cacheFileName(part, width, height, tilePosX, tilePosY, tileWidth, tileHeight);
- auto tile = _tilesBeingRendered.find(cachedName);
+ const auto tile = _tilesBeingRendered.find(cachedName);
- if (tile == _tilesBeingRendered.end())
- return nullptr;
-
- return tile->second;
+ return (tile != _tilesBeingRendered.end() ? tile->second : nullptr);
}
void TileCache::forgetTileBeingRendered(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight)
@@ -268,7 +267,7 @@ void TileCache::removeFile(const std::string& fileName)
const std::string fullFileName = _cacheDir + "/" + fileName;
if (std::remove(fullFileName.c_str()) == 0)
- Log::info("Removed file: " + _cacheDir + "/" + fileName);
+ Log::info("Removed file: " + fullFileName);
}
std::string TileCache::cacheFileName(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight)
More information about the Libreoffice-commits
mailing list