Commit graph

51 commits

Author SHA1 Message Date
Tor Lillqvist
e5de11113b Don't check for or send "disconnect" frames anywhere and don't document them
Follow-up to 68b3a2c81e.
2016-04-13 15:49:10 +03:00
Pranav Kant
9444bb2b87 loolwsd: update documentation about editlock
Change-Id: Id819a2e2d0739a773c5a01ec7bc80152c03bf8f0
2016-04-09 01:52:17 +05:30
Jan Holesovsky
156d52b82e loolwsd: Add handling of contextmenu: command. 2016-04-08 19:15:08 +02:00
Jan Holesovsky
6b15dfd552 loolwsd, loleaflet: Rename 'connectionclose' to 'disconnect'. 2016-03-15 10:32:28 +01:00
Jan Holesovsky
2c1664b9d5 loolwsd, loleaflet: Let the server know when we are closing the session.
This is to distinguish the deliberate close of connection, and timeout,
connection drop, or forced close.

When the last session is closed non-deliberately, force a save so that the
edits are not lost.
2016-03-15 09:46:37 +01:00
Jan Holesovsky
2590cd186e loolwsd: LOK_CALLBACK_PARTS_COUNT_CHANGED was removed from the API. 2016-03-03 11:13:34 +01:00
Tor Lillqvist
bc7decb6ca No "disconnect" message is sent by our client JS code (and that is good)
Having a separate "disconnect" message is a disgrace. There should be
no need for it. WebSocket has a perfectly fine graceful disconnect
mechanism already (CLOSE frames). The code needs to be prepared to
receive a CLOSE frame at any time. The code also needs to be prepared
for the underlying socket being bluntly closed by the other end,
without sending any WebSocket CLOSE frame. The only sane thing is to
handle a "disconnect" message in the same way as those situations
anyway, so why is it needed?
2016-02-24 17:44:17 +02:00
Henry Castro
c2413998be loolwsd: add partscountchanged protocol 2016-02-20 16:45:40 -04:00
Pranav Kant
cabb9d7fc3 loolwsd: Add a missing command, 'tilecombine' to documentation
Change-Id: Iedefef83cefca6e88e9676a0bc810ecb766b59ee
2016-02-19 00:32:03 +05:30
Tor Lillqvist
54a2ca8b2b Fix typo 2016-02-18 15:42:45 +02:00
Jan Holesovsky
32ecdb8ab6 loolwsd, loleaflet: Handle the ERROR callback.
This introduces a new error id 5 - "document save failed".
2016-02-03 11:24:21 +01:00
Miklos Vajna
aa450a0c38 loolwsd: add clientvisiblearea client -> server command 2016-02-02 11:49:22 +01:00
Ashod Nakashian
41da8f144e loolwsd: unload command added
Change-Id: I30c42e24aa38c676e4bc6c7e6a2715d9e72430b9
Reviewed-on: https://gerrit.libreoffice.org/21686
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:07:54 +00:00
Ashod Nakashian
dd374d8aec loolwsd: disconnect command to gracefully shutdown a socket
Change-Id: I8beb4c14fc95bdb2a98c7e5da44408511bce5e28
Reviewed-on: https://gerrit.libreoffice.org/21683
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:05:55 +00:00
Miklos Vajna
1977f07d5c paste: handle data containing newlines
By changing the protocol, so that instead of "paste ... data=<data>",
the client is now expected to send "paste ...\n<data>".
2016-01-15 14:43:59 +01:00
Ashod Nakashian
2d385d697e Protocol versioning added and documented
Change-Id: I6e1df89c7330052bd2d442a42c0b24c8ae4facf6
Reviewed-on: https://gerrit.libreoffice.org/21168
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-06 17:06:47 +00:00
Mihai Varga
862cfe29a0 loolwsd: renderfont command handler
Renders the requested font and sends it back to the client as a png
image
2015-11-30 11:16:53 +02:00
Miklos Vajna
e6f0abf763 loolwsd: support getting load options
This is a single json that contains both load and rendering options.
Currently only the rendering ones are added to it by the client.

Also, just accept the options string for now, a later commit will have
to actually pass the rendering part to
lok::Document::initializeForRendering().
2015-11-18 18:12:27 +01:00
Miklos Vajna
cb189234b0 loolwsd: describe so far undocumented part= parameter of the load command 2015-11-18 17:53:03 +01:00
Jan Holesovsky
7a88c9b959 loolwsd: Document unocommandresult in the protocol. 2015-11-04 13:33:11 +01:00
Miklos Vajna
cc24463f08 loolwsd: wrap lok::Document::paste() 2015-10-27 11:53:32 +01:00
Mihai Varga
58d7c99f19 loolwsd: added getChildId and insertFile methods
getChildId is used to get the chroot's name and insertFile inserts a the
/user/thedocument/insertfile/file_name file in the document
2015-10-22 18:32:19 +03:00
Miklos Vajna
4feb29d1df LOOLSession: inform to-client session about completed save-as 2015-10-20 14:03:39 +02:00
Mihai Varga
d7ceedac54 drop 'part' from downloadas protocol as it is no longer needed 2015-10-16 19:35:31 +03:00
Mihai Varga
0708e4440f added a part parameter to the 'downloadas' command
We need it to export a specific slide to svg
2015-10-13 20:58:45 +03:00
Mihai Varga
51505e1934 add an ID parameter to the downloadas command
We need it to know wheter the user wants to download the file or just
print it, etc
2015-10-09 17:20:18 +03:00
Mihai Varga
676c6d60d1 tdf#94607 downloadAs command that generates an URL for the doc
When requested, the document is exported under
/jail_path/CHILD_ID/user/thedocument/RANDOMDIR/filename
and CHILD_ID, RANDOMDIR and the filename are communicated to the client.

