[Libreoffice-commits] online.git: wsd/TileCache.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Dec 12 00:28:34 UTC 2016


 wsd/TileCache.cpp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 9f5ec66fb5abef07421e64b68e7ba57fe9648756
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu Dec 8 22:48:25 2016 -0500

    loolwsd: prepare to offload tile sending
    
    Change-Id: Ifafa822c05c27fc4b7ef7e0e97ae133de39ce23b
    Reviewed-on: https://gerrit.libreoffice.org/31880
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index a6f0b7f..8608cfa 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -155,8 +155,8 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, const char *data, const
     const auto cachedName = (tileBeingRendered ? tileBeingRendered->getCacheName()
                                                : cacheFileName(tile));
 
-    // Ignore if we can't save the tile, things will work anyway, but slower. An error indication
-    // has been supposed to be sent to all users in that case.
+    // Ignore if we can't save the tile, things will work anyway, but slower.
+    // An error indication is supposed to be sent to all users in that case.
     const auto fileName = _cacheDir + "/" + cachedName;
     if (FileUtil::saveDataToFileSafely(fileName, data, size))
     {
@@ -171,7 +171,8 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, const char *data, const
             std::string response = tile.serialize("tile:");
             Log::debug("Sending tile message to subscribers: " + response);
 
-            std::vector<char> output(256 + size);
+            std::shared_ptr<std::vector<char>> payload = std::make_shared<std::vector<char>>(256 + size);
+            auto& output = *payload;
             output.resize(response.size() + 1 + size);
 
             std::memcpy(output.data(), response.data(), response.size());


More information about the Libreoffice-commits mailing list