loolwsd/DocumentBroker.cpp |   12 +++++-------
 loolwsd/TileCache.cpp      |    2 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit ae4a9f7110f6d6677b3f3ef5d545f8021222d5da
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Tue Sep 20 22:26:19 2016 -0400

    loolwsd: always request newer tile version
    
    And accept any version newer than expected.
    
    Since we have proper de-duplication of tiles
    requesting newer versions reduces changes of
    races between client and the renderer.
    
    Change-Id: I30bb53f98ef6f1461b53c1cf527d315dc35f7f26
    Reviewed-on: https://gerrit.libreoffice.org/29125
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 55ecbfa..289842c 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -510,14 +510,12 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
         return;
     }
 
-    if (tileCache().subscribeToTileRendering(tile, session) > 0)
-    {
-        Log::debug() << "Sending render request for tile (" << tile.getPart() 
<< ',' << tile.getTilePosX() << ',' << tile.getTilePosY() << ")." << Log::end;
+    tileCache().subscribeToTileRendering(tile, session);
 
-        // Forward to child to render.
-        const std::string request = "tile " + tile.serialize();
-        _childProcess->getWebSocket()->sendFrame(request.data(), 
request.size());
-    }
+    // Forward to child to render.
+    Log::debug() << "Sending render request for tile (" << tile.getPart() << 
',' << tile.getTilePosX() << ',' << tile.getTilePosY() << ")." << Log::end;
+    const std::string request = "tile " + tile.serialize();
+    _childProcess->getWebSocket()->sendFrame(request.data(), request.size());
 }
 
 void DocumentBroker::handleTileCombinedRequest(TileCombined& tileCombined,
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index eb8e8d8..416543e 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -195,7 +195,7 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, 
const char *data, const
         }
 
         // Remove subscriptions.
-        if (tileBeingRendered->getVersion() == tile.getVersion())
+        if (tileBeingRendered->getVersion() <= tile.getVersion())
         {
             Log::debug() << "STATISTICS: tile " << tile.getVersion() << " 
internal roundtrip "
                          << tileBeingRendered->getElapsedTimeMs() << " ms." << 
Log::end;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to