[Libreoffice-commits] online.git: loolwsd/Common.hpp loolwsd/LOOLBroker.cpp loolwsd/LOOLKit.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Jan 21 08:00:11 PST 2016


 loolwsd/Common.hpp     |    8 +++++---
 loolwsd/LOOLBroker.cpp |    4 ++--
 loolwsd/LOOLKit.cpp    |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 6b24eb7bba15800e84cbc2fed44ae69bdf49f90c
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu Jan 21 08:49:43 2016 -0500

    loolwsd: PIPE_BUFFER -> READ_BUFFER_SIZE = 2048
    
    Change-Id: I12e9725549a15b2cb1c287db9de0fca732dafac2
    Reviewed-on: https://gerrit.libreoffice.org/21678
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/Common.hpp b/loolwsd/Common.hpp
index 87585d3..1fae869 100644
--- a/loolwsd/Common.hpp
+++ b/loolwsd/Common.hpp
@@ -19,9 +19,11 @@ constexpr int INTERVAL_PROBES = 10;
 constexpr int MAINTENANCE_INTERVAL = 1;
 constexpr int CHILD_TIMEOUT_SECS = 10;
 constexpr int POLL_TIMEOUT = 1000000;
-// Pipe buffer is in function of URL size, a big URL will be handled in several
-// work loads.
-constexpr int PIPE_BUFFER = 1024;
+
+/// Pipe and Socket read buffer size.
+/// Should be large enough for ethernet packets
+/// which can be 1500 bytes long.
+constexpr int READ_BUFFER_SIZE = 2048;
 
 static const std::string JailedDocumentRoot = "/user/docs/";
 
diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 1084c80..28a0e2f 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -404,7 +404,7 @@ public:
     void run() override
     {
         std::string aMessage;
-        char  aBuffer[PIPE_BUFFER];
+        char  aBuffer[READ_BUFFER_SIZE];
         char* pStart;
         char* pEnd;
 
@@ -488,7 +488,7 @@ public:
 private:
     char* _pStart;
     char* _pEnd;
-    char  _aBuffer[PIPE_BUFFER];
+    char  _aBuffer[READ_BUFFER_SIZE];
 };
 
 /// Initializes LibreOfficeKit for cross-fork re-use.
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index b779180..706b8f2 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -751,7 +751,7 @@ void lokit_main(const std::string &loSubPath, const std::string& jailId, const s
 
     struct pollfd aPoll;
     ssize_t nBytes = -1;
-    char  aBuffer[PIPE_BUFFER];
+    char  aBuffer[READ_BUFFER_SIZE];
     char* pStart = nullptr;
     char* pEnd = nullptr;
 


More information about the Libreoffice-commits mailing list