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

Henry Castro hcastro at collabora.com
Wed Dec 30 17:01:48 PST 2015


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

New commits:
commit cc1861a6a80e4a2862e9a6b9bc88b8bdcef75ce4
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Dec 30 21:01:07 2015 -0400

    loolwsd: define a constant pipe buffer size

diff --git a/loolwsd/Common.hpp b/loolwsd/Common.hpp
index 4ab5e8c..4265957 100644
--- a/loolwsd/Common.hpp
+++ b/loolwsd/Common.hpp
@@ -16,6 +16,9 @@ constexpr int MASTER_PORT_NUMBER = 9981;
 constexpr int INTERVAL_PROBES = 10;
 constexpr int MAINTENANCE_INTERVAL = 1;
 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;
 
 // The client port number, which is changed via loolwsd args.
 static int ClientPortNumber = DEFAULT_CLIENT_PORT_NUMBER;
diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 7cdbf26..1262540 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -397,7 +397,7 @@ public:
     void run() override
     {
         std::string aMessage;
-        char  aBuffer[1024];
+        char  aBuffer[PIPE_BUFFER];
         char* pStart;
         char* pEnd;
 
@@ -475,7 +475,7 @@ public:
 private:
     char* _pStart;
     char* _pEnd;
-    char  _aBuffer[1024];
+    char  _aBuffer[PIPE_BUFFER];
 };
 
 /// Initializes LibreOfficeKit for cross-fork re-use.
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 7a5e5d7..57771f1 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -491,7 +491,7 @@ void run_lok_main(const std::string &loSubPath, const std::string& childId, cons
 {
     struct pollfd aPoll;
     ssize_t nBytes = -1;
-    char  aBuffer[1024];
+    char  aBuffer[PIPE_BUFFER];
     char* pStart = nullptr;
     char* pEnd = nullptr;
 


More information about the Libreoffice-commits mailing list