[Libreoffice-commits] online.git: 2 commits - loolwsd/ChildProcessSession.cpp loolwsd/LOOLForKit.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp loolwsd/MasterProcessSession.cpp loolwsd/protocol.txt

Tor Lillqvist tml at collabora.com
Mon Apr 18 12:42:19 UTC 2016


 loolwsd/ChildProcessSession.cpp  |    8 +-------
 loolwsd/LOOLForKit.cpp           |    2 +-
 loolwsd/LOOLKit.cpp              |    2 +-
 loolwsd/LOOLWSD.cpp              |   12 ++++++------
 loolwsd/MasterProcessSession.cpp |    1 -
 loolwsd/protocol.txt             |    9 ---------
 6 files changed, 9 insertions(+), 25 deletions(-)

New commits:
commit f769474d258db3e11e2f8043a05d514c54b4e491
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 18 15:36:18 2016 +0300

    The "unload" message is not implemented and likely won't be

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 4ea65d5..553fa4c 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -412,8 +412,7 @@ bool ChildProcessSession::_handleInput(const char *buffer, int length)
                tokens[0] == "selecttext" ||
                tokens[0] == "selectgraphic" ||
                tokens[0] == "resetselection" ||
-               tokens[0] == "saveas" ||
-               tokens[0] == "unload");
+               tokens[0] == "saveas");
 
         {
             std::unique_lock<std::recursive_mutex> lock(Mutex);
@@ -483,11 +482,6 @@ bool ChildProcessSession::_handleInput(const char *buffer, int length)
         {
             return saveAs(buffer, length, tokens);
         }
-        else if (tokens[0] == "unload")
-        {
-            //FIXME: Implement.
-            assert(!"Not implemented");
-        }
         else
         {
             assert(false);
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 63b32eb..5c053c7 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -329,7 +329,6 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
              tokens[0] != "status" &&
              tokens[0] != "tile" &&
              tokens[0] != "tilecombine" &&
-             tokens[0] != "unload" &&
              tokens[0] != "uno")
     {
         sendTextFrame("error: cmd=" + tokens[0] + " kind=unknown");
diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index f6e1f52..2b4d80f 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -114,15 +114,6 @@ tilecombine <parameters>
     Accept same parameters as 'tile' message except parameters 'tileposx' and 'tileposy'
     can be a comma separated list, and number of elements in both must be same.
 
-unload [save|force]
-
-    unloads the document.
-
-    if 'save' is specified, the document is saved before unloading,
-    otherwise, changes are discarded.
-    if other users have the document open, and save not specified,
-    'force' is necessary to discard changes.
-
 uno <command>
 
     <command> is a line of text.
commit a08b2a0e0bcae97e8e898a6d2d94c71ec7a2ad79
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 18 15:33:22 2016 +0300

    Just use "/" instead of Poco::Path::separator()

diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index eee5788..c2dad0b 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -268,7 +268,7 @@ int main(int argc, char** argv)
     if (!std::getenv("LOK_VIEW_CALLBACK"))
         Log::info("Note: LOK_VIEW_CALLBACK is not set.");
 
-    const Path pipePath = Path::forDirectory(childRoot + Path::separator() + FIFO_PATH);
+    const Path pipePath = Path::forDirectory(childRoot + "/" + FIFO_PATH);
     const std::string pipeLoolwsd = Path(pipePath, FIFO_LOOLWSD).toString();
     if ( (pipeFd = open(pipeLoolwsd.c_str(), O_RDONLY) ) < 0 )
     {
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 8a4b8e4..28e1d68 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -886,7 +886,7 @@ void lokit_main(const std::string& childRoot,
         {
             instdir_path = "/" + loSubPath + "/program";
 
-            jailPath = Path::forDirectory(childRoot + Path::separator() + jailId);
+            jailPath = Path::forDirectory(childRoot + "/" + jailId);
             Log::info("Jail path: " + jailPath.toString());
             File(jailPath).createDirectories();
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 648ac7d..0d9c516 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -239,7 +239,7 @@ public:
         if (!params.has("filename"))
             return;
 
-        Path tempPath = Path::forDirectory(TemporaryFile().tempName() + Path::separator());
+        Path tempPath = Path::forDirectory(TemporaryFile().tempName() + "/");
         File(tempPath).createDirectories();
         tempPath.setFileName(params.get("filename"));
         _filename = tempPath.toString();
@@ -428,7 +428,7 @@ private:
                     const std::string dirPath = LOOLWSD::ChildRoot + formChildid
                                               + JAILED_DOCUMENT_ROOT + "insertfile";
                     File(dirPath).createDirectories();
-                    std::string fileName = dirPath + Path::separator() + form.get("name");
+                    std::string fileName = dirPath + "/" + form.get("name");
                     File(tmpPath).moveTo(fileName);
                     return false;
                 }
@@ -443,7 +443,7 @@ private:
                                       + JAILED_DOCUMENT_ROOT + tokens[2];
             std::string fileName;
             URI::decode(tokens[3], fileName);
-            const std::string filePath = dirPath + Path::separator() + fileName;
+            const std::string filePath = dirPath + "/" + fileName;
             Log::info("HTTP request for: " + filePath);
             File file(filePath);
             if (file.exists())
@@ -1383,8 +1383,8 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     if (ChildRoot.empty())
         throw MissingOptionException("childroot");
-    else if (ChildRoot[ChildRoot.size() - 1] != Path::separator())
-        ChildRoot += Path::separator();
+    else if (ChildRoot[ChildRoot.size() - 1] != '/')
+        ChildRoot += '/';
 
     if (FileServerRoot.empty())
         FileServerRoot = Path(Application::instance().commandPath()).parent().parent().toString();
@@ -1399,7 +1399,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
         Log::warn("No admin credentials set via 'admincreds' command-line argument. Admin Console will be disabled.");
     }
 
-    const Path pipePath = Path::forDirectory(ChildRoot + Path::separator() + FIFO_PATH);
+    const Path pipePath = Path::forDirectory(ChildRoot + "/" + FIFO_PATH);
     if (!File(pipePath).exists() && !File(pipePath).createDirectory())
     {
         Log::error("Failed to create pipe directory [" + pipePath.toString() + "].");


More information about the Libreoffice-commits mailing list