[Libreoffice-commits] online.git: common/Common.hpp common/IoUtil.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Thu Dec 1 17:16:17 UTC 2016
common/Common.hpp | 2 +-
common/IoUtil.cpp | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 721003512ee31068c20776e8b67d249c4453747c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Dec 1 18:15:46 2016 +0100
IoUtil: avoid multiplying at int precision, then comparing to long
Here:
if (payload.capacity() > READ_BUFFER_SIZE * 4)
Change-Id: I12e090d03b471b7394a4898d5e1a74992182051e
diff --git a/common/Common.hpp b/common/Common.hpp
index ba14fed..a0a7568 100644
--- a/common/Common.hpp
+++ b/common/Common.hpp
@@ -26,7 +26,7 @@ constexpr int WS_SEND_TIMEOUT_MS = 1000;
/// Pipe and Socket read buffer size.
/// Should be large enough for ethernet packets
/// which can be 1500 bytes long.
-constexpr int READ_BUFFER_SIZE = 64 * 1024;
+constexpr long READ_BUFFER_SIZE = 64 * 1024;
/// Size beyond which messages will be sent preceded with
/// 'nextmessage' frame to let the receiver know in advance
diff --git a/common/IoUtil.cpp b/common/IoUtil.cpp
index 32238f3..b9b91cd 100644
--- a/common/IoUtil.cpp
+++ b/common/IoUtil.cpp
@@ -80,6 +80,7 @@ void SocketProcessor(const std::shared_ptr<LOOLWebSocket>& ws,
{
payload.resize(payload.capacity());
n = -1; // In case receiveFrame throws we log dropped data.
+ (void)n;
n = ws->receiveFrame(payload.data(), payload.size(), flags);
payload.resize(std::max(n, 0));
}
More information about the Libreoffice-commits
mailing list