test/TileCacheTests.cpp |    4 ++--
 wsd/ClientSession.cpp   |   17 ++++++++---------
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 4512d4090f0754d7525531e13d6efa579283cd76
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Oct 1 18:29:20 2018 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Mon Oct 1 18:29:20 2018 +0200

    Reduce the running time of these this test
    
    Change-Id: Iaf72007309e8e2aca09a01e7d1637f2875f3e564

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index f95a5e0ae..6ade3ab6a 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -1384,7 +1384,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
     CPPUNIT_ASSERT_MESSAGE("We expect two tiles at least!", arrivedTiles > 1);
 
     // For the later inputs wsd will send one tile, since other ones are 
indentical
-    for(int i = 0; i < 10; ++i)
+    for(int i = 0; i < 5; ++i)
     {
         // Type an other character
         sendChar(socket, 'x', skNone, testname);
@@ -1394,7 +1394,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
         gotTile = false;
         do
         {
-            std::vector<char> tile = getResponseMessage(socket, "tile:", 
testname, 1000);
+            std::vector<char> tile = getResponseMessage(socket, "tile:", 
testname, 500);
             gotTile = !tile.empty();
             if(gotTile)
                 ++arrivedTiles;
commit 8a318cc44d0a96bced7c565544c4772cfb936f93
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Oct 1 18:11:25 2018 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Mon Oct 1 18:16:14 2018 +0200

    wsd: Avoid parsing tile messages twice
    
    Change-Id: I049e7ce645999a4d0366ab34ffa75ab0d351947b

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index c32219ba3..d145a9b9c 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -13,6 +13,7 @@
 
 #include <fstream>
 #include <sstream>
+#include <memory>
 
 #include <Poco/Net/HTTPResponse.h>
 #include <Poco/StreamCopier.h>
@@ -1034,15 +1035,16 @@ void ClientSession::enqueueSendMessage(const 
std::shared_ptr<Message>& data)
         docBroker->assertCorrectThread();
 
     const std::string command = data->firstToken();
+    std::unique_ptr<TileDesc> tile;
     if (command == "tile:")
     {
         // Avoid sending tile if it has the same wireID as the previously sent 
tile
-        const TileDesc tile = TileDesc::parse(data->firstLine());
-        const std::string tileID = generateTileID(tile);
+        tile.reset(new TileDesc(TileDesc::parse(data->firstLine())));
+        const std::string tileID = generateTileID(*tile);
         auto iter = _oldWireIds.find(tileID);
-        if(iter != _oldWireIds.end() && tile.getWireId() != 0 && 
tile.getWireId() == iter->second)
+        if(iter != _oldWireIds.end() && tile->getWireId() != 0 && 
tile->getWireId() == iter->second)
         {
-            LOG_INF("WSD filters out a tile with the same wireID: " <<  
tile.serialize("tile:"));
+            LOG_INF("WSD filters out a tile with the same wireID: " <<  
tile->serialize("tile:"));
             return;
         }
     }
@@ -1052,10 +1054,9 @@ void ClientSession::enqueueSendMessage(const 
std::shared_ptr<Message>& data)
     size_t newSize = _senderQueue.enqueue(data);
 
     // Track sent tile
-    if (command == "tile:")
+    if (tile)
     {
-        const TileDesc tile = TileDesc::parse(data->firstLine());
-        traceTileBySend(tile, sizeBefore == newSize);
+        traceTileBySend(*tile, sizeBefore == newSize);
     }
 }
 
commit 835959a617f388541edaf11b210897566b65b754
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Oct 1 18:04:47 2018 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Mon Oct 1 18:16:14 2018 +0200

    Remove accidentally pushed log line
    
    Change-Id: Icd7fcb96725b3cf7fded199a5eae13ec2c109a58

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 61b20714b..c32219ba3 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1056,8 +1056,6 @@ void ClientSession::enqueueSendMessage(const 
std::shared_ptr<Message>& data)
     {
         const TileDesc tile = TileDesc::parse(data->firstLine());
         traceTileBySend(tile, sizeBefore == newSize);
-        if (sizeBefore != newSize)
-            LOG_INF("Sending new tile to client: " <<  
tile.serialize("tile:"));
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to