[Libreoffice-commits] online.git: Branch 'private/Ashod/nonblocking' - wsd/LOOLWSD.cpp

Jan Holesovsky kendy at collabora.com
Mon Mar 6 14:29:00 UTC 2017


 wsd/LOOLWSD.cpp |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 02cc51e296378bf11c701d65097140f86f2a5662
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Mar 6 12:38:12 2017 +0100

    nb: Fix polling with http.
    
    When we call readIncomingData() outside of the poll, we read the data, and
    store them into the buffer.  But then the next poll will not indicate that
    there data actually some available (they've been already read from the FD),
    and we will get stuck.
    
    I susppect we should remove from the SSL case at some stage too, to be
    symmetrict to the non-SSL case.
    
    Change-Id: Ib8339400b41e797adb2eb8519f87093ebf6be9c5

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index abed22d..aa5607a 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2312,11 +2312,7 @@ class PlainSocketFactory : public SocketFactory
 {
     std::shared_ptr<Socket> create(const int fd) override
     {
-        auto socket = StreamSocket::create<StreamSocket>(fd, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
-
-        // Read the request.
-        socket->readIncomingData();
-        return socket;
+        return StreamSocket::create<StreamSocket>(fd, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
     }
 };
 
@@ -2328,6 +2324,8 @@ class SslSocketFactory : public SocketFactory
         auto socket = StreamSocket::create<SslStreamSocket>(fd, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
 
         // Do the ssl handshake and read the request.
+        // TODO is this really necessary?  This goes against how the polling &
+        // buffering is done in the generic / non-ssl case...
         socket->readIncomingData();
         return socket;
     }


More information about the Libreoffice-commits mailing list