When the client requests
http://server:port/CHILD_ID/RANDOMDIR/filename, the exported document
is served and then RANDOMDIR is removed
2015-10-09 16:11:38 +03:00
Miklos Vajna
7441ffa21a loolwsd: document partpagerectangles command on both directions 2015-09-29 12:55:21 +02:00
Mihai Varga
1cfd1352ce loolwsd: renamed getStatus/saveStatus to getTextFile/saveTextFile
And added a getStyles method that uses the above methods to cache
document styles
2015-08-19 11:48:49 +03:00
Mihai Varga
d4f818522a 'requestloksession' message that starts a LOK process
Used to predict the user's interaction with the document and to
provide a better response time
2015-08-06 18:54:45 +03:00
Jan Holesovsky
2d2fd83859 Document the timestamp= parameter in the protocol.txt. 2015-08-04 20:42:27 +02:00
Mihai Varga
2ebe9f1be1 loolwsd: format and options in 'saveas' are optional 2015-07-16 12:51:07 +03:00
Mihai Varga
675cfb8c4a loolwsd: send part names with the status message
Also disabled the status length assertion because part names
are separated by new-line characters ('\n')
2015-07-15 18:49:32 +03:00
Mihai Varga
e8007ea405 Server getTextSelection implementation 2015-06-24 18:08:15 +03:00
Tor Lillqvist
70b1e58f4c Typo 2015-06-09 18:29:55 +03:00
Tor Lillqvist
629ba87139 Add a "canceltiles" message to the protocol and handle it
Implementing this Was harder than I first expected. The basic idea is as
follows: The master process puts each message arriving from a client that
isn't "canceltiles" into a (client-specific) queue. A separate thread that
pulls messages from the queue at its own pace and handles them as
before. Incoming "canceltiles" messages are handled specially, though: The
queue is emptied of "tile" messages.

The above sounds simple but there are several details that were a bit tricky
to get right.
2015-06-09 18:29:48 +03:00
Tor Lillqvist
a608aaee90 Add an invalidate: message that is in LOOL style with named parameters
The invalidatetiles: message as generated directly from the
LOK_CALLBACK_INVALIDATE_TILES will be dropped soon.
2015-05-29 09:44:39 +03:00
Tor Lillqvist
bf985624f1 Handle LOK_CALLBACK_INVALIDATE_TILES in the server too
Remove any intersecting cached tiles. It is the parent process that handles
the tile cache, so it must look for invalidatetiles: messages, too, before
passing them on to the client. To know for which part we should remove tiles,
add an "ephemeral" curpart: message that the child process sends to the parent
process before the invalidatetils: message.
2015-05-28 18:48:51 +03:00
Tor Lillqvist
1d75eacd6a Add an invalidatetiles message from client to server
Mainly as a debugging aid to make it easier to check the tile cache invalidation
code, but might be useful for real, too.
2015-05-28 18:48:51 +03:00
Tor Lillqvist
5d9f5e715a Sort the messages in the sections 2015-05-28 18:48:51 +03:00
Tor Lillqvist
73273eb027 Also let the nextmessage: from a child process be forwarded to the client
The loadtest program needs it as it, too, uses Poco, which currently does not
have an API to receive an arbitrarily large WebSocket message.
2015-05-28 16:46:37 +03:00
Tor Lillqvist
058416b9d7 Handle arbitrarily large tile: messages from child to parent
The parent currently uses a fixed-size 100000 byte buffer to receive
messages. Even with a tile size of 256x256 pixels, that is not enough for some
tiles that compress badly as PNG. Add a nextmessage: message that gives the
size of the immediately following message. Send a such before each tile:
message, and handle it appropriately. The nextmessage: message is used only
from child to parent process, it is never sent to the Websocket client.

Once Poco 1.6.1 is released, this will not be necessary.
2015-05-18 11:24:32 +03:00
Tor Lillqvist
1b06290d2b Add a part parameter to the tile messages
The JS code always passes in 0 for now. The server parses the parameter and
calls LibreOfficeKitDocument::setPart() before calling paintTile().

Probably also the status, key, mouse and selection messages will need a part
number. The intent is after all that the protocol is as stateless as
possible. (So maybe we should also pass the document URL in each message?)
2015-04-27 21:30:26 +03:00
Tor Lillqvist
867a66aa62 A bit more info 2015-03-24 19:04:16 +02:00
Tor Lillqvist
97fbe8e857 Add 'saveas' 2015-03-23 22:14:11 +02:00
Tor Lillqvist
215fda0235 Add key and mouse event handling, uno command, and selection handling
Not "handled" here of course, just pass them on to LibreOfficeKit.
2015-03-20 13:18:01 +02:00
Tor Lillqvist
721d835c79 Also mention the communication between parent and child process 2015-03-20 13:18:01 +02:00
Tor Lillqvist
1a5e1b0fa4 Incorporate LOK_CALLBACK_* generically 2015-03-13 11:30:45 +02:00
Tor Lillqvist
bf611698b2 No need for a separate 'close' request
Having a 'close' would mean being able to do a new 'open', too, which
introduces unneeded complexity, at least at this stage.

Just start a fresh WebSocket connection for each document.
2015-03-09 17:45:51 +02:00
Tor Lillqvist
a526b2faa2 Add the callbacks 2015-03-05 15:57:03 +02:00