loolwsd/LOOLKit.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-)
New commits: commit a9fbfe8d8ac802086844e307dff979a8e1436ba2 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sat Sep 17 10:09:47 2016 -0400 loolwsd: remove queue thread from child socket handler Change-Id: Ib6b4890db1f331b2e2cdcfafb57366ff62e3a13d Reviewed-on: https://gerrit.libreoffice.org/29067 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 51c33f3..02919e6 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -57,7 +57,6 @@ #include "LibreOfficeKit.hpp" #include "Log.hpp" #include "Png.hpp" -#include "QueueHandler.hpp" #include "Rectangle.hpp" #include "TileDesc.hpp" #include "Unit.hpp" @@ -320,27 +319,21 @@ public: Log::debug("Thread started."); try { - auto queue = std::make_shared<TileQueue>(); - QueueHandler handler(queue, _session, "kit_queue_" + _session->getId()); - - Thread queueHandlerThread; - queueHandlerThread.start(handler); - std::shared_ptr<ChildSession> session = _session; - IoUtil::SocketProcessor(_ws, - [&queue](const std::vector<char>& payload) + [this](const std::vector<char>& payload) { - queue->put(payload); + if (!_session->handleInput(payload.data(), payload.size())) + { + Log::info("Socket handler flagged for finishing."); + return false; + } + return true; }, - [&session]() { session->closeFrame(); }, - [&queueHandlerThread]() { return TerminationFlag || !queueHandlerThread.isRunning(); }); - - queue->clear(); - queue->put("eof"); - queueHandlerThread.join(); + [this]() { _session->closeFrame(); }, + []() { return !!TerminationFlag; }); - if (session->isCloseFrame()) + if (_session->isCloseFrame()) { Log::trace("Normal close handshake."); _ws->shutdown(); @@ -1503,6 +1496,7 @@ void lokit_main(const std::string& childRoot, requestUrl += "&version=" + encodedVersionStr; free(versionInfo); } + HTTPRequest request(HTTPRequest::HTTP_GET, requestUrl); HTTPResponse response; auto ws = std::make_shared<WebSocket>(cs, request, response); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits