[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp

Jan Holesovsky kendy at collabora.com
Mon Nov 28 10:31:45 UTC 2016


 wsd/LOOLWebSocket.hpp |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 9842f3239ff08583d74c9a835937a6ea781e570c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Nov 28 11:26:41 2016 +0100

    Make sure we don't use the jitter / delay in production builds.
    
    And default to 0 even for debug; who wants to use that for debugging, they
    know what to do.
    
    Change-Id: I23dd0c5f806b2b31a883b7a2b8d822ea8c0bb6c5

diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp
index 3bca89d..373b41a 100644
--- a/wsd/LOOLWebSocket.hpp
+++ b/wsd/LOOLWebSocket.hpp
@@ -31,11 +31,11 @@ class LOOLWebSocket : public Poco::Net::WebSocket
 private:
     std::mutex _mutex;
 
-#ifdef ENABLE_DEBUG
+#if ENABLE_DEBUG
     std::chrono::milliseconds getWebSocketDelay()
     {
-        unsigned long baseDelay = WS_DELAY_MS;
-        unsigned long jitter = WS_JITTER_MS;
+        unsigned long baseDelay = 0;
+        unsigned long jitter = 0;
         if (std::getenv("LOOL_WS_DELAY"))
         {
             baseDelay = std::stoul(std::getenv("LOOL_WS_DELAY"));
@@ -81,7 +81,7 @@ public:
     /// Should we also factor out the handling of non-final and continuation frames into this?
     int receiveFrame(char* buffer, const int length, int& flags)
     {
-#ifdef ENABLE_DEBUG
+#if ENABLE_DEBUG
         // Delay receiving the frame
         std::this_thread::sleep_for(getWebSocketDelay());
 #endif
@@ -111,7 +111,7 @@ public:
     /// Wrapper for Poco::Net::WebSocket::sendFrame() that handles large frames.
     int sendFrame(const char* buffer, const int length, const int flags = FRAME_TEXT)
     {
-#ifdef ENABLE_DEBUG
+#if ENABLE_DEBUG
         // Delay sending the frame
         std::this_thread::sleep_for(getWebSocketDelay());
 #endif


More information about the Libreoffice-commits mailing list