diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp index 58e1910d6..f85b4f3ed 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 a400981f2..562eeed17 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::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)