[Libreoffice-commits] online.git: Branch 'private/mmeeks/brokerbits' - 2 commits - loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp

Michael Meeks michael.meeks at collabora.com
Fri Apr 1 22:19:51 UTC 2016


 loolwsd/LOOLKit.cpp |   24 +++++++++++-------------
 loolwsd/LOOLWSD.cpp |    2 --
 2 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit 3f72badd1720f70887921d185cb25d7148dc44c9
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 1 23:19:15 2016 +0100

    More helpful exception debug.

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index c8e90bb..2a54536 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -447,7 +447,7 @@ public:
         }
         catch (const std::exception& ex)
         {
-            Log::error("Exception while creating session [" + sessionId + "] on url [" + _url + "].");
+            Log::error("Exception while creating session [" + sessionId + "] on url [" + _url + "] - '" + ex.what() + "'.");
             return false;
         }
     }
commit 8807f896e99c30a97079b0054bf2d7fd42e1c7d0
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 1 23:07:32 2016 +0100

    Remove apparently un-necessary thread local variable template.

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index fb9cb23..c8e90bb 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -38,7 +38,6 @@
 #include <Poco/Runnable.h>
 #include <Poco/StringTokenizer.h>
 #include <Poco/Thread.h>
-#include <Poco/ThreadLocal.h>
 #include <Poco/Util/Application.h>
 #include <Poco/URI.h>
 
@@ -68,7 +67,6 @@ using Poco::Process;
 using Poco::Runnable;
 using Poco::StringTokenizer;
 using Poco::Thread;
-using Poco::ThreadLocal;
 using Poco::Util::Application;
 
 const std::string FIFO_BROKER = "loolbroker.fifo";
@@ -78,20 +76,20 @@ static int writerNotify = -1;
 
 namespace
 {
-    ThreadLocal<std::string> sourceForLinkOrCopy;
-    ThreadLocal<Path> destinationForLinkOrCopy;
+    std::string sourceForLinkOrCopy;
+    Path destinationForLinkOrCopy;
 
     int linkOrCopyFunction(const char *fpath,
                            const struct stat* /*sb*/,
                            int typeflag,
                            struct FTW* /*ftwbuf*/)
     {
-        if (strcmp(fpath, sourceForLinkOrCopy->c_str()) == 0)
+        if (strcmp(fpath, sourceForLinkOrCopy.c_str()) == 0)
             return 0;
 
-        assert(fpath[strlen(sourceForLinkOrCopy->c_str())] == '/');
-        const char *relativeOldPath = fpath + strlen(sourceForLinkOrCopy->c_str()) + 1;
-        Path newPath(*destinationForLinkOrCopy, Path(relativeOldPath));
+        assert(fpath[strlen(sourceForLinkOrCopy.c_str())] == '/');
+        const char *relativeOldPath = fpath + strlen(sourceForLinkOrCopy.c_str()) + 1;
+        Path newPath(destinationForLinkOrCopy, Path(relativeOldPath));
 
         switch (typeflag)
         {
@@ -153,10 +151,10 @@ namespace
 
     void linkOrCopy(const std::string& source, const Path& destination)
     {
-        *sourceForLinkOrCopy = source;
-        if (sourceForLinkOrCopy->back() == '/')
-            sourceForLinkOrCopy->pop_back();
-        *destinationForLinkOrCopy = destination;
+        sourceForLinkOrCopy = source;
+        if (sourceForLinkOrCopy.back() == '/')
+            sourceForLinkOrCopy.pop_back();
+        destinationForLinkOrCopy = destination;
         if (nftw(source.c_str(), linkOrCopyFunction, 10, FTW_ACTIONRETVAL) == -1)
             Log::error("linkOrCopy: nftw() failed for '" + source + "'");
     }
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 8246a01..207187f 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -101,7 +101,6 @@ DEALINGS IN THE SOFTWARE.
 #include <Poco/StreamCopier.h>
 #include <Poco/StringTokenizer.h>
 #include <Poco/TemporaryFile.h>
-#include <Poco/ThreadLocal.h>
 #include <Poco/ThreadPool.h>
 #include <Poco/URI.h>
 #include <Poco/Util/HelpFormatter.h>
@@ -157,7 +156,6 @@ using Poco::StreamCopier;
 using Poco::StringTokenizer;
 using Poco::TemporaryFile;
 using Poco::Thread;
-using Poco::ThreadLocal;
 using Poco::ThreadPool;
 using Poco::URI;
 using Poco::Util::Application;


More information about the Libreoffice-commits mailing list