[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/SenderQueue.hpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 17 21:47:43 UTC 2018
wsd/ClientSession.cpp | 5 +++++
wsd/ClientSession.hpp | 2 ++
wsd/DocumentBroker.cpp | 1 +
wsd/SenderQueue.hpp | 9 +++++++++
4 files changed, 17 insertions(+)
New commits:
commit f1a385be98aba7191de79606d1cfdfa6973dfc39
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Aug 17 23:36:47 2018 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Aug 17 23:47:10 2018 +0200
Get back "Cancel tiles also in wsd's senderqueue"
This reverts commit ec8b7bc012503559841c96c5a16c13798c103387.
Change-Id: I0a4f3f529c86522261085d4feec45e4b56a7e0e6
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 90e099d38..3f27a435c 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1001,6 +1001,11 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
return forwardToClient(payload);
}
+void ClientSession::cancelTilesInQueue()
+{
+ _senderQueue.cancelTiles();
+}
+
bool ClientSession::forwardToClient(const std::shared_ptr<Message>& payload)
{
if (isCloseFrame())
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 997058f68..4037d81a2 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -99,6 +99,8 @@ public:
}
}
+ void cancelTilesInQueue();
+
/// Set the save-as socket which is used to send convert-to results.
void setSaveAsSocket(const std::shared_ptr<StreamSocket>& socket)
{
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index be5c3aae4..cf5c8eb84 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1448,6 +1448,7 @@ void DocumentBroker::cancelTileRequests(const std::shared_ptr<ClientSession>& se
// Clear tile requests
session->clearTilesOnFly();
session->getRequestedTiles() = boost::none;
+ session->cancelTilesInQueue();
session->clearTileSubscription();
diff --git a/wsd/SenderQueue.hpp b/wsd/SenderQueue.hpp
index fc3464b3f..927e3e735 100644
--- a/wsd/SenderQueue.hpp
+++ b/wsd/SenderQueue.hpp
@@ -84,6 +84,15 @@ public:
}
}
+ void cancelTiles()
+ {
+ std::remove_if(_queue.begin(), _queue.end(),
+ [](const queue_item_t& cur)
+ {
+ return cur->firstToken() == "tile:";
+ });
+ }
+
private:
/// Deduplicate messages based on the new one.
/// Returns true if the new message should be
More information about the Libreoffice-commits
mailing list