[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 12 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit 9120fbabad552c22618509cfdc2cf73395e001b7 Author: Ashod NakashianDate: Sun Feb 12 23:47:43 2017 -0500 wsd: use separate read/write locks in LOOLWebSocket When two sockets send data to each other in blocking mode, they can both wait until the other end-point's buffers are free enough to receive the data being sent. Since in LOOLWebSocket we lock both send and receive with the same lock, this prevents the reader thread from freeing the buffer while we try to send data. But since our peer is in the same dilemma, neither of us will make progress--deadlock. Since sockets are full-duplex, they are capable of handling two way communication concurrently. Poco seems to not share data between them either, so this seems safe. Change-Id: I1fd68cd4fb3b4250b93c8f94cd42e49ee78f6650 Reviewed-on: https://gerrit.libreoffice.org/34194 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index b1acd35..1408622 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -31,7 +31,8 @@ class LOOLWebSocket : public Poco::Net::WebSocket { private: -std::mutex _mutex; +std::mutex _mutexRead; +std::mutex _mutexWrite; #if ENABLE_DEBUG static std::chrono::milliseconds getWebSocketDelay() @@ -110,11 +111,12 @@ public: // Timeout is in microseconds. We don't need this, except to yield the cpu. static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000 / 10); static const Poco::Timespan waitZero(0); -std::unique_lock lock(_mutex); while (poll(waitTime, Poco::Net::Socket::SELECT_READ)) { +std::unique_lock lockRead(_mutexRead); const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); +lockRead.unlock(); if (n <= 0) LOG_TRC("Got nothing (" << n << ")"); @@ -130,6 +132,7 @@ public: if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) { // Echo back the ping message. +std::unique_lock lock(_mutexWrite); if (Poco::Net::WebSocket::sendFrame(buffer, n, static_cast(WebSocket::FRAME_FLAG_FIN) | WebSocket::FRAME_OP_PONG) != n) { LOG_WRN("Sending Pong failed."); @@ -158,7 +161,7 @@ public: std::this_thread::sleep_for(getWebSocketDelay()); #endif static const Poco::Timespan waitZero(0); -std::unique_lock lock(_mutex); +std::unique_lock lock(_mutexWrite); if (length >= LARGE_MESSAGE_SIZE) { @@ -204,7 +207,8 @@ public: /// or, otherwise, close the socket without sending close frame, if it is. void shutdown(Poco::UInt16 statusCode, const std::string& statusMessage = "") { -std::unique_lock lock(_mutex); +std::unique_lock lockRead(_mutexRead); +std::unique_lock lockWrite(_mutexWrite); try { // Calling shutdown, in case of error, would try to send a 'close' frame ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp wsd/LOOLWSD.cpp
wsd/LOOLWSD.cpp |1 + wsd/LOOLWebSocket.hpp | 10 ++ 2 files changed, 11 insertions(+) New commits: commit b497fcfac54d10ca67c0906f59a6b69f0940310e Author: Ashod NakashianDate: Fri Jan 20 16:34:10 2017 -0500 wsd: close the socket when shutting down fails Change-Id: Iea5c6a259272b6af881a5bfb27ffc31d2ad27793 Reviewed-on: https://gerrit.libreoffice.org/33424 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index f41cb70..10bc54d 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -194,6 +194,7 @@ namespace inline void shutdownLimitReached(LOOLWebSocket& ws) { const std::string error = Poco::format(PAYLOAD_UNAVAILABLE_LIMIT_REACHED, MAX_DOCUMENTS, MAX_CONNECTIONS); +LOG_INF("Sending client limit-reached message: " << error); /* loleaflet sends loolclient, load and partrectangles message immediately after web socket handshake, so closing web socket fails loading page in diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index dc2c805..b1acd35 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -223,6 +223,16 @@ public: { LOG_WRN("LOOLWebSocket::shutdown: Exception: " << exc.displayText() << (exc.nested() ? " (" + exc.nested()->displayText() + ")" : "")); + +// Just close it. +try +{ +Poco::Net::WebSocket::close(); +} +catch (const std::exception&) +{ +// Nothing we can do. +} } } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 55010980aa05ee10b0b85aa5110f8d824dad0adf Author: Tor LillqvistDate: Wed Jan 18 15:45:33 2017 +0200 Avoid misleading logging If Poco::Bet::WebSocket::receiveFrame() returns 0 or -1, flags is likely meaningless. Change-Id: Ia1d7cbcbfc338f9d0c60e14a6b460ddc090d0b6d diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 850560e..dc2c805 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -115,7 +115,11 @@ public: while (poll(waitTime, Poco::Net::Socket::SELECT_READ)) { const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); -LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags)); + +if (n <= 0) +LOG_TRC("Got nothing (" << n << ")"); +else +LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags)); if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2c978b035936019e82b04f10df9fce63372aa4e1 Author: Miklos VajnaDate: Mon Jan 16 12:48:59 2017 +0100 wsd: these enum values are intentionally from different enum types Which is dangerous in general, but here the values are from non-overlapping ranges. Make it a bit more explicit that this is not an accident. Change-Id: I56897473a755e28cd9e7f74ceacecbab2db5e829 diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 81ced3a..850560e 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -126,7 +126,7 @@ public: if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) { // Echo back the ping message. -if (Poco::Net::WebSocket::sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG) != n) +if (Poco::Net::WebSocket::sendFrame(buffer, n, static_cast(WebSocket::FRAME_FLAG_FIN) | WebSocket::FRAME_OP_PONG) != n) { LOG_WRN("Sending Pong failed."); return -1; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) New commits: commit 8d3c60c9a853312bf8a8809db2bc2bb29f604782 Author: Pranav KantDate: Sun Dec 18 00:21:09 2016 +0530 Bin 'setting minimum socket buffer' in non-debug mode for tests Initial effort was setting it when we are compiling with --enable-debug or when not, unit tests are running, but since we don't run the unit tests in absence of --enable-debug anyways, there is no use for this #else code block. Change-Id: I9d7c66a18be160a47afd2bf336d89d50d4f2463e diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 6c83b1a..73d8a88 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -49,7 +49,6 @@ private: return std::chrono::milliseconds(baseDelay + (jitter > 0 ? (std::rand() % jitter) : 0)); } -#endif void setMinSocketBufferSize() { @@ -57,6 +56,7 @@ private: setSendBufferSize(0); LOG_INF("Send buffer size for web socket set to minimum: " << getSendBufferSize()); } +#endif public: LOOLWebSocket(const Socket& socket) : @@ -70,11 +70,6 @@ public: { #if ENABLE_DEBUG setMinSocketBufferSize(); -#else -if (UnitWSD::isUnitTesting()) -{ -setMinSocketBufferSize(); -} #endif } @@ -85,11 +80,6 @@ public: { #if ENABLE_DEBUG setMinSocketBufferSize(); -#else -if (UnitWSD::isUnitTesting()) -{ -setMinSocketBufferSize(); -} #endif } @@ -101,11 +91,6 @@ public: { #if ENABLE_DEBUG setMinSocketBufferSize(); -#else -if (UnitWSD::isUnitTesting()) -{ -setMinSocketBufferSize(); -} #endif } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 31 +++ 1 file changed, 31 insertions(+) New commits: commit b26969b98ca13adb75271871d1663b72807c69e3 Author: Pranav KantDate: Fri Dec 16 12:52:23 2016 +0530 wsd: set minimum socket buffer size in debug mode Change-Id: Ieae9721d45ade34c5ce9773867ab1ab997a344dc Reviewed-on: https://gerrit.libreoffice.org/32071 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 28d74ae..6c83b1a 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -51,6 +51,13 @@ private: } #endif +void setMinSocketBufferSize() +{ +// Lets set it to zero as system will automatically adjust it to minimum +setSendBufferSize(0); +LOG_INF("Send buffer size for web socket set to minimum: " << getSendBufferSize()); +} + public: LOOLWebSocket(const Socket& socket) : Poco::Net::WebSocket(socket) @@ -61,6 +68,14 @@ public: Poco::Net::HTTPServerResponse& response) : Poco::Net::WebSocket(request, response) { +#if ENABLE_DEBUG +setMinSocketBufferSize(); +#else +if (UnitWSD::isUnitTesting()) +{ +setMinSocketBufferSize(); +} +#endif } LOOLWebSocket(Poco::Net::HTTPClientSession& cs, @@ -68,6 +83,14 @@ public: Poco::Net::HTTPResponse& response) : Poco::Net::WebSocket(cs, request, response) { +#if ENABLE_DEBUG +setMinSocketBufferSize(); +#else +if (UnitWSD::isUnitTesting()) +{ +setMinSocketBufferSize(); +} +#endif } LOOLWebSocket(Poco::Net::HTTPClientSession& cs, @@ -76,6 +99,14 @@ public: Poco::Net::HTTPCredentials& credentials) : Poco::Net::WebSocket(cs, request, response, credentials) { +#if ENABLE_DEBUG +setMinSocketBufferSize(); +#else +if (UnitWSD::isUnitTesting()) +{ +setMinSocketBufferSize(); +} +#endif } /// Wrapper for Poco::Net::WebSocket::receiveFrame() that handles PING frames ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) New commits: commit e24dfb9616194fdaf113b86a0db0d7289f79d57f Author: Michael MeeksDate: Thu Dec 15 13:51:07 2016 + Use a blocking write rather than failing when no space in write buffer. Also avoid a poll syscall for an error state we'll get from the write. diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 972d895..bc51321 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -108,9 +108,7 @@ public: if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) { // Echo back the ping message. -if (poll(waitZero, Socket::SelectMode::SELECT_ERROR) || -!poll(waitZero, Socket::SelectMode::SELECT_WRITE) || -Poco::Net::WebSocket::sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG) != n) +if (Poco::Net::WebSocket::sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG) != n) { LOG_WRN("Sending Pong failed."); return -1; @@ -145,9 +143,7 @@ public: const std::string nextmessage = "nextmessage: size=" + std::to_string(length); const int size = nextmessage.size(); -if (!poll(waitZero, Socket::SelectMode::SELECT_ERROR) && -poll(waitZero, Socket::SelectMode::SELECT_WRITE) && -Poco::Net::WebSocket::sendFrame(nextmessage.data(), size) == size) +if (Poco::Net::WebSocket::sendFrame(nextmessage.data(), size) == size) { LOG_TRC("Sent long message preample: " + nextmessage); } @@ -158,12 +154,7 @@ public: } } -int result = -1; -if (!poll(waitZero, Socket::SelectMode::SELECT_ERROR) && -poll(waitZero, Socket::SelectMode::SELECT_WRITE)) -{ -result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); -} +int result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); lock.unlock(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) New commits: commit 875d11f88bc39dcb3c110482b042abbe4d9652bf Author: Ashod NakashianDate: Tue Dec 13 17:55:10 2016 -0500 loolwsd: simplify checking for closed socket Change-Id: I1f41c40bdd42ad6ab9224a2b13af97f84175492c Reviewed-on: https://gerrit.libreoffice.org/31983 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index 3f86acd..972d895 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -97,11 +97,15 @@ public: while (poll(waitTime, Poco::Net::Socket::SELECT_READ)) { const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); - LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags)); -if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING && -(flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE) +if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE) +{ +// Nothing to do. +return n; +} + +if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) { // Echo back the ping message. if (poll(waitZero, Socket::SelectMode::SELECT_ERROR) || @@ -112,8 +116,7 @@ public: return -1; } } -else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG && - (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE) +else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG) { // In case we do send pings in the future. } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 53 +++--- 1 file changed, 42 insertions(+), 11 deletions(-) New commits: commit aa1d721444c757e84db6c64a1082773483bdf2a1 Author: Ashod NakashianDate: Mon Dec 12 23:08:01 2016 -0500 loolwsd: harden against socket errors and lock while receiving Change-Id: I402d387272e0e30d2fe035842c50f40c3806e20d Reviewed-on: https://gerrit.libreoffice.org/31933 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index d29d429..3f86acd 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -32,7 +32,7 @@ private: std::mutex _mutex; #if ENABLE_DEBUG -std::chrono::milliseconds getWebSocketDelay() +static std::chrono::milliseconds getWebSocketDelay() { unsigned long baseDelay = 0; unsigned long jitter = 0; @@ -89,20 +89,33 @@ public: // Delay receiving the frame std::this_thread::sleep_for(getWebSocketDelay()); #endif -// Timeout given is in microseconds. -static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000); +// Timeout is in microseconds. We don't need this, except to yield the cpu. +static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000 / 10); +static const Poco::Timespan waitZero(0); +std::unique_lock lock(_mutex); while (poll(waitTime, Poco::Net::Socket::SELECT_READ)) { const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); + LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags)); -if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) + +if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING && +(flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE) { -sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG); +// Echo back the ping message. +if (poll(waitZero, Socket::SelectMode::SELECT_ERROR) || +!poll(waitZero, Socket::SelectMode::SELECT_WRITE) || +Poco::Net::WebSocket::sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG) != n) +{ +LOG_WRN("Sending Pong failed."); +return -1; +} } -else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG) +else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG && + (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE) { -// In case we do send pongs in the future. +// In case we do send pings in the future. } else { @@ -110,6 +123,7 @@ public: } } +// Not ready for read. return -1; } @@ -120,23 +134,40 @@ public: // Delay sending the frame std::this_thread::sleep_for(getWebSocketDelay()); #endif +static const Poco::Timespan waitZero(0); std::unique_lock lock(_mutex); if (length >= LARGE_MESSAGE_SIZE) { const std::string nextmessage = "nextmessage: size=" + std::to_string(length); -Poco::Net::WebSocket::sendFrame(nextmessage.data(), nextmessage.size()); -LOG_TRC("Message is long, sent " + nextmessage); +const int size = nextmessage.size(); + +if (!poll(waitZero, Socket::SelectMode::SELECT_ERROR) && +poll(waitZero, Socket::SelectMode::SELECT_WRITE) && +Poco::Net::WebSocket::sendFrame(nextmessage.data(), size) == size) +{ +LOG_TRC("Sent long message preample: " + nextmessage); +} +else +{ +LOG_WRN("Failed to send long message preample."); +return -1; +} } -const int result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); +int result = -1; +if (!poll(waitZero, Socket::SelectMode::SELECT_ERROR) && +poll(waitZero, Socket::SelectMode::SELECT_WRITE)) +{ +result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); +} lock.unlock(); if (result != length) { LOG_ERR("Sent incomplete message, expected " << length << " bytes but sent " << result << -" while sending: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, length, flags)); +" for: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, length, flags)); } else {
[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp
wsd/LOOLWebSocket.hpp | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 9842f3239ff08583d74c9a835937a6ea781e570c Author: Jan HolesovskyDate: 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 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits