[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - net/WebSocketHandler.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Apr 14 18:48:54 UTC 2019


 net/WebSocketHandler.hpp |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit cddfed161207e86c4e0259b933db7d063dc2e36d
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Mar 31 23:30:05 2019 -0400
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sun Apr 14 20:48:35 2019 +0200

    wsd: formatting
    
    Change-Id: I07b91c494fe89395ebe1e91506baef46dc03aca8
    Reviewed-on: https://gerrit.libreoffice.org/70035
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index a037cb6b5..4152f8999 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -187,11 +187,13 @@ public:
 
         if (payloadLen + headerLen > len)
         { // partial read wait for more data.
-            LOG_TRC("#" << socket->getFD() << ": Still incomplete WebSocket message, have " << len << " bytes, message is " << payloadLen + headerLen << " bytes");
+            LOG_TRC("#" << socket->getFD() << ": Still incomplete WebSocket message, have " << len
+                        << " bytes, message is " << payloadLen + headerLen << " bytes");
             return false;
         }
 
-        LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket data of " << len << " bytes: " << Util::stringifyHexLine(socket->getInBuffer(), 0, std::min((size_t)32, len)));
+        LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket data of " << len << " bytes: "
+                    << Util::stringifyHexLine(socket->getInBuffer(), 0, std::min((size_t)32, len)));
 
         data = p + headerLen;
 
@@ -213,14 +215,16 @@ public:
 
         assert(_wsPayload.size() >= payloadLen);
 
-        socket->getInBuffer().erase(socket->getInBuffer().begin(), socket->getInBuffer().begin() + headerLen + payloadLen);
+        socket->getInBuffer().erase(socket->getInBuffer().begin(),
+                                    socket->getInBuffer().begin() + headerLen + payloadLen);
 
 #ifndef MOBILEAPP
 
         // FIXME: fin, aggregating payloads into _wsPayload etc.
-        LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket message code " << static_cast<unsigned>(code) <<
-                ", fin? " << fin << ", mask? " << hasMask << ", payload length: " << _wsPayload.size() <<
-                ", residual socket data: " << socket->getInBuffer().size() << " bytes.");
+        LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket message code "
+                    << static_cast<unsigned>(code) << ", fin? " << fin << ", mask? " << hasMask
+                    << ", payload length: " << _wsPayload.size()
+                    << ", residual socket data: " << socket->getInBuffer().size() << " bytes.");
 
         bool doClose = false;
 
@@ -607,8 +611,9 @@ protected:
                     responseSize = itBody - socket->getInBuffer().begin() + marker.size();
             }
 
-            if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_SWITCHING_PROTOCOLS &&
-                    response.has("Upgrade") && Poco::icompare(response.get("Upgrade"), "websocket") == 0)
+            if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_SWITCHING_PROTOCOLS
+                && response.has("Upgrade")
+                && Poco::icompare(response.get("Upgrade"), "websocket") == 0)
             {
 #if 0 // SAL_DEBUG ...
                 const std::string wsKey = response.get("Sec-WebSocket-Accept", "");


More information about the Libreoffice-commits mailing list