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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Feb 20 04:38:34 UTC 2017


 net/loolnb.cpp |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit f6257d76a3b9efa218f65f837fa0629116ef94a6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Feb 19 20:54:50 2017 -0500

    nb: support websocket payloads larger than 64kb
    
    Change-Id: Ic21e11a70dae74b80ce3b1b604159ec14851972c
    Reviewed-on: https://gerrit.libreoffice.org/34450
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/net/loolnb.cpp b/net/loolnb.cpp
index ad7482b..e088001 100644
--- a/net/loolnb.cpp
+++ b/net/loolnb.cpp
@@ -158,7 +158,11 @@ public:
         {
             if (len < 2 + 8)
                 return;
-            std::cerr << "Implement me 8 byte\n";
+
+            payloadLen = ((((uint64_t)(p[9])) <<  0) + (((uint64_t)(p[8])) <<  8) +
+                          (((uint64_t)(p[7])) << 16) + (((uint64_t)(p[6])) << 24) +
+                          (((uint64_t)(p[5])) << 32) + (((uint64_t)(p[4])) << 40) +
+                          (((uint64_t)(p[3])) << 48) + (((uint64_t)(p[2])) << 56));
             // FIXME: crop read length to remove top / sign bits.
             headerLen += 8;
         }
@@ -225,7 +229,11 @@ public:
         {
             header[1] |= 127;
             T::_outBuffer.push_back((char)header[1]);
-            std::cerr << "FIXME: length\n";
+            char* p = reinterpret_cast<char*>(&len);
+            for (int i = 7; i >= 0; --i)
+            {
+                T::_outBuffer.push_back(p[i]);
+            }
         }
 
         // FIXME: pick random number and mask in the outbuffer etc.


More information about the Libreoffice-commits mailing list