[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Jan Holesovsky kendy at collabora.com
Fri Nov 11 16:53:25 UTC 2016


 loolwsd/LOOLWSD.cpp |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit de9ec63e4f9c0514070016fcaf8aae3772fb7d42
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Nov 11 17:39:13 2016 +0100

    Turns out that setting 'blocking' is the right thing to do.
    
    Unfortunately it turns out that POCO's handling of the non-blocking case is
    wrong when EWOULDBLOCK is returned from ::send().  This leads to a situation
    when part of the data has been sent, but it is impossible to send only the
    rest of it, because of too high-level api for the websockets.
    
    We could essentially re-implement the POCO's websockets and use just the lower
    levels of POCO - but then it's a question whether it is actually easier to use
    the Linux system calls right away :-)
    
    Change-Id: Ied08f68d5037d0ab9ca8266cd20e1084bcebfd14

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 7c7f03d..799a79c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1123,11 +1123,11 @@ public:
                 try
                 {
                     // First, setup WS options.
-                    // FIXME HACK: This needs a bit deeper research; for the
-                    // moment we block with HTTP because non-blocking causes
-                    // problems; maybe we need that for HTTPS too - to be
-                    // tested
-                    ws->setBlocking(!LOOLWSD::isSSLEnabled());
+                    // We need blocking here, because the POCO's
+                    // implementation of handling of non-blocking in
+                    // websockes in broken; essentially it leads to
+                    // sending incomplete frames.
+                    ws->setBlocking(true);
                     ws->setSendTimeout(WS_SEND_TIMEOUT_MS * 1000);
                     std::string decodedUri;
                     URI::decode(reqPathTokens[1], decodedUri);


More information about the Libreoffice-commits mailing list