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

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


 loolwsd/ChildProcessSession.cpp  |    8 +++++++-
 loolwsd/MasterProcessSession.cpp |    1 +
 loolwsd/protocol.txt             |   29 +++++++++++++++++++----------
 3 files changed, 27 insertions(+), 11 deletions(-)

New commits:
commit 41da8f144e5adafe98dc1e824541e9dee8249644
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu Jan 21 10:11:39 2016 -0500

    loolwsd: unload command added
    
    Change-Id: I30c42e24aa38c676e4bc6c7e6a2715d9e72430b9
    Reviewed-on: https://gerrit.libreoffice.org/21686
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 76c6d46..54a689f 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -164,7 +164,8 @@ bool ChildProcessSession::_handleInput(const char *buffer, int length)
                tokens[0] == "selecttext" ||
                tokens[0] == "selectgraphic" ||
                tokens[0] == "resetselection" ||
-               tokens[0] == "saveas");
+               tokens[0] == "saveas" ||
+               tokens[0] == "unload");
 
         {
             std::unique_lock<std::recursive_mutex> lock(Mutex);
@@ -235,6 +236,11 @@ 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 a2be65d..efb07b8 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -315,6 +315,7 @@ 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 b30f180..619a32a 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -11,16 +11,6 @@ tiles proactively (guessing what the client might need). Etc.
 client -> server
 ================
 
-loolclient <major.minor[-patch]>
-
-    Upon connection, a client must announce the version number it supports.
-    Major: an integer that must always match between client and server,
-           otherwise there are no guarantees of any sensible
-           compatibility. This is bumped when API changes.
-    Minor: an integer is more flexible and is at the discretion of either party.
-           Security fixes that do not alter the API would bump the minor version number.
-    Patch: an optional string that is informational.
-
 canceltiles
 
     All outstanding tile messages from the client to the server are
@@ -77,6 +67,16 @@ load [part=<partNumber>] url=<url> [timestamp=<time>] [options=<options>]
 
     options are the whole rest of the line, not URL-encoded
 
+loolclient <major.minor[-patch]>
+
+    Upon connection, a client must announce the version number it supports.
+    Major: an integer that must always match between client and server,
+           otherwise there are no guarantees of any sensible
+           compatibility. This is bumped when API changes.
+    Minor: an integer is more flexible and is at the discretion of either party.
+           Security fixes that do not alter the API would bump the minor version number.
+    Patch: an optional string that is informational.
+
 mouse type=<type> x=<x> y=<y> count=<count>
 
     <type> is 'buttondown', 'buttonup' or 'move', others are numbers.
@@ -114,6 +114,15 @@ tile part=<partNumber> width=<width> height=<height> tileposx=<xpos> tileposy=<y
 
     All parameters are numbers.
 
+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.


More information about the Libreoffice-commits mailing list