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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Dec 12 05:27:31 UTC 2016


 wsd/PrisonerSession.cpp |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit b7205192b45daf35a777764f025484355dc162a2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Dec 11 18:56:55 2016 -0500

    loolwsd: route client messages through SenderQueue
    
    Change-Id: Ied0e32e8874c9754bf32f1a77c74cf8da181924a
    Reviewed-on: https://gerrit.libreoffice.org/31889
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
index 9c31982..3e93bee 100644
--- a/wsd/PrisonerSession.cpp
+++ b/wsd/PrisonerSession.cpp
@@ -23,6 +23,7 @@
 #include "Log.hpp"
 #include "ClientSession.hpp"
 #include "Rectangle.hpp"
+#include "SenderQueue.hpp"
 #include "Storage.hpp"
 #include "TileCache.hpp"
 #include "IoUtil.hpp"
@@ -280,8 +281,14 @@ bool PrisonerSession::forwardToPeer(const std::shared_ptr<ClientSession>& client
     }
 
     LOG_TRC(getName() << " -> " << clientSession->getName() << ": " << message);
-    return binary ? clientSession->sendBinaryFrame(buffer, length)
-                  : clientSession->sendTextFrame(buffer, length);
+
+    auto payload = std::make_shared<MessagePayload>(length, binary ? MessagePayload::Type::Binary
+                                                                   : MessagePayload::Type::Text);
+    auto& output = payload->data();
+    std::memcpy(output.data(), buffer, length);
+    SenderQueue::instance().enqueue(clientSession, payload);
+
+    return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list