common/LOOLWebSocket.hpp | 9 ++++++--- net/Socket.hpp | 11 +++++++---- net/WebSocketHandler.hpp | 6 ++++-- 3 files changed, 17 insertions(+), 9 deletions(-)
New commits: commit 9c5b161a2bfdd5835e8b066b6945c9ad42b15fc1 Author: Michael Meeks <michael.me...@collabora.com> Date: Wed Apr 19 10:58:18 2017 +0200 Don't set the buffer size to zero. This slows things down terribly, particularly the setting on the websocket made tiles appearing one by one. Let's keep the possibility to zero the buffer sizes for debugging, but hide that behind an env. variable (and in debug builds only anyway). Change-Id: Ie4d2cdb3c0ec3c50f1a2b4f9941a462ac4f2d196 Reviewed-on: https://gerrit.libreoffice.org/36666 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/common/LOOLWebSocket.hpp b/common/LOOLWebSocket.hpp index 784a0915..73660e96 100644 --- a/common/LOOLWebSocket.hpp +++ b/common/LOOLWebSocket.hpp @@ -51,9 +51,12 @@ private: 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()); + if (std::getenv("LOOL_ZERO_BUFFER_SIZE")) + { + // 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()); + } } #endif diff --git a/net/Socket.hpp b/net/Socket.hpp index c0b4b97e..70b229b3 100644 --- a/net/Socket.hpp +++ b/net/Socket.hpp @@ -226,10 +226,13 @@ protected: _owner << "." << std::dec); #if ENABLE_DEBUG - const int oldSize = getSocketBufferSize(); - setSocketBufferSize(0); - LOG_TRC("#" << _fd << ": Buffer size: " << getSendBufferSize() << - " (was " << oldSize << ")"); + if (std::getenv("LOOL_ZERO_BUFFER_SIZE")) + { + const int oldSize = getSocketBufferSize(); + setSocketBufferSize(0); + LOG_TRC("#" << _fd << ": Buffer size: " << getSendBufferSize() << + " (was " << oldSize << ")"); + } #endif } diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp index c6d69883..a863afad 100644 --- a/net/WebSocketHandler.hpp +++ b/net/WebSocketHandler.hpp @@ -417,9 +417,11 @@ protected: LOG_INF("#" << socket->getFD() << ": WebSocket version: " << wsVersion << ", key: [" << wsKey << "], protocol: [" << wsProtocol << "]."); - // Want very low latency sockets. socket->setNoDelay(); - socket->setSocketBufferSize(0); +#if ENABLE_DEBUG + if (std::getenv("LOOL_ZERO_BUFFER_SIZE")) + socket->setSocketBufferSize(0); +#endif std::ostringstream oss; oss << "HTTP/1.1 101 Switching Protocols\r\n" _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits