Commit graph

83 commits

Author SHA1 Message Date
Pranav Kant
46107dd0c8 loolwsd: Always send the updated view info to clients
This replaces addview/remview/remallview messages in the protocol
with 'viewinfo' message which is sent whenever there is any
change in the view information.

Let the client deal with what information is redundant to it.

Change-Id: Ic470ea88a94ff281a0ae021014a9fba1b876f648
2016-09-21 12:02:27 +05:30
Miklos Vajna
ef4ca0507a loolwsd: remove takeedit and editlock commands
As a follow-up to commit 77e219ceff
(loleaflet: Kill editlock code, completely, 2016-09-20).

Change-Id: I48a58bb738c0939f99d220eca7a8fd3f4c3debe4
2016-09-20 09:47:25 +02:00
Michael Meeks
8182dd8c54 Assign priority based on intersection with the cursor.
Should help to reduce visual tearing when cursor spans a tile join.
2016-09-01 21:18:38 +01:00
Pranav Kant
7d48cd6f17 loolwsd: Echo back view information to clients
View information as of now includes viewid and username
associated with the view.

Change-Id: If0c4957eb56962eb4b1b1d0c1189dc300fa6b857
Reviewed-on: https://gerrit.libreoffice.org/28482
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-08-30 07:45:47 +00:00
Tor Lillqvist
e10175aed6 Nah, it's better to use the Storage thing to get the user name
instead of accepting it in the load message

Let's not just bother documenting random examples of what might be in
the JSON, this is not the right place for it.
2016-08-24 10:32:00 +03:00
Tor Lillqvist
4e8fd90bea Document the .uno:Author attribute in the options parameter of the load message
... as I understand it, that is. Not sure whether it makes sense to
document stuff like this here, or in the LibreOfficeKit headers.
2016-08-23 19:38:42 +03:00
Tor Lillqvist
0a18d513a1 Mention that the options parameter of the load message must be JSON 2016-08-22 16:01:19 +03:00
Tor Lillqvist
300cc0e947 There is no 'loadtest' program since a while 2016-08-22 15:45:42 +03:00
Ashod Nakashian
4b28a9a4fc loolwsd: forward redline table update notification event to the UI
Change-Id: I45df2a1aaf826301a113f8cf0a8c609d46b794a7
Reviewed-on: https://gerrit.libreoffice.org/28304
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-22 05:46:37 +00:00
Ashod Nakashian
59ed1bd2ff loleaflet: new command remallviews to remove all views
This command is intended to be used when re-activating a
client. It is intended to be sent prior to sending the
list of active views, including the re-activating
client's own view.

A client UI must maintain its own view ID and info
when receiving this command.

Change-Id: Iea58c01fb30af139888e746b5cf9e7ba7e7eeab1
Reviewed-on: https://gerrit.libreoffice.org/28132
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-15 03:15:47 +00:00
Ashod Nakashian
fbcce1b803 loleaflet+loolwsd: new commands addview and remview
The new commands help the UI update the cursors and other
visual elements that track views and clients.

Currently, when remview is received loleaflet removes
the associated cursor from the screen.

Change-Id: I03e2f9e3485166adae31de84ae7ac6bd1c85b05d
Reviewed-on: https://gerrit.libreoffice.org/28131
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-15 03:15:01 +00:00
Pranav Kant
9f1070ded7 loolwsd: forward notification for LOK_CALLBACK_VIEW_CURSOR_VISIBLE too 2016-08-03 19:50:25 +05:30
Pranav Kant
b8ef017610 Move JWT auth to inside websocket to prevent CSRF
... instead of setting a httpOnly cookie for admin websocket
endpoint which can be CSRFed.

With this, we remove the httpOnly tag on jwt cookie so that
scripts in admin html pages can access the jwt cookie and
authenticates after opening websocket endpoint. Until
authenticated using 'auth authToken' command, admin will not
respond to any admin command.

