summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-11-28 11:26:41 +0100
committerAndras Timar <andras.timar@collabora.com>2016-11-28 16:57:49 +0100
commit3d7da86e85c0dda0c60daab278c804ddbdb1fc05 (patch)
treee2d089afc019291401ea7e9494e70a656765b00f
parentloolwsd: Handle zero jitter (diff)
downloadonline-3d7da86e85c0dda0c60daab278c804ddbdb1fc05.tar.gz
online-3d7da86e85c0dda0c60daab278c804ddbdb1fc05.zip
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 (cherry picked from commit 9842f3239ff08583d74c9a835937a6ea781e570c)
-rw-r--r--loolwsd/LOOLWebSocket.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/loolwsd/LOOLWebSocket.hpp b/loolwsd/LOOLWebSocket.hpp
index e10af2af11..6aa40204fc 100644
--- a/loolwsd/LOOLWebSocket.hpp
+++ b/loolwsd/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