[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/PrisonerSession.cpp loolwsd/TileCache.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Oct 3 05:31:46 UTC 2016
loolwsd/DocumentBroker.cpp | 3 ---
loolwsd/PrisonerSession.cpp | 18 +++++-------------
loolwsd/TileCache.cpp | 12 ++++++------
3 files changed, 11 insertions(+), 22 deletions(-)
New commits:
commit 2907d802a55ec5f4e83650adba9bbb7e7f134e1a
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Oct 2 15:30:59 2016 -0400
loolwsd: cleanup and logs
Change-Id: I46eafb970ca144e7eb0837c80d790433cf1e151a
Reviewed-on: https://gerrit.libreoffice.org/29466
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index aeafaa3..d6aba21 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -499,9 +499,6 @@ void DocumentBroker::invalidateTiles(const std::string& tiles)
// Remove from cache.
_tileCache->invalidateTiles(tiles);
-
- //TODO: Re-issue the tiles again to avoid races.
-
}
void DocumentBroker::handleTileRequest(TileDesc& tile,
diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index c2ea47f..cff555e 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -56,16 +56,6 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
LOOLWSD::dumpOutgoingTrace(_docBroker->getJailId(), getId(), firstLine);
- if (LOOLProtocol::tokenIndicatesUserInteraction(tokens[0]))
- {
- // Keep track of timestamps of incoming client messages that indicate user activity.
- updateLastActivityTime();
- }
-
- // Note that this handles both forwarding requests from the client to the child process, and
- // forwarding replies from the child process to the client. Or does it?
-
- // Snoop at some messages and manipulate tile cache information as needed
auto peer = _peer.lock();
if (!peer)
{
@@ -139,9 +129,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
return false;
}
- // Save as completed, inform the other (Kind::ToClient)
- // PrisonerSession about it.
-
+ // Save-as completed, inform the ClientSession.
const std::string filePrefix("file:///");
if (url.find(filePrefix) == 0)
{
@@ -253,6 +241,10 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
_docBroker->tileCache().saveRendering(font, "font", buffer + firstLine.size() + 1, length - firstLine.size() - 1);
}
}
+ else
+ {
+ Log::info("Ignoring notification on password protected document: " + firstLine);
+ }
// Detect json messages, since we must send those as text even though they are multiline.
// If not, the UI will read the first line of a binary payload, assuming that's the only
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index ca8a82a..ddceca8 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -331,15 +331,11 @@ void TileCache::invalidateTiles(const std::string& tiles)
{
invalidateTiles(-1, 0, 0, INT_MAX, INT_MAX);
}
- else if (tokens.count() != 6)
- {
- Log::error("Unexpected invalidatetiles request: " + tiles);
- return;
- }
else
{
int part, x, y, width, height;
- if (getTokenInteger(tokens[1], "part", part) &&
+ if (tokens.count() == 6 &&
+ getTokenInteger(tokens[1], "part", part) &&
getTokenInteger(tokens[2], "x", x) &&
getTokenInteger(tokens[3], "y", y) &&
getTokenInteger(tokens[4], "width", width) &&
@@ -347,6 +343,10 @@ void TileCache::invalidateTiles(const std::string& tiles)
{
invalidateTiles(part, x, y, width, height);
}
+ else
+ {
+ Log::error("Unexpected invalidatetiles request: " + tiles);
+ }
}
}
More information about the Libreoffice-commits
mailing list