Also, adapt admin test these changes
2016-07-29 12:03:14 +05:30
Artyom Sovetnikov
85d275ab1a loolwsd: Remove pong frame hack
https://github.com/LibreOffice/online/pull/1
2016-07-27 23:04:25 +05:30
Ashod Nakashian
93d38f6e78 loolwsd: document new per-view notifications
Change-Id: Idfafb981e6face61c65809b24c646ceac9507992
Reviewed-on: https://gerrit.libreoffice.org/27591
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-27 16:01:10 +00:00
Ashod Nakashian
d56f9a0386 loolwsd: status now includes the view-ID of the client
Change-Id: Iac1cd806ac24ff3956624513946921020d248664
Reviewed-on: https://gerrit.libreoffice.org/27585
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-27 15:55:09 +00:00
Pranav Kant
3907a2f3cc protocol.txt: Update lokitversion info format
Change-Id: I1ea7d6d777d6b3b790ece6c268b9d15167f67a44
2016-07-21 13:18:00 +05:30
Pranav Kant
b83ac269fa loolwsd: Send LOKit version information to clients
Send as a response to 'loolclient' message received from the
client

Change-Id: I3d33f9fd087489aa9bf5a94f591ab04e208cbf13
2016-06-21 00:30:36 +05:30
Miklos Vajna
f64534404c loolwsd: document setclientpart command
At least I guess this is the purpose of it, based on commit
b9884a470a (loolwsd: be aware of the
client's current part, 2015-07-21).
2016-06-15 14:31:52 +02:00
Pranav Kant
5b30e5f9d4 Document 'statechanged' event
Change-Id: Ibfad6ae98e525af69e855d588152a9a9eaf953fe
2016-05-23 13:41:38 +05:30
Pranav Kant
2b01bdc7ad Document admin console commands and its scope
Change-Id: I5504a8350d6383e64e85b46454586c1e5c8eed87
2016-05-11 15:38:40 +05:30
Ashod Nakashian
83307291ec Document id argument of tile and tilecombine
Change-Id: Ia43ceae31936f68d2bed04b5291a25eeffc637b3
Reviewed-on: https://gerrit.libreoffice.org/24676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-05 11:37:24 +00:00
Tor Lillqvist
bfcf9756f5 Don't assert on PING frames that we send
UnitPrefork got what I assume is one of those PING frames that
ChildProcess::isAlive() sends before the actual reply when it sent the
"unit-memdump" message, and did not like it. Uncommenting the line
that outputs the "memory stats" message it expects showed:

Got memory stats 'PING'

Followed by:

Assertion `tokens.count() == 2' failed.

Fix by factoring out the handling of PING frames, PONG frames, and the
pseudo-PONG frames that we send ourselves in reply to PING frames into
a new function IoUtil::receiveFrame(). Use that in a couple of
places. (Probably should use in many more places.)

Getting past this then leads to later cppunit tests again being run,
and their failures then again showing up...
2016-05-03 09:50:38 +03:00
Tor Lillqvist
79968ccefb Clarify binary vs text frame non-distinction
Note that we currently have unit tests that incorrectly (IMHO) require
some frames sent by the server to indeed be 'text' ones from the
WebSocket perspective. That is an unnecessary restriction.
2016-05-03 08:23:06 +03:00
Tor Lillqvist
15e216ff7c Clarify that single-line don't need a newline terminator 2016-05-03 08:15:06 +03:00
Tor Lillqvist
c80b7388ed The JS client never sends any 'invalidatetiles' 2016-04-22 17:50:25 +03:00
Ashod Nakashian
f83cc22db9 Documentation update for 'useractive' and 'userinactive'.
Change-Id: I4e2f0923aa5d0f35c29c752b144e23b365e73bb0
Reviewed-on: https://gerrit.libreoffice.org/24279
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-21 13:03:06 +00:00
Tor Lillqvist
5a509f9211 In a debug build, say in the tile: reponse also whether it was found in cache
Also, do the construction of the response string in
MasterProcessSession::sendTile() only when it is actually going to be
used.
2016-04-20 18:54:18 +03:00
Tor Lillqvist
77a91c4b2e In debug builds append a renderid=<unique-id> token to tile: responses
Will be used in unit test to verify that several clients of the same
document asking for the same tile simultaneously indeed do cause just
one tile rendering to take place.
2016-04-20 18:54:17 +03:00
Tor Lillqvist
e94e8344ad IIUC, the 'tile' and 'tile:' messages have an optional timestamp parameter 2016-04-20 18:54:17 +03:00
Tor Lillqvist
f769474d25 The "unload" message is not implemented and likely won't be 2016-04-18 15:39:51 +03:00
Pranav Kant
382da839e0 Add documentation about takeedit
Change-Id: I600046111d2478f1c02552d3caa60d2a50fa7c98
2016-04-15 14:48:58 +05:30
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