[Libreoffice-commits] online.git: 4 commits - rename.patch rename.sh wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/Storage.cpp

Tor Lillqvist tml at collabora.com
Wed Dec 21 09:46:44 UTC 2016


 rename.patch           |  713 -------------------------------------------------
 rename.sh              |   62 ----
 wsd/DocumentBroker.cpp |   42 ++
 wsd/DocumentBroker.hpp |    3 
 wsd/Storage.cpp        |   48 +--
 5 files changed, 62 insertions(+), 806 deletions(-)

New commits:
commit fe7aaafd3ea4b52a3cf11bdd2aef265a704535f7
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Dec 20 18:01:03 2016 +0200

    WIP: Check if the document has been modified behind our back
    
    For now, do the check only when a new session connects to the
    document, because at that point we fetch the document information (in
    separate function for WOPI and local files) and construct the
    FileInfo, including timestamp.
    
    For now, just log an ERR message if we notice that the document in its
    storage system (WOPI or local file system) has an unexpected last
    modified time. What should we do? If we don't have unsaved changes,
    most likely we should just silently reload the document and force all
    sessions to refresh. But if we have unsaved changes, and the document
    has changed underneath, we have a problem.
    
    We need to fetch the timestamp also also after saving ("persisting")
    as we can't assume that the clock on the machine running loolwsd and
    that of the storage (as reported in the WOPI case in CheckFileInfo)
    are in synch. (Assuming separate machines, they certainly won't ever
    exactly in synch, but aren't necessarily even just a few seconds apart
    (think incorrectly set up timezone etc), so no amount of tolerance in
    the comparison would be good enough, because after all, it might be
    that in the problematic cases we are looking for the timestamps also
    are separated by a quite short time.)
    
    Yes, this means there is a race condition; what if the document is
    modified behind out back right after we have persisted it, before we
    ask for its timestamp? It would be much better if the persisting
    operation atomically also told what the timestamp of the document in
    the storage is after persisting, but alas, WOPI doesn't do that.
    
    Rename the DocumentBroker::origDocumentLastModifiedTime field to
    _documentLastModifiedTime as that is less misleading. It is not the
    "original" document timestamp but the timestamp of the document in its
    storage system.
    
    This needs much more work: Ideally the timestamp of the document in
    its storage system should be retrieved and checked against the
    expected value also before we are about to save it.
    
    But unfortunately experience has shown that the WOPI CheckFileInfo
    operation can be expensive, so we'll see what can be done. Ideally
    WOPI should contain the optional functionality to return an error if,
    when saving a document, its timestamp (and size?) in storage are not
    what the saving client expects.
    
    Also add a few FIXME comments.
    
    Change-Id: I5a9b55d4b55a8db0c9ee8638edd368dc0aa325d5

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 819c602..515a48e 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -309,7 +309,7 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::st
     session->setUserId(userid);
     session->setUserName(username);
 
-    // Get basic file information from the storage
+    // Basic file information was stored by the above getWOPIFileInfo() or getLocalFileInfo() callns
     const auto fileInfo = _storage->getFileInfo();
     if (!fileInfo.isValid())
     {
@@ -318,7 +318,22 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::st
     }
 
     if (firstInstance)
-        _origDocumentLastModifiedTime = fileInfo._modifiedTime;
+    {
+        _documentLastModifiedTime = fileInfo._modifiedTime;
+        LOG_DBG("Document timestamp: " << Poco::DateTimeFormatter::format(Poco::DateTime(_documentLastModifiedTime),
+                                                                          Poco::DateTimeFormat::ISO8601_FORMAT));
+    }
+    else
+    {
+        // Check if document has been modified by some external action
+        LOG_DBG("Timestamp now: " << Poco::DateTimeFormatter::format(Poco::DateTime(fileInfo._modifiedTime),
+                                                                     Poco::DateTimeFormat::ISO8601_FORMAT));
+        if (_documentLastModifiedTime != fileInfo._modifiedTime)
+        {
+            LOG_ERR("Document has been modified behind our back, URI [" << uriPublic.toString() << "].");
+            // What do do?
+        }
+    }
 
     // Lets load the document now
     const bool loaded = _storage->isLoaded();
