Commit graph

61 commits

Author SHA1 Message Date
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
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