[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-4' - 8 commits - common/Rectangle.hpp debian/changelog loleaflet/src loolwsd.spec.in wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/TestStubs.cpp wsd/TileCache.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 29 14:15:14 UTC 2018
common/Rectangle.hpp | 10 +++++
debian/changelog | 6 +++
loleaflet/src/layer/tile/GridLayer.js | 49 +++++++++++++-----------
loolwsd.spec.in | 2 -
wsd/ClientSession.cpp | 67 ++++++++++++++++++++++++++--------
wsd/ClientSession.hpp | 24 +++++++++---
wsd/DocumentBroker.cpp | 7 +++
wsd/TestStubs.cpp | 2 -
wsd/TileCache.cpp | 2 -
9 files changed, 120 insertions(+), 49 deletions(-)
New commits:
commit dad7321da957f3d5099dba56f1d707b0c7f7311b
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Tue Aug 28 10:58:05 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:14:24 2018 +0200
Bump package version to 3.4.0-2
Change-Id: Ifbe9fb476ebc131f8f7f819939c206527ee1e5e3
(cherry picked from commit 65d15707baf7d9af51459805dd08c2aa340023c5)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/debian/changelog b/debian/changelog
index 38969b61c..2953d0976 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+loolwsd (3.4.0-2) unstable; urgency=medium
+
+ * see the git log: http://col.la/cool3
+
+ -- Andras Timar <andras.timar at collabora.com> Thu, 28 Aug 2018 10:50:00 +0200
+
loolwsd (3.4.0-1) unstable; urgency=medium
* see the git log: http://col.la/cool3
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index deafcde4d..0ab7cf170 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -12,7 +12,7 @@ Name: loolwsd%{name_suffix}
Name: loolwsd
%endif
Version: @PACKAGE_VERSION@
-Release: 1%{?dist}
+Release: 2%{?dist}
%if 0%{?suse_version} == 1110
Group: Productivity/Office/Suite
BuildRoot: %{_tmppath}/%{name}-%{version}-build
commit 21108d433ec7f6d9278b7c2320268b9e50dd9138
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Aug 26 06:11:08 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:14:10 2018 +0200
loleaflet: Request invalid tiles too by view change
Change-Id: I43c65ce025d3b18bd664d2ad16107cf828bab300
(cherry picked from commit 9473908d45a884827356b504c5f768e2f29cc46b)
Reviewed-on: https://gerrit.libreoffice.org/59650
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit d331ddee38ff27cfad95ab821786c55fde85e29a)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index a337e3835..3bd563639 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -532,7 +532,8 @@ L.GridLayer = L.Layer.extend({
key = this._tileCoordsToKey(coords);
var tile = this._tiles[key];
- if (tile) {
+ var invalid = tile && tile._invalidCount && tile._invalidCount > 0;
+ if (tile && tile.loaded && !invalid) {
tile.current = true;
newView = false;
} else {
@@ -866,34 +867,36 @@ L.GridLayer = L.Layer.extend({
key = this._tileCoordsToKey(coords);
if (coords.part === this._selectedPart) {
- var tile = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords));
+ if (!this._tiles[key]) {
+ var tile = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords));
- this._initTile(tile);
+ this._initTile(tile);
- // if createTile is defined with a second argument ("done" callback),
- // we know that tile is async and will be ready later; otherwise
- if (this.createTile.length < 2) {
- // mark tile as ready, but delay one frame for opacity animation to happen
- setTimeout(L.bind(this._tileReady, this, coords, null, tile), 0);
- }
+ // if createTile is defined with a second argument ("done" callback),
+ // we know that tile is async and will be ready later; otherwise
+ if (this.createTile.length < 2) {
+ // mark tile as ready, but delay one frame for opacity animation to happen
+ setTimeout(L.bind(this._tileReady, this, coords, null, tile), 0);
+ }
- // we prefer top/left over translate3d so that we don't create a HW-accelerated layer from each tile
- // which is slow, and it also fixes gaps between tiles in Safari
- L.DomUtil.setPosition(tile, tilePos, true);
+ // we prefer top/left over translate3d so that we don't create a HW-accelerated layer from each tile
+ // which is slow, and it also fixes gaps between tiles in Safari
+ L.DomUtil.setPosition(tile, tilePos, true);
- // save tile in cache
- this._tiles[key] = {
- el: tile,
- coords: coords,
- current: true
- };
+ // save tile in cache
+ this._tiles[key] = {
+ el: tile,
+ coords: coords,
+ current: true
+ };
- fragment.appendChild(tile);
+ fragment.appendChild(tile);
- this.fire('tileloadstart', {
- tile: tile,
- coords: coords
- });
+ this.fire('tileloadstart', {
+ tile: tile,
+ coords: coords
+ });
+ }
}
if (this._tileCache[key]) {
commit 6bcb833a9fc336d7c50383a42c1f904d954b9a83
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Aug 24 14:01:44 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:14:04 2018 +0200
First forward invalidation to client and request tiles after
(cherry picked from commit 1b01af36059623627fd8895353f028efc20ef26f)
Change-Id: I48a9e5783312801468651e55f4c05d3c08ff9189
Reviewed-on: https://gerrit.libreoffice.org/59649
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit c819651600a337627543a6855202468a8b6eae6e)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index ef3380199..00fd8373d 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -947,7 +947,12 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
else if (tokens[0] == "invalidatetiles:")
{
assert(firstLine.size() == static_cast<std::string::size_type>(length));
+
+ // First forward invalidation
+ bool ret = forwardToClient(payload);
+
handleTileInvalidation(firstLine, docBroker);
+ return ret;
}
else if (tokens[0] == "invalidatecursor:")
{
commit df085d322d202687b9a6b1d9368d3c365dc543e7
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Aug 23 12:46:49 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:13:57 2018 +0200
Drop too old tileID's from tiles-on-fly list
So we can avoid that tile sending stop working because server is
waiting for tileprocessed messages which will not arrive.
Change-Id: I545346c50d49340999608aadac32b5190ede43c5
(cherry picked from commit 759d1fe72294b22669f19dabf28a4fcf4922af8c)
Fix previous commit
Change-Id: I7d3bce0132d124e52f7885c8cb3c26acc6f7b41d
(cherry picked from commit 3bd7c6b5084bb2505cf0f2629450974e68b8c050)
Go back using list for tilesOnFly
It can handle duplicates which we need to have.
Change-Id: Ia4cd813dd173bc538dd27953c4886d460b5b1c49
(cherry picked from commit 185b933353c670ef4639ada323ed2f803f209e70)
Reviewed-on: https://gerrit.libreoffice.org/59648
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit dce9d960fe8e059e8d60f0a93b88dba54f53a7ee)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 9ed10cf30..ef3380199 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -51,7 +51,6 @@ ClientSession::ClientSession(const std::string& id,
_tileWidthTwips(0),
_tileHeightTwips(0),
_isTextDocument(false),
- _tilesOnFly(0),
_tilesBeingRendered(0)
{
const size_t curConnections = ++LOOLWSD::NumConnections;
@@ -342,7 +341,13 @@ bool ClientSession::_handleInput(const char *buffer, int length)
sendTextFrame("error: cmd=tileprocessed kind=syntax");
return false;
}
- auto iter = std::find(_tilesOnFly.begin(), _tilesOnFly.end(), tileID);
+
+ auto iter = std::find_if(_tilesOnFly.begin(), _tilesOnFly.end(),
+ [&tileID](const std::pair<std::string, std::chrono::steady_clock::time_point>& curTile)
+ {
+ return curTile.first == tileID;
+ });
+
if(iter != _tilesOnFly.end())
_tilesOnFly.erase(iter);
else
@@ -1040,7 +1045,7 @@ Authorization ClientSession::getAuthorization() const
void ClientSession::addTileOnFly(const TileDesc& tile)
{
- _tilesOnFly.push_back(generateTileID(tile));
+ _tilesOnFly.push_back({generateTileID(tile), std::chrono::steady_clock::now()});
}
void ClientSession::clearTilesOnFly()
@@ -1048,6 +1053,24 @@ void ClientSession::clearTilesOnFly()
_tilesOnFly.clear();
}
+void ClientSession::removeOutdatedTilesOnFly()
+{
+ // Check only the beginning of the list, tiles are ordered by timestamp
+ bool continueLoop = true;
+ while(!_tilesOnFly.empty() && continueLoop)
+ {
+ auto tileIter = _tilesOnFly.begin();
+ double elapsedTimeMs = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - tileIter->second).count();
+ if(elapsedTimeMs > 3000)
+ {
+ LOG_WRN("Tracker tileID was dropped because of time out. Tileprocessed message did not arrive");
+ _tilesOnFly.erase(tileIter);
+ }
+ else
+ continueLoop = false;
+ }
+}
+
void ClientSession::onDisconnect()
{
LOG_INF(getName() << " Disconnected, current number of connections: " << LOOLWSD::NumConnections);
@@ -1242,7 +1265,10 @@ void ClientSession::removeOutdatedTileSubscriptions()
{
double elapsedTime = docBroker->tileCache().getTileBeingRenderedElapsedTimeMs(*iterator);
if(elapsedTime < 0.0 && elapsedTime > 5000.0)
+ {
+ LOG_WRN("Tracked TileBeingRendered was dropped because of time out.");
_tilesBeingRendered.erase(iterator);
+ }
else
++iterator;
}
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 13f0b141c..397f7b670 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -19,6 +19,8 @@
#include <Rectangle.hpp>
#include <deque>
#include <map>
+#include <list>
+#include <utility>
#include <unordered_set>
class DocumentBroker;
@@ -125,6 +127,7 @@ public:
void addTileOnFly(const TileDesc& tile);
void clearTilesOnFly();
size_t getTilesOnFlyCount() const { return _tilesOnFly.size(); }
+ void removeOutdatedTilesOnFly();
Util::Rectangle getVisibleArea() const { return _clientVisibleArea; }
int getTileWidthInTwips() const { return _tileWidthTwips; }
@@ -230,7 +233,7 @@ private:
bool _isTextDocument;
/// TileID's of the sent tiles. Push by sending and pop by tileprocessed message from the client.
- std::list<std::string> _tilesOnFly;
+ std::list<std::pair<std::string, std::chrono::steady_clock::time_point>> _tilesOnFly;
/// Names of tiles requested from kit, which this session is subsrcibed to
/// Track only non-thumbnail tiles (getId() == -1)
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 913510064..9f9e63304 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1401,6 +1401,8 @@ void DocumentBroker::sendRequestedTiles(const std::shared_ptr<ClientSession>& se
// Update client's tilesBeingRendered list
session->removeOutdatedTileSubscriptions();
+ // Drop tiles which we are waiting for too long
+ session->removeOutdatedTilesOnFly();
// All tiles were processed on client side what we sent last time, so we can send a new banch of tiles
// which was invalidated / requested in the meantime
commit bc728a0fcc065d37d04396e67c4427a66d79f67c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 22 23:20:27 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:13:52 2018 +0200
Updated deduplicated tiles wireID
Change-Id: Ia901d8831792de1bee6b21017be02fa1e744e2ee
(cherry picked from commit 3ca4421eb73d17d8dc84fb46284d1746db078988)
Reviewed-on: https://gerrit.libreoffice.org/59647
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 05d8d8667fa0c70d670048702172b7a860c9ee01)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 35732eb94..9ed10cf30 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1195,7 +1195,7 @@ void ClientSession::resetWireIdMap()
_oldWireIds.clear();
}
-void ClientSession::traceTileBySend(const TileDesc& tile)
+void ClientSession::traceTileBySend(const TileDesc& tile, bool deduplicated)
{
const std::string tileID = generateTileID(tile);
@@ -1217,7 +1217,8 @@ void ClientSession::traceTileBySend(const TileDesc& tile)
}
// Record that the tile is sent
- addTileOnFly(tile);
+ if (!deduplicated)
+ addTileOnFly(tile);
}
void ClientSession::traceSubscribeToTile(const std::string& cacheName)
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 04241d91b..13f0b141c 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -86,15 +86,13 @@ public:
LOG_TRC(getName() << " enqueueing client message " << data->id());
size_t sizeBefore = _senderQueue.size();
size_t newSize = _senderQueue.enqueue(data);
- if(sizeBefore != newSize)
+
+ // Track sent tile
+ const std::string command = data->firstToken();
+ if (command == "tile:")
{
- // Track sent tile
- const std::string command = data->firstToken();
- if (command == "tile:")
- {
- const TileDesc tile = TileDesc::parse(data->firstLine());
- traceTileBySend(tile);
- }
+ const TileDesc tile = TileDesc::parse(data->firstLine());
+ traceTileBySend(tile, sizeBefore == newSize);
}
}
@@ -134,7 +132,7 @@ public:
/// This method updates internal data related to sent tiles (wireID and tiles-on-fly)
/// Call this method anytime when a new tile is sent to the client
- void traceTileBySend(const TileDesc& tile);
+ void traceTileBySend(const TileDesc& tile, bool deduplicated = false);
/// Trask tiles what we a subscription to
void traceSubscribeToTile(const std::string& tileCacheName);
diff --git a/wsd/TestStubs.cpp b/wsd/TestStubs.cpp
index d5407c11b..9a56e0a67 100644
--- a/wsd/TestStubs.cpp
+++ b/wsd/TestStubs.cpp
@@ -20,7 +20,7 @@
void DocumentBroker::assertCorrectThread() const {}
-void ClientSession::traceTileBySend(const TileDesc& /*tile*/) {}
+void ClientSession::traceTileBySend(const TileDesc& /*tile*/, bool /*deduplicated = false*/) {}
void ClientSession::traceSubscribeToTile(const std::string& /*tileCacheName*/) {};
commit 6124994b346c21469ece24a3a3f83294e38f0b6f
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 22 16:19:04 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:13:45 2018 +0200
Reset also the wireId map by canceltiles
(cherry picked from commit 54596dbcf9db8d3aa415734988e15390e4133830)
Change-Id: Ic9589363612d06a8d5d940ba5e5cbff796577c15
Reviewed-on: https://gerrit.libreoffice.org/59646
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 12a7d0df0dbcf29307f2ed92ef217c4024be5b66)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index ff5975f1e..04241d91b 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -143,6 +143,9 @@ public:
void clearTileSubscription();
size_t getTilesBeingRenderedCount() const {return _tilesBeingRendered.size();}
+
+ /// Clear wireId map anytime when client visible area changes (visible area, zoom, part number)
+ void resetWireIdMap();
private:
/// SocketHandler: disconnection event.
@@ -184,9 +187,6 @@ private:
void handleTileInvalidation(const std::string& message,
const std::shared_ptr<DocumentBroker>& docBroker);
- /// Clear wireId map anytime when client visible area changes (visible area, zoom, part number)
- void resetWireIdMap();
-
/// Generate a unique id for a tile
std::string generateTileID(const TileDesc& tile);
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 874d1c587..913510064 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1473,6 +1473,10 @@ void DocumentBroker::cancelTileRequests(const std::shared_ptr<ClientSession>& se
session->getRequestedTiles().clear();
+ session->clearTileSubscription();
+
+ session->resetWireIdMap();
+
const auto canceltiles = tileCache().cancelTiles(session);
if (!canceltiles.empty())
{
commit ab785d86ae9772eb992359ccafb419e5ad2bbd9c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Aug 21 17:15:02 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:13:41 2018 +0200
Handle tiles hanging out the visible area
A problem comes up when only a part of the tile is visible
on the client side and invalidation affects the invisible
part of this tile. To get back the old / right behavior we
need to request this kind of tiles too.
(cherry picked from commit 25e1a01a3c3df8bf412db7819536ed0a36196320)
Handle negativ position value of clientvisiblearea
Change-Id: I1bf1217e038d034167e1a5412d81a311ebbd83ed
(cherry picked from commit d0fb39cd76cf9097f8f5398a1f7202d4df6390f4)
Reviewed-on: https://gerrit.libreoffice.org/59645
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit e7649f5b4535c60ced12da9ba1b9982b58cc3bdc)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/common/Rectangle.hpp b/common/Rectangle.hpp
index 1300aa71a..6089f863d 100644
--- a/common/Rectangle.hpp
+++ b/common/Rectangle.hpp
@@ -78,6 +78,16 @@ struct Rectangle
{
return _x1 < _x2 && _y1 < _y2;
}
+
+ bool intersects(const Rectangle& rOther)
+ {
+ Util::Rectangle intersection;
+ intersection._x1 = std::max(_x1, rOther._x1);
+ intersection._y1 = std::max(_y1, rOther._y1);
+ intersection._x2 = std::min(_x2, rOther._x2);
+ intersection._y2 = std::min(_y2, rOther._y2);
+ return intersection.isValid();
+ }
};
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index f5573c06c..35732eb94 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1141,6 +1141,13 @@ void ClientSession::handleTileInvalidation(const std::string& message,
return;
}
+ // Visible area can have negativ value as position, but we have tiles only in the positiv range
+ Util::Rectangle normalizedVisArea;
+ normalizedVisArea._x1 = std::max(_clientVisibleArea._x1, 0);
+ normalizedVisArea._y1 = std::max(_clientVisibleArea._y1, 0);
+ normalizedVisArea._x2 = _clientVisibleArea._x2;
+ normalizedVisArea._y2 = _clientVisibleArea._y2;
+
std::pair<int, Util::Rectangle> result = TileCache::parseInvalidateMsg(message);
int part = result.first;
Util::Rectangle& invalidateRect = result.second;
@@ -1151,18 +1158,16 @@ void ClientSession::handleTileInvalidation(const std::string& message,
std::vector<TileDesc> invalidTiles;
if(part == _clientSelectedPart || _isTextDocument)
{
- Util::Rectangle intersection;
- intersection._x1 = std::max(invalidateRect._x1, _clientVisibleArea._x1);
- intersection._y1 = std::max(invalidateRect._y1, _clientVisibleArea._y1);
- intersection._x2 = std::min(invalidateRect._x2, _clientVisibleArea._x2);
- intersection._y2 = std::min(invalidateRect._y2, _clientVisibleArea._y2);
- if(intersection.isValid()) // Client visible area and invalidated rectangle has intersection
+ // Iterate through visible tiles
+ for(int i = std::ceil(normalizedVisArea._y1 / _tileHeightTwips);
+ i <= std::ceil(normalizedVisArea._y2 / _tileHeightTwips); ++i)
{
- for(int i = std::ceil(intersection._y1 / _tileHeightTwips);
- i <= std::ceil(intersection._y2 / _tileHeightTwips); ++i)
+ for(int j = std::ceil(normalizedVisArea._x1 / _tileWidthTwips);
+ j <= std::ceil(normalizedVisArea._x2 / _tileWidthTwips); ++j)
{
- for(int j = std::ceil(intersection._x1 / _tileWidthTwips);
- j <= std::ceil(intersection._x2 / _tileWidthTwips); ++j)
+ // Find tiles affected by invalidation
+ Util::Rectangle tileRect (j * _tileWidthTwips, i * _tileHeightTwips, _tileWidthTwips, _tileHeightTwips);
+ if(invalidateRect.intersects(tileRect))
{
invalidTiles.emplace_back(TileDesc(part, _tileWidthPixel, _tileHeightPixel, j * _tileWidthTwips, i * _tileHeightTwips, _tileWidthTwips, _tileHeightTwips, -1, 0, -1, false));
commit 25780da4e1b51a3ef0e2b76b712028135b85c3bb
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Jul 23 16:11:47 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Aug 29 16:13:34 2018 +0200
Trace sent tiles when they are actually sent
SenderQueue might drop some tiles, so we were waiting for
tileprocessed message for a tile which was not sent at all.
Change-Id: I7c502966f656e46df7c22002dee19aeabbf97774
(cherry picked from commit b014804ce2229030a8816eb3c35a08f9af9e4676)
Reviewed-on: https://gerrit.libreoffice.org/59644
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 4de17fe29436bbf2cc70db4be91d06f5dc451e43)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 4c86e87a1..ff5975f1e 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -84,7 +84,18 @@ public:
docBroker->assertCorrectThread();
LOG_TRC(getName() << " enqueueing client message " << data->id());
- _senderQueue.enqueue(data);
+ size_t sizeBefore = _senderQueue.size();
+ size_t newSize = _senderQueue.enqueue(data);
+ if(sizeBefore != newSize)
+ {
+ // Track sent tile
+ const std::string command = data->firstToken();
+ if (command == "tile:")
+ {
+ const TileDesc tile = TileDesc::parse(data->firstLine());
+ traceTileBySend(tile);
+ }
+ }
}
/// Set the save-as socket which is used to send convert-to results.
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index eb0c1f522..874d1c587 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1438,7 +1438,6 @@ void DocumentBroker::sendRequestedTiles(const std::shared_ptr<ClientSession>& se
cachedTile->read(output.data() + pos, size);
cachedTile->close();
- session->traceTileBySend(tile);
session->sendBinaryFrame(output.data(), output.size());
}
else
diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index 2702ba2b0..8e0da8cfe 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -221,7 +221,6 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, const char *data, const
auto firstSession = firstSubscriber.lock();
if (firstSession)
{
- firstSession->traceTileBySend(tile);
firstSession->enqueueSendMessage(payload);
}
@@ -243,7 +242,6 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, const char *data, const
auto session = subscriber.lock();
if (session)
{
- session->traceTileBySend(tile);
session->enqueueSendMessage(payload);
}
}
More information about the Libreoffice-commits
mailing list