@@ -384,6 +399,9 @@ bool DocumentBroker::save(const std::string& sessionId, bool success, const std:
 
     LOG_DBG("Saving to URI [" << uri << "].");
 
+    // FIXME: We should check before persisting the document that it hasn't been updated in its
+    // storage behind our backs.
+
     assert(_storage && _tileCache);
     StorageBase::SaveResult storageSaveResult = _storage->saveLocalFileToStorage(uriPublic);
     if (storageSaveResult == StorageBase::SaveResult::OK)
@@ -393,8 +411,28 @@ bool DocumentBroker::save(const std::string& sessionId, bool success, const std:
         _lastFileModifiedTime = newFileModifiedTime;
         _tileCache->saveLastModified(_lastFileModifiedTime);
         _lastSaveTime = std::chrono::steady_clock::now();
+
+        // Calling getWOPIFileInfo() or getLocalFileInfo() has the side-effect of updating
+        // StorageBase::_fileInfo. Get the timestamp of the document as persisted in its storage
+        // from there.
+        // FIXME: Yes, of course we should turn this stuff into a virtual function and avoid this
+        // dynamic_cast dance.
+        if (dynamic_cast<WopiStorage*>(_storage.get()) != nullptr)
+        {
+            auto wopiFileInfo = static_cast<WopiStorage*>(_storage.get())->getWOPIFileInfo(uriPublic);
+        }
+        else if (dynamic_cast<LocalStorage*>(_storage.get()) != nullptr)
+        {
+            auto localFileInfo = static_cast<LocalStorage*>(_storage.get())->getLocalFileInfo(uriPublic);
+        }
+        // So set _documentLastModifiedTime then
+        _documentLastModifiedTime = _storage->getFileInfo()._modifiedTime;
+
         LOG_DBG("Saved to URI [" << uri << "] and updated tile cache.");
+        LOG_DBG("Timestamp now: " << Poco::DateTimeFormatter::format(Poco::DateTime(_documentLastModifiedTime),
+                                                                     Poco::DateTimeFormat::ISO8601_FORMAT));
         _saveCV.notify_all();
+
         return true;
     }
     else if (storageSaveResult == StorageBase::SaveResult::DISKFULL)
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 34e90d9..fd3eeff 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -324,7 +324,7 @@ private:
     std::string _jailId;
     std::string _filename;
     std::chrono::steady_clock::time_point _lastSaveTime;
-    Poco::Timestamp _origDocumentLastModifiedTime;
+    Poco::Timestamp _documentLastModifiedTime;
     Poco::Timestamp _lastFileModifiedTime;
     std::map<std::string, std::shared_ptr<ClientSession> > _sessions;
     std::unique_ptr<StorageBase> _storage;
commit 2f2607dfe9d248e4251d005a51aface653339f27
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Dec 20 17:53:11 2016 +0200

    No reason to keep original _fileInfo forever
    
    The information in StorageBase::_fileInfo is not expensive to
    construct. What might be expensive we were doing anyway for each time
    a session connects to the document. So just update _fileInfo whenever
    we fetch currrent information about the document in its storage, which
    is useful, as the timestamp and size after all will change whenever
    the document is persisted.
    
    Change-Id: I173394c88b4d6448ad5bf1ab9b41694cffdf1ff4

diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index d0e1fca..7734ee5 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -194,15 +194,12 @@ std::unique_ptr<LocalStorage::LocalFileInfo> LocalStorage::getLocalFileInfo(cons
     const auto path = Poco::Path(uriPublic.getPath());
     Log::debug("Getting info for local uri [" + uriPublic.toString() + "], path [" + path.toString() + "].");
 
-    if (!_fileInfo.isValid())
-    {
-        const auto& filename = path.getFileName();
-        const auto file = Poco::File(path);
-        const auto lastModified = file.getLastModified();
-        const auto size = file.getSize();
+    const auto& filename = path.getFileName();
+    const auto file = Poco::File(path);
+    const auto lastModified = file.getLastModified();
+    const auto size = file.getSize();
 
-        _fileInfo = FileInfo({filename, "localhost", lastModified, size});
-    }
+    _fileInfo = FileInfo({filename, "localhost", lastModified, size});
 
     // Set automatic userid and username
     return std::unique_ptr<LocalStorage::LocalFileInfo>(new LocalFileInfo({"localhost", std::string("Local Host #") + std::to_string(LastLocalStorageId++)}));
@@ -429,29 +426,26 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Po
     else
         Log::error("WOPI::CheckFileInfo is missing JSON payload");
 
-    if (!_fileInfo.isValid())
+    Poco::Timestamp modifiedTime = Poco::Timestamp::fromEpochTime(0);
+    if (lastModifiedTime != "")
     {
-        Poco::Timestamp modifiedTime = Poco::Timestamp::fromEpochTime(0);
-        if (lastModifiedTime != "")
+        Poco::DateTime dateTime;
+        int timeZoneDifferential;
+        bool valid = false;
+        try
         {
-            Poco::DateTime dateTime;
-            int timeZoneDifferential;
-            bool valid = false;
-            try
-            {
-                Poco::DateTimeParser::parse(Poco::DateTimeFormat::ISO8601_FRAC_FORMAT, lastModifiedTime, dateTime, timeZoneDifferential);
-                valid = true;
-            }
-            catch (const Poco::SyntaxException& exc)
-            {
-                LOG_WRN("LastModifiedTime property [" + lastModifiedTime + "] was invalid format: " << exc.displayText() <<
-                        (exc.nested() ? " (" + exc.nested()->displayText() + ")" : ""));
-            }
-            if (valid)
-                modifiedTime = dateTime.timestamp();
+            Poco::DateTimeParser::parse(Poco::DateTimeFormat::ISO8601_FRAC_FORMAT, lastModifiedTime, dateTime, timeZoneDifferential);
+            valid = true;
+        }
+        catch (const Poco::SyntaxException& exc)
+        {
+            LOG_WRN("LastModifiedTime property [" + lastModifiedTime + "] was invalid format: " << exc.displayText() <<
+                    (exc.nested() ? " (" + exc.nested()->displayText() + ")" : ""));
         }
-        _fileInfo = FileInfo({filename, ownerId, modifiedTime, size});
+        if (valid)
+            modifiedTime = dateTime.timestamp();
     }
+    _fileInfo = FileInfo({filename, ownerId, modifiedTime, size});
 
     return std::unique_ptr<WopiStorage::WOPIFileInfo>(new WOPIFileInfo({userId, userName, canWrite, postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption, enableOwnerTermination, disablePrint, disableExport, disableCopy, callDuration}));
 }
commit 460ef8d7aae99c14823323575f5cea429488fd14
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Dec 20 14:51:26 2016 +0200

    The rename was done some time ago already
    
    Change-Id: I885bcd30426d7ddc7c9c899dcdef4a9e198fb515

diff --git a/rename.patch b/rename.patch
deleted file mode 100644
index c971850..0000000
--- a/rename.patch
+++ /dev/null
@@ -1,713 +0,0 @@
-Apply me after running rename.sh
-
-diff --git a/Makefile.am b/Makefile.am
-index a87599d..ec72323 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -24,102 +24,108 @@ endif
- 
- ACLOCAL_AMFLAGS = -I m4
- 
--AM_CPPFLAGS = -pthread -DLOOLWSD_DATADIR='"@LOOLWSD_DATADIR@"' -DLOOLWSD_CONFIGDIR='"@LOOLWSD_CONFIGDIR@"'
-+# quick and easy for now.
-+include_paths = -I${top_srcdir}/common -I${top_srcdir}/wsd -I${top_srcdir}/kit
-+
-+AM_CPPFLAGS = -pthread -DLOOLWSD_DATADIR='"@LOOLWSD_DATADIR@"' -DLOOLWSD_CONFIGDIR='"@LOOLWSD_CONFIGDIR@"' ${include_paths}
- AM_LDFLAGS = -pthread -Wl,-E
- 
- AM_ETAGSFLAGS = --c++-kinds=+p --fields=+iaS --extra=+q -R --totals=yes *
- AM_CTAGSFLAGS = $(AM_ETAGSFLAGS)
- 
--shared_sources = ChildSession.cpp \
--                 common/FileUtil.cpp \
-+shared_sources = common/FileUtil.cpp \
-+                 common/IoUtil.cpp \
-+                 common/Log.cpp \
-+                 common/Protocol.cpp \
-+                 common/Session.cpp \
-+                 common/MessageQueue.cpp \
-                  common/SigUtil.cpp \
--                 IoUtil.cpp \
--                 Log.cpp \
--                 LOOLProtocol.cpp \
--                 LOOLSession.cpp \
--                 MessageQueue.cpp \
--                 Unit.cpp \
--                 UnitHTTP.cpp \
--                 Util.cpp
--
--loolwsd_SOURCES = Admin.cpp \
--                  AdminModel.cpp \
--                  Auth.cpp \
--                  DocumentBroker.cpp \
--                  LOOLWSD.cpp \
--                  ClientSession.cpp \
--                  FileServer.cpp \
--                  PrisonerSession.cpp \
--                  Storage.cpp \
--                  TileCache.cpp \
-+                 common/Unit.cpp \
-+                 common/UnitHTTP.cpp \
-+                 common/Util.cpp
-+
-+loolwsd_SOURCES = wsd/Admin.cpp \
-+                  wsd/AdminModel.cpp \
-+                  wsd/Auth.cpp \
-+                  wsd/DocumentBroker.cpp \
-+                  wsd/LOOLWSD.cpp \
-+                  wsd/ClientSession.cpp \
-+                  wsd/FileServer.cpp \
-+                  wsd/PrisonerSession.cpp \
-+                  wsd/Storage.cpp \
-+                  wsd/TileCache.cpp \
-                   $(shared_sources)
- 
- noinst_PROGRAMS = connect \
-                   lokitclient \
-                   loolforkit-nocaps
- 
--connect_SOURCES = Connect.cpp \
--                  Log.cpp \
--                  LOOLProtocol.cpp \
--                  Util.cpp
-+connect_SOURCES = tools/Connect.cpp \
-+                  common/Log.cpp \
-+                  common/Protocol.cpp \
-+                  common/Util.cpp
- 
--lokitclient_SOURCES = IoUtil.cpp \
--                      Log.cpp \
--                      LOKitClient.cpp \
--                      LOOLProtocol.cpp \
--                      Util.cpp
-+lokitclient_SOURCES = common/IoUtil.cpp \
-+                      common/Log.cpp \
-+                      tools/KitClient.cpp \
-+                      common/Protocol.cpp \
-+                      common/Util.cpp
- 
--loolforkit_SOURCES = LOOLForKit.cpp \
--                     LOOLKit.cpp \
-+loolforkit_SOURCES = kit/ChildSession.cpp \
-+                     kit/ForKit.cpp \
-+                     kit/Kit.cpp \
-                      $(shared_sources)
- 
- # build a binary with no caps to help debugging
- loolforkit_nocaps_SOURCES = $(loolforkit_SOURCES)
- 
--loolmount_SOURCES = loolmount.c
--
--loolmap_SOURCES = loolmap.c
--
--looltool_SOURCES = LOOLTool.cpp
--
--loolstress_CPPFLAGS = -DTDOC=\"$(abs_top_srcdir)/test/data\"
--loolstress_SOURCES = LOOLStress.cpp \
--                     LOOLProtocol.cpp \
--                     Log.cpp
--
--noinst_HEADERS = Admin.hpp \
--                 AdminModel.hpp \
--                 Auth.hpp \
--                 ChildSession.hpp \
--                 Common.hpp \
--                 DocumentBroker.hpp \
--                 Exceptions.hpp \
--                 FileServer.hpp \
--                 common/FileUtil.hpp \
--                 common/SigUtil.hpp \
--                 IoUtil.hpp \
--                 LibreOfficeKit.hpp \
--                 Log.hpp \
--                 LOKitHelper.hpp \
--                 LOOLKit.hpp \
--                 LOOLProtocol.hpp \
--                 LOOLSession.hpp \
--                 LOOLWebSocket.hpp \
--                 LOOLWSD.hpp \
--                 ClientSession.hpp \
--                 PrisonerSession.hpp \
--                 MessageQueue.hpp \
--                 Png.hpp \
--                 QueueHandler.hpp \
--                 Rectangle.hpp \
--                 Storage.hpp \
--                 TileCache.hpp \
--                 TileDesc.hpp \
--                 TraceFile.hpp \
--                 Unit.hpp \
--                 UnitHTTP.hpp \
--                 UserMessages.hpp \
--                 Util.hpp \
-+loolmount_SOURCES = tools/mount.c
-+
-+loolmap_SOURCES = tools/map.c
-+
-+looltool_SOURCES = tools/Tool.cpp
-+
-+loolstress_CPPFLAGS = -DTDOC=\"$(abs_top_srcdir)/test/data\" ${include_paths}
-+loolstress_SOURCES = tools/Stress.cpp \
-+                     common/Protocol.cpp \
-+                     common/Log.cpp
-+
-+wsd_headers = wsd/Admin.hpp \
-+              wsd/AdminModel.hpp \
-+              wsd/Auth.hpp \
-+              wsd/ClientSession.hpp \
-+              wsd/DocumentBroker.hpp \
-+              wsd/Exceptions.hpp \
-+              wsd/FileServer.hpp \
-+              wsd/LOOLWebSocket.hpp \
-+              wsd/LOOLWSD.hpp \
-+              wsd/PrisonerSession.hpp \
-+              wsd/QueueHandler.hpp \
-+              wsd/Storage.hpp \
-+              wsd/TileCache.hpp \
-+              wsd/TileDesc.hpp \
-+              wsd/TraceFile.hpp \
-+              wsd/UserMessages.hpp
-+
-+shared_headers = common/Common.hpp \
-+                 common/IoUtil.hpp \
-+                 common/Log.hpp \
-+                 common/Protocol.hpp \
-+                 common/Session.hpp \
-+                 common/Unit.hpp \
-+                 common/UnitHTTP.hpp \
-+                 common/Util.hpp \
-+                 common/MessageQueue.hpp \
-+                 common/Png.hpp \
-+                 common/Rectangle.hpp \
-+                 common/security.h
-+
-+kit_headers = kit/ChildSession.hpp \
-+              kit/Kit.hpp \
-+              kit/LibreOfficeKit.hpp \
-+	      kit/KitHelper.hpp
-+
-+noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \
-                  bundled/include/LibreOfficeKit/LibreOfficeKit.h \
-                  bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h \
-                  bundled/include/LibreOfficeKit/LibreOfficeKitInit.h \
-diff --git a/common/IoUtil.cpp b/common/IoUtil.cpp
-index 4368af1..646dacb 100644
---- a/common/IoUtil.cpp
-+++ b/common/IoUtil.cpp
-@@ -27,7 +27,7 @@
- #include <Poco/URI.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "Util.hpp"
-diff --git a/common/MessageQueue.cpp b/common/MessageQueue.cpp
-index 9a34187..b3a7313 100644
---- a/common/MessageQueue.cpp
-+++ b/common/MessageQueue.cpp
-@@ -13,7 +13,7 @@
- 
- #include <Poco/StringTokenizer.h>
- 
--#include <LOOLProtocol.hpp>
-+#include <Protocol.hpp>
- #include <Log.hpp>
- #include <TileDesc.hpp>
- 
-diff --git a/common/Protocol.cpp b/common/Protocol.cpp
-index 30f75c6..6cd5455 100644
---- a/common/Protocol.cpp
-+++ b/common/Protocol.cpp
-@@ -7,7 +7,7 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  */
- 
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "config.h"
- 
- #include <cassert>
-diff --git a/common/Session.cpp b/common/Session.cpp
-index c503af7..36bf79c 100644
---- a/common/Session.cpp
-+++ b/common/Session.cpp
-@@ -7,7 +7,7 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  */
- 
--#include "LOOLSession.hpp"
-+#include "Session.hpp"
- #include "config.h"
- 
- #include <sys/stat.h>
-@@ -34,7 +34,7 @@
- 
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "TileCache.hpp"
-diff --git a/common/Session.hpp b/common/Session.hpp
-index 736e63d..9873aad 100644
---- a/common/Session.hpp
-+++ b/common/Session.hpp
-@@ -22,7 +22,7 @@
- #include <Poco/StringTokenizer.h>
- #include <Poco/Types.h>
- 
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "MessageQueue.hpp"
-diff --git a/configure.ac b/configure.ac
-index 9b6fc3d..7aa8775 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -32,7 +32,7 @@ AC_SUBST([LOOLWSD_VERSION_HASH])
- 
- AC_DEFINE_UNQUOTED([LOOLWSD_VERSION_HASH],[["$LOOLWSD_VERSION_HASH"]],[LibreOffice On-Line git hash if present])
- 
--AC_CONFIG_SRCDIR([LOOLWSD.cpp])
-+AC_CONFIG_SRCDIR([wsd/LOOLWSD.cpp])
- 
- AC_CONFIG_HEADERS([config.h])
- 
-diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
-index c28cfbf..a0505fe 100644
---- a/kit/ChildSession.cpp
-+++ b/kit/ChildSession.cpp
-@@ -19,7 +19,7 @@
- #include <Poco/URI.h>
- 
- #include "common/FileUtil.hpp"
--#include "LOKitHelper.hpp"
-+#include "KitHelper.hpp"
- #include "Log.hpp"
- #include "Png.hpp"
- #include "Util.hpp"
-diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
-index 624090c..a392c63 100644
---- a/kit/ChildSession.hpp
-+++ b/kit/ChildSession.hpp
-@@ -16,8 +16,8 @@
- #include <Poco/Thread.h>
- 
- #include "Common.hpp"
--#include "LOOLKit.hpp"
--#include "LOOLSession.hpp"
-+#include "Kit.hpp"
-+#include "Session.hpp"
- #include "LibreOfficeKit.hpp"
- 
- class ChildSession;
-diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
-index 6763225..bccd343 100644
---- a/kit/ForKit.cpp
-+++ b/kit/ForKit.cpp
-@@ -33,7 +33,7 @@
- 
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOOLKit.hpp"
-+#include "Kit.hpp"
- #include "Log.hpp"
- #include "Unit.hpp"
- #include "Util.hpp"
-diff --git a/kit/Kit.cpp b/kit/Kit.cpp
-index 48902cb..a8e4e73 100644
---- a/kit/Kit.cpp
-+++ b/kit/Kit.cpp
-@@ -51,9 +51,9 @@
- #include "ChildSession.hpp"
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOKitHelper.hpp"
--#include "LOOLKit.hpp"
--#include "LOOLProtocol.hpp"
-+#include "KitHelper.hpp"
-+#include "Kit.hpp"
-+#include "Protocol.hpp"
- #include "LOOLWebSocket.hpp"
- #include "LibreOfficeKit.hpp"
- #include "Log.hpp"
-diff --git a/test/Makefile.am b/test/Makefile.am
-index 7600797..c79d87e 100644
---- a/test/Makefile.am
-+++ b/test/Makefile.am
-@@ -9,7 +9,8 @@ check_PROGRAMS = test
- 
- noinst_PROGRAMS = test unittest
- 
--AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\"
-+AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\" \
-+	-I${top_srcdir}/common -I${top_srcdir}/wsd -I${top_srcdir}/kit
- 
- noinst_LTLIBRARIES = \
-         unit-timeout.la unit-prefork.la \
-@@ -29,15 +30,15 @@ AM_CPPFLAGS = -pthread -I$(top_srcdir) -DBUILDING_TESTS
- wsd_sources = \
-             ../common/FileUtil.cpp \
-             ../common/SigUtil.cpp \
--            ../IoUtil.cpp \
--            ../Log.cpp \
--            ../LOOLKit.cpp \
--            ../LOOLProtocol.cpp \
--            ../LOOLSession.cpp \
--            ../TileCache.cpp \
--            ../MessageQueue.cpp \
--            ../Unit.cpp \
--            ../Util.cpp
-+            ../common/IoUtil.cpp \
-+            ../common/Log.cpp \
-+            ../common/Protocol.cpp \
-+            ../common/Session.cpp \
-+	    ../common/MessageQueue.cpp \
-+            ../kit/Kit.cpp \
-+            ../wsd/TileCache.cpp \
-+            ../common/Unit.cpp \
-+            ../common/Util.cpp
- 
- test_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
- test_SOURCES = TileCacheTests.cpp integration-http-server.cpp \
-diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
-index 5343092..072898a 100644
---- a/test/TileCacheTests.cpp
-+++ b/test/TileCacheTests.cpp
-@@ -12,7 +12,7 @@
- #include <cppunit/extensions/HelperMacros.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "MessageQueue.hpp"
- #include "Png.hpp"
-diff --git a/test/TileQueueTests.cpp b/test/TileQueueTests.cpp
-index 964df48..dea692b 100644
---- a/test/TileQueueTests.cpp
-+++ b/test/TileQueueTests.cpp
-@@ -12,7 +12,7 @@
- #include <cppunit/extensions/HelperMacros.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "MessageQueue.hpp"
- #include "Util.hpp"
- 
-diff --git a/test/UnitFonts.cpp b/test/UnitFonts.cpp
-index 60312d4..265d5b2 100644
---- a/test/UnitFonts.cpp
-+++ b/test/UnitFonts.cpp
-@@ -20,7 +20,7 @@
- #include <Poco/Timestamp.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "Log.hpp"
- #include "Unit.hpp"
- #include "Util.hpp"
-diff --git a/test/UnitFuzz.cpp b/test/UnitFuzz.cpp
-index 7454aa4..fba1d73 100644
---- a/test/UnitFuzz.cpp
-+++ b/test/UnitFuzz.cpp
-@@ -16,7 +16,7 @@
- 
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Unit.hpp"
- #include "Util.hpp"
-diff --git a/test/UnitPrefork.cpp b/test/UnitPrefork.cpp
-index 9f5463b..93d4adb 100644
---- a/test/UnitPrefork.cpp
-+++ b/test/UnitPrefork.cpp
-@@ -24,7 +24,7 @@
- 
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "Unit.hpp"
-diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
-index fd3814a..69faa72 100644
---- a/test/WhiteBoxTests.cpp
-+++ b/test/WhiteBoxTests.cpp
-@@ -13,8 +13,8 @@
- 
- #include <ChildSession.hpp>
- #include <Common.hpp>
--#include <LOOLKit.hpp>
--#include <LOOLProtocol.hpp>
-+#include <Kit.hpp>
-+#include <Protocol.hpp>
- #include <MessageQueue.hpp>
- #include <Util.hpp>
- 
-diff --git a/test/helpers.hpp b/test/helpers.hpp
-index 737601c..9d2c8b8 100644
---- a/test/helpers.hpp
-+++ b/test/helpers.hpp
-@@ -41,7 +41,7 @@
- 
- #include <Common.hpp>
- #include "common/FileUtil.hpp"
--#include <LOOLProtocol.hpp>
-+#include <Protocol.hpp>
- #include <LOOLWebSocket.hpp>
- #include <UserMessages.hpp>
- #include <Util.hpp>
-diff --git a/test/httpcrashtest.cpp b/test/httpcrashtest.cpp
-index 1bfd4f2..a4a4ff3 100644
---- a/test/httpcrashtest.cpp
-+++ b/test/httpcrashtest.cpp
-@@ -40,7 +40,7 @@
- #include <Common.hpp>
- #include <UserMessages.hpp>
- #include <Util.hpp>
--#include <LOOLProtocol.hpp>
-+#include <Protocol.hpp>
- #include <LOOLWebSocket.hpp>
- #include "helpers.hpp"
- #include "countloolkits.hpp"
-diff --git a/test/httpwserror.cpp b/test/httpwserror.cpp
-index 0bd8b65..67fd235 100644
---- a/test/httpwserror.cpp
-+++ b/test/httpwserror.cpp
-@@ -22,7 +22,7 @@
- #include <cppunit/extensions/HelperMacros.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "helpers.hpp"
- #include "countloolkits.hpp"
-diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
-index 93a024b..042c6d3 100644
---- a/test/httpwstest.cpp
-+++ b/test/httpwstest.cpp
-@@ -40,7 +40,7 @@
- #include <cppunit/extensions/HelperMacros.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Png.hpp"
- #include "UserMessages.hpp"
-diff --git a/tools/Connect.cpp b/tools/Connect.cpp
-index 5b550dd..d45b243 100644
---- a/tools/Connect.cpp
-+++ b/tools/Connect.cpp
-@@ -41,7 +41,7 @@
- #include <Poco/Version.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "Util.hpp"
-diff --git a/tools/KitClient.cpp b/tools/KitClient.cpp
-index 06d0a33..a587a28 100644
---- a/tools/KitClient.cpp
-+++ b/tools/KitClient.cpp
-@@ -27,7 +27,7 @@
- #include <Poco/URI.h>
- #include <Poco/Util/Application.h>
- 
--#include "LOKitHelper.hpp"
-+#include "KitHelper.hpp"
- #include "Png.hpp"
- #include "Util.hpp"
- 
-diff --git a/tools/Tool.cpp b/tools/Tool.cpp
-index b658108..437fe1d 100644
---- a/tools/Tool.cpp
-+++ b/tools/Tool.cpp
-@@ -40,7 +40,7 @@
- #include <Poco/Util/OptionSet.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "Util.hpp"
- 
- #include <Poco/Util/Application.h>
-diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
-index 445fa1e..62ee9b2 100644
---- a/wsd/Admin.cpp
-+++ b/wsd/Admin.cpp
-@@ -31,8 +31,8 @@
- #include "Common.hpp"
- #include "FileServer.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
--#include <LOOLWebSocket.hpp>
-+#include "Protocol.hpp"
-+#include "LOOLWebSocket.hpp"
- #include "LOOLWSD.hpp"
- #include "Log.hpp"
- #include "Storage.hpp"
-diff --git a/wsd/AdminModel.cpp b/wsd/AdminModel.cpp
-index 62d4ab7..05df3d7 100644
---- a/wsd/AdminModel.cpp
-+++ b/wsd/AdminModel.cpp
-@@ -19,7 +19,7 @@
- #include <Poco/StringTokenizer.h>
- #include <Poco/URI.h>
- 
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "Unit.hpp"
-diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
-index 00a0a3f..cedbc5e 100644
---- a/wsd/ClientSession.cpp
-+++ b/wsd/ClientSession.cpp
-@@ -20,8 +20,8 @@
- 
- #include "Common.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
--#include "LOOLSession.hpp"
-+#include "Protocol.hpp"
-+#include "Session.hpp"
- #include "LOOLWSD.hpp"
- #include "Log.hpp"
- #include "PrisonerSession.hpp"
-diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
-index 7b7740c..e958f34 100644
---- a/wsd/ClientSession.hpp
-+++ b/wsd/ClientSession.hpp
-@@ -10,7 +10,7 @@
- #ifndef INCLUDED_CLIENTSSESSION_HPP
- #define INCLUDED_CLIENTSSESSION_HPP
- 
--#include "LOOLSession.hpp"
-+#include "Session.hpp"
- #include "MessageQueue.hpp"
- 
- #include <Poco/URI.h>
-diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
-index a71d405..b814d35 100644
---- a/wsd/DocumentBroker.cpp
-+++ b/wsd/DocumentBroker.cpp
-@@ -22,7 +22,7 @@
- #include "Admin.hpp"
- #include "ClientSession.hpp"
- #include "Exceptions.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "LOOLWSD.hpp"
- #include "Log.hpp"
- #include "PrisonerSession.hpp"
-diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
-index e6a5f27..dd8df4b 100644
---- a/wsd/LOOLWSD.cpp
-+++ b/wsd/LOOLWSD.cpp
-@@ -101,8 +101,8 @@
- #include "FileServer.hpp"
- #include "common/FileUtil.hpp"
- #include "IoUtil.hpp"
--#include "LOOLProtocol.hpp"
--#include "LOOLSession.hpp"
-+#include "Protocol.hpp"
-+#include "Session.hpp"
- #include <LOOLWebSocket.hpp>
- #include "Log.hpp"
- #include "PrisonerSession.hpp"
-diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp
-index b4956ce..766790e 100644
---- a/wsd/LOOLWebSocket.hpp
-+++ b/wsd/LOOLWebSocket.hpp
-@@ -15,7 +15,7 @@
- #include <Poco/Net/WebSocket.h>
- 
- #include <Common.hpp>
--#include <LOOLProtocol.hpp>
-+#include <Protocol.hpp>
- #include <Log.hpp>
- 
- /// WebSocket that is thread safe, and handles large frames transparently.
-diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
-index bb352cc..8fea0e1 100644
---- a/wsd/PrisonerSession.cpp
-+++ b/wsd/PrisonerSession.cpp
-@@ -17,8 +17,8 @@
- #include <Poco/URIStreamOpener.h>
- 
- #include "Common.hpp"
--#include "LOOLProtocol.hpp"
--#include "LOOLSession.hpp"
-+#include "Protocol.hpp"
-+#include "Session.hpp"
- #include "LOOLWSD.hpp"
- #include "Log.hpp"
- #include "ClientSession.hpp"
-diff --git a/wsd/PrisonerSession.hpp b/wsd/PrisonerSession.hpp
-index a52dfc8..1518ab4 100644
---- a/wsd/PrisonerSession.hpp
-+++ b/wsd/PrisonerSession.hpp
-@@ -10,7 +10,7 @@
- #ifndef INCLUDED_PRISONERSESSION_HPP
- #define INCLUDED_PRISONERSESSION_HPP
- 
--#include "LOOLSession.hpp"
-+#include "Session.hpp"
- 
- class DocumentBroker;
- class ClientSession;
-diff --git a/wsd/QueueHandler.hpp b/wsd/QueueHandler.hpp
-index 3f330e6..445b91e 100644
---- a/wsd/QueueHandler.hpp
-+++ b/wsd/QueueHandler.hpp
-@@ -9,8 +9,8 @@
- 
- #include <Poco/Runnable.h>
- 
--#include "LOOLProtocol.hpp"
--#include "LOOLSession.hpp"
-+#include "Protocol.hpp"
-+#include "Session.hpp"
- #include "MessageQueue.hpp"
- #include "Util.hpp"
- 
-diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
-index 41d9bd0..0ce257f 100644
---- a/wsd/TileCache.cpp
-+++ b/wsd/TileCache.cpp
-@@ -33,7 +33,7 @@
- #include "ClientSession.hpp"
- #include "Common.hpp"
- #include "common/FileUtil.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- #include "Unit.hpp"
- #include "Util.hpp"
- 
-diff --git a/wsd/TileDesc.hpp b/wsd/TileDesc.hpp
-index 8ba44bd..111c509 100644
---- a/wsd/TileDesc.hpp
-+++ b/wsd/TileDesc.hpp
-@@ -18,7 +18,7 @@
- #include <Poco/StringTokenizer.h>
- 
- #include "Exceptions.hpp"
--#include "LOOLProtocol.hpp"
-+#include "Protocol.hpp"
- 
- /// Tile Descriptor
- /// Represents a tile's coordinates and dimensions.
diff --git a/rename.sh b/rename.sh
deleted file mode 100755
index 2c5c8f1..0000000
--- a/rename.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-
-# rename script to be run before branching.
-
-mkdir -p wsd
-mkdir -p doc
-mkdir -p kit
-mkdir -p common
-mkdir -p tools
-mkdir -p test
-mkdir -p bundled
-mkdir -p etc
-mkdir -p debian
-
-git mv loolwsd/* wsd
-
-git mv wsd/test/* test
-git mv wsd/bundled/* bundled
-git mv wsd/etc/* etc
-git mv wsd/debian/* debian
-git mv wsd/common/* common
-
-for commonfile in IoUtil Log MessageQueue Unit UnitHTTP Util; do
-    git mv wsd/$commonfile.cpp common;
-    git mv wsd/$commonfile.hpp common;
-done
-git mv wsd/Png.hpp common
-git mv wsd/Common.hpp common
-git mv wsd/Rectangle.hpp common
-git mv wsd/LOOLProtocol.cpp common/Protocol.cpp
-git mv wsd/LOOLProtocol.hpp common/Protocol.hpp
-git mv wsd/LOOLSession.cpp common/Session.cpp
-git mv wsd/LOOLSession.hpp common/Session.hpp
-git mv wsd/security.h common/security.h
-
-git mv wsd/ChildSession.cpp kit
-git mv wsd/ChildSession.hpp kit
-git mv wsd/LOOLForKit.cpp kit/ForKit.cpp
-git mv wsd/LOOLKit.cpp kit/Kit.cpp
-git mv wsd/LOOLKit.hpp kit/Kit.hpp
-git mv wsd/LOKitHelper.hpp kit/KitHelper.hpp
-
-git mv wsd/Connect.cpp tools
-git mv wsd/LOKitClient.cpp tools/KitClient.cpp
-git mv wsd/loolmount.c tools/mount.c
-git mv wsd/loolmap.c tools/map.c
-git mv wsd/LOOLTool.cpp tools/Tool.cpp
-git mv wsd/LOOLStress.cpp tools/Stress.cpp
-
-for file in discovery.xml favicon.ico loolwsd.xml.in \
-            loolwsd.service robots.txt sysconfig.loolwsd \
-            configure.ac Makefile.am autogen.sh \
-            COPYING AUTHORS ChangeLog INSTALL NEWS PROBLEMS \
-            loolstat loolwsd-systemplate-setup loolwsd.spec.in \
-            maketarballfordeb.sh.in TODO \
-    ; do
-	git mv wsd/$file .
-done
-
-git mv loolwsd/.gitignore .
-git mv loolwsd/.clang-tidy .
-rmdir loolwsd
commit 1d124f1980d60e060ff0d41b21acd42efe50cd42
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Dec 20 14:50:09 2016 +0200

    Drop unneeded forward declaration
    
    Change-Id: Iba2fab89780b381ad60a921e4d3fbe80355a8f64

diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 8ea840f..34e90d9 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -170,7 +170,6 @@ private:
     std::atomic<bool> _stop;
 };
 
-class PrisonerSession;
 class ClientSession;
 
 /// DocumentBroker is responsible for setting up a document


More information about the Libreoffice-commits mailing list