wsd/LOOLWSD.cpp |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 4a5c71c13c6c41710ef8bba70f79975c93fd86c2
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Tue Apr 4 00:09:12 2017 -0400

    wsd: move socket to DocBroker in callback
    
    Change-Id: I23af97788d64268a822700ab16d63b970795a105
    Reviewed-on: https://gerrit.libreoffice.org/36059
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 19259e56..9e7bc8f8 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2080,16 +2080,18 @@ private:
             {
                 // Transfer the client socket to the DocumentBroker.
 
-                // Set the ClientSession to handle Socket events.
-                socket->setHandler(clientSession);
-                LOG_DBG("Socket #" << socket->getFD() << " handler is " << 
clientSession->getName());
-
-                // Move the socket into DocBroker.
-                docBroker->addSocketToPoll(socket);
+                // Remove from current poll as we're moving ownership.
                 socketOwnership = 
SocketHandlerInterface::SocketOwnership::MOVED;
 
-                docBroker->addCallback([docBroker, clientSession]()
+                docBroker->addCallback([docBroker, socket, clientSession]()
                 {
+                    // Set the ClientSession to handle Socket events.
+                    socket->setHandler(clientSession);
+                    LOG_DBG("Socket #" << socket->getFD() << " handler is " << 
clientSession->getName());
+
+                    // Move the socket into DocBroker.
+                    docBroker->addSocketToPoll(socket);
+
                     // Add and load the session.
                     docBroker->addSession(clientSession);
                 });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to