[Libreoffice-commits] online.git: loolwsd/protocol.txt loolwsd/TileCache.cpp loolwsd/TileDesc.hpp

Tor Lillqvist tml at collabora.com
Tue Oct 4 10:36:45 UTC 2016


 loolwsd/TileCache.cpp |    7 +++++++
 loolwsd/TileDesc.hpp  |    1 +
 loolwsd/protocol.txt  |   10 ++++++----
 3 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 97adaf935b319cca6f1b5139fef281dc5245e0f9
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 4 13:20:41 2016 +0300

    Don't let 'canceltiles' messages affect slide thumbnails being rendered
    
    Document that the 'id' parameter of a 'tile' message is not (should
    not be) used for anything except slide thumbnails.
    
    If we later need some more generic way to distinguish the purpose of
    tile requests, need to come up with something else, like a 'purpose'
    parameter.

diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index ddceca8..9b7293f 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -478,6 +478,13 @@ std::string TileCache::cancelTiles(const std::shared_ptr<ClientSession> &subscri
 
     for (auto it = _tilesBeingRendered.begin(); it != _tilesBeingRendered.end(); )
     {
+        if (it->second->getTile().getId() >= 0)
+        {
+            // Tile is for a thumbnail, don't cancel it
+            ++it;
+            continue;
+        }
+
         auto& subscribers = it->second->_subscribers;
         Log::trace("Tile " + it->first + " has " + std::to_string(subscribers.size()) + " subscribers.");
 
diff --git a/loolwsd/TileDesc.hpp b/loolwsd/TileDesc.hpp
index 7a42135..9356c2d 100644
--- a/loolwsd/TileDesc.hpp
+++ b/loolwsd/TileDesc.hpp
@@ -61,6 +61,7 @@ public:
     void setVersion(const int ver) { _ver = ver; }
     int getImgSize() const { return _imgSize; }
     void setImgSize(const int imgSize) { _imgSize = imgSize; }
+    int getId() const { return _id; }
 
     bool intersectsWithRect(int x, int y, int w, int h) const
     {
diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index 65ad0a0..418986d 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -27,8 +27,9 @@ client -> server
 canceltiles
 
     All outstanding tile messages from the client to the server are
-    dropped and will not be handled. There is no guarantee of exactly
-    which tile: messages might still be sent back to the client.
+    dropped and will not be handled, except tile messages with an id
+    parameter. There is no guarantee of exactly which tile: messages
+    might still be sent back to the client.
 
 downloadas name=<fileName> id=<id> format=<document format> options=<SkipImages, etc>
 
@@ -127,8 +128,9 @@ tileheight=<tileHeight> [timestamp=<time>] [id=<id>]
     All parameters are numbers.
 
     Note: id must be echoed back in the response verbatim. It is used
-    by Impress to render the slide thumbnails. It is only useful to
-    loleaflet and will break it if not returned in the response.
+    when rendering slide thumbnails of presentation documents, and not
+    for anything else. It is only useful to loleaflet and will break
+    it if not returned in the response.
 
 tilecombine <parameters>
 


More information about the Libreoffice-commits mailing list