Commit graph

220 commits

Author SHA1 Message Date
Mihai Varga
803c89a43f loolwsd: only cache font/style command values
This fixes a bug where row/column headers were cached too
2015-12-14 14:38:05 +02:00
Henry Castro
f5292a367e loolwsd: rework, remove a jail root child 2015-12-04 17:09:28 -04:00
Henry Castro
4617a93e5c loolwsd: create a child workspace based on process id 2015-12-03 10:50:03 -04:00
Andras Timar
4f2d9b02e5 Revert "loolwsd: add support for postMouseEvent's targetwindow"
This reverts commit d1b39e39e8.
2015-12-02 16:46:25 +01:00
Andrzej Hunt
d1b39e39e8 loolwsd: add support for postMouseEvent's targetwindow
(cherry picked from commit b45e3fa5becf8fcbf106cb6b944c8f4709563d43)
2015-12-02 16:22:55 +01:00
Mihai Varga
e1b0e3dce9 loolwsd: update renderFont png encoding 2015-11-30 12:58:41 +02: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
Henry Castro
c0fbf5ebf9 loolwsd: remove child root folder when it is a gracefull shut down 2015-11-25 23:17:08 -04:00
Henry Castro
d09951091a loolwsd: avoid double child socket shutdown
It was causing "broke pipe" exception.
2015-11-25 22:09:06 -04:00
Miklos Vajna
2bb596a256 loolwsd: coding style
If README says "spaces, not tabs" and "braces go on separate lines",
then be consistent about it before it gets normal to not respect those
rules.
2015-11-24 09:43:17 +01:00
Miklos Vajna
195aa3a953 loolwsd: use png_set_write_user_transform_fn() only for BGRA pixel format 2015-11-24 09:19:17 +01:00
Henry Castro
238e674ba9 loolwsd: avoid double socket shutdown
This cause abnormal socket close
2015-11-19 07:22:59 -04:00
Miklos Vajna
b066c91c8f loolwsd: factor out LOOLSession::parseDocOptions() from *ProcessSession 2015-11-19 10:30:45 +01:00
Miklos Vajna
57199a36cd loolwsd: route rendering options to initializeForRendering() 2015-11-19 10:10:18 +01:00
Miklos Vajna
93c0d29c5c loolwsd: accept load options in ChildProcessSession::loadDocument() 2015-11-19 10:10:17 +01:00
Miklos Vajna
e644fd2e1c loolwsd: -Werror,-Wunused-value
Found by clang.
2015-11-19 08:32:14 +01: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
fe1aacd6d0 loolwsd: update the bundled headers 2015-11-18 17:00:34 +01:00
Andrzej Hunt
0ab5560758 loolwsd: re-add erronously remove break
Seems to have been removed accidentally in:
c1efc7c012
2015-11-13 11:24:44 +01:00
Mihai Varga
c1efc7c012 Formula bar for calc 2015-11-12 16:55:56 +02:00
Mihai Varga
242870cb9f use setClientZoom() before postMouse/Key event 2015-11-12 16:54:45 +02:00
Andrzej Hunt
74edae8703 loolwsd: support LOK_CALLBACK_MOUSE_POINTER 2015-11-10 13:46:41 +01:00
Jan Holesovsky
0f03c3b925 loolwsd: Don't assert on 'canceltiles'.
Fixes a regression from 6a1477d8a9 where now the
'canceltiles' command reaches the ChildProcessSession::handleInput().

This is good in general - in case'd need to add some special handling even to
the handler; but so far all we need happens on the message queue level.
2015-11-09 22:20:26 +01:00
Jan Holesovsky
2dcfb61a69 loolwsd: Don't crash due to an uncaught std::out_of_range exception.
Let's invalidate everything in such a case.
2015-11-09 20:21:13 +01:00
Jan Holesovsky
c44e0a6266 loolwsd: Log the tile rendering times. 2015-11-06 18:27:32 +01:00
Andrzej Hunt
ab5b41b740 loolwsd: use length here too 2015-11-05 12:52:06 +01:00
Andrzej Hunt
09e823e750 loolwsd: tdf#94605 handle LOK_CALLBACK_CELL_CURSOR 2015-11-05 12:52:05 +01:00
Jan Holesovsky
c6743b4d64 loolwsd: Remove the potential leftover document before attempting to link.
Otherwise we create a copy, and at the moment, the copy is not copied back out
of the chroot jail; we should bind that to the .uno:Save callback...
2015-11-05 12:17:21 +01:00
Jan Holesovsky
db38aaff1c loolwsd: Handle LOK_CALLBACK_UNO_COMMAND_RESULT.
Also update according to the API change, and trigger the notification when
calling .uno:Save.
2015-11-03 19:29:50 +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
847c65cb1c LOOLSession: handle file:// in the ToPrisoner saveas input handler 2015-10-20 14:45:00 +02:00
Miklos Vajna
4feb29d1df LOOLSession: inform to-client session about completed save-as 2015-10-20 14:03:39 +02:00
Miklos Vajna
f0ba09f3dd LOOLSession: check for 0 _ws 2015-10-19 16:03:55 +02:00
Mihai Varga
d7ceedac54 drop 'part' from downloadas protocol as it is no longer needed 2015-10-16 19:35:31 +03:00
Miklos Vajna
fed0cbc77c loolwsd: -Werror=unused-parameter 2015-10-16 17:45:03 +02:00
Mihai Varga
84b7b128a0 loleaflet: fullscreen slideshow
We request svg exports for each slide which we then display in fulscreen
2015-10-16 14:07:45 +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
Miklos Vajna
677de915ff loolwsd: remove redundant LOK_CALLBACK_SEARCH_RESULT_COUNT handling 2015-10-13 14:54:59 +02: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
Mihai Varga
d8fa9d708b handle LOK_CALLBACK_SEARCH_RESULT_SELECTION callback 2015-10-06 18:05:44 +03:00
Mihai Varga
886cdc80df search result count callback handler 2015-10-05 16:44:40 +03:00
Mihai Varga
14dca89150 We now send the mouse button that has been pressed and also they key
modifiers for actions such as ctrl+click or shift+click
2015-10-05 15:04:19 +03:00
Mihai Varga
a0e74cb5c4 loolwsd: update page sizes when the doc size changes 2015-09-30 17:22:00 +03:00
Mihai Varga
34401c94f6 loolwsd: switch to editing dir when invalidating the cursor 2015-09-30 17:17:03 +03:00
Miklos Vajna
80ec8a5b4f loolwsd: parse the partpagerectangles command and cache the values 2015-09-29 12:51:19 +02:00
Mihai Varga
d1ecdbc3df loolwsd: parse the commandvalues command and cache the values
The values are chaced in the file named
"cmdValues" + unoCmd + ".txt"
2015-09-09 20:23:49 +03:00
Henry Castro
0c6c2c8da2 loolwsd: revert update status when switching parts 2015-08-28 01:28:14 -04:00
Henry Castro
b32b407714 loolwsd: add an optional parameter to load url= ...
load part=X url="http" is required to re-establish the connection
2015-08-27 00:18:44 -04:00
Henry Castro
90f790d7ad loolwsd: update status when switching parts 2015-08-27 00:07:11 -04: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
Jan Holesovsky
44c3e01707 Fix typo in error. 2015-08-11 18:39:18 +02:00
Jan Holesovsky
2e6bb94395 More consistent error report. 2015-08-11 18:31:50 +02: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
Henry Castro
ee928f9af1 loolwsd: create lokit process id logs
Also, when used with --test option, create lokit PID log
so it is attached to the debugger.

gdb loolwsd $(cat /tmp/lokit.pid)
2015-08-05 20:20:05 -04:00
Henry Castro
1c0153d5e0 loolwsd: ensure one child when debugging
when used with --test option:
./loolwsd --test --systemplate=${SYSTEMPLATE} --lotemplate=${MASTER}/instdir
--childroot=${ROOTFORJAILS}

ensure that one child is created and attach to it easily to debug lokit
messages
2015-08-05 20:05:30 -04:00
Henry Castro
0ec12fe11e loolwsd: fix child fork when debugging one child 2015-08-05 18:19:51 -04:00
Jan Holesovsky
527821597f Make the timestamps work also for non-file:// URLs. 2015-08-04 20:39:33 +02:00
Henry Castro
85b0474deb loolwsd: remove time stamp query parameter
The original URI request with query parameters is processed by loKit.
2015-08-03 21:33:47 -04:00
Mihai Varga
6812c6aa0b goToPage API
in loleaflet, this is achived by invalidating the cursor and centering
the viewing area around it
2015-08-03 19:07:02 +03:00
Mihai Varga
992f19e6e8 loolwsd: handle parts in Writer
In Writer a part is a page and we only notify the client about the
current page in which the cursor is. Internally (invalidation and
caching) we work with a single part (0)
2015-08-03 17:29:23 +03:00
Mihai Varga
4ae546d7bd loolwsd: don't move editing tiles to persistent on saveAs 2015-07-29 16:58:43 +03:00
Mihai Varga
a6091f9f6b loolwsd: don't decode the url in the saveAs command 2015-07-29 11:39:35 +03:00
Henry Castro
ec094f1601 loolwsd: remove _pendingPreSpawnedChildren.
_pendingPreSpawnedChildren is no longer need it, because
fork() is used.
Also adjusted time sleep to 1 second.
2015-07-24 15:17:46 -04:00
Mihai Varga
e29d7c8468 loolwsd: save the whole status not only the fst line 2015-07-22 15:09:14 +03:00
Mihai Varga
b9884a470a loolwsd: be aware of the client's current part
And set lok's part to match the client's when they start editing or
selecting
2015-07-21 16:56:02 +03:00
Mihai Varga
c9fff5d8e3 loolwsd: updated tileCache::invalidateTiles 2015-07-21 14:53:53 +03:00
Mihai Varga
47790d9d5d loolwsd: use the new invalidate x y widht height command 2015-07-21 11:08:36 +03:00
Mihai Varga
19d6dec3f7 loolwsd: log timestamp in microseconds
Also, separate messages by comma so we can parse them easily
2015-07-20 12:54:08 +03:00
Henry Castro
404b5edbc9 loolwsd: FileTransferHandler no longer need it. 2015-07-17 16:55:49 -04:00
Henry Castro
99ca81a944 loolwsd: move server socket to parent process 2015-07-17 14:04:40 -04:00
Mihai Varga
5085fd4e0c loolwsd: move tiles to persistent folder on save 2015-07-16 12:51:07 +03: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
97191d985b loolwsd: allow an extra paramater to the tile command (ID) 2015-07-14 19:46:04 +03:00
Henry Castro
bb3611399b loolwsd: Use fork but no execve 2015-07-13 10:13:06 -04:00
Mihai Varga
6d2d8361b6 loolwsd: the third argument in postUnoCommand must be null not space 2015-07-08 09:09:58 +03:00
Jan Holesovsky
767d6a0a32 Create /dev/*random in the chroot so that ssl works.
Also add the missing library to the systemplate.
2015-07-06 19:35:50 +02:00
Henry Castro
e50e302839 loolwsd: Handle file URI schema
In the file:// case, if it is on linux, hard link function is used
and copy only if hard link fails.
2015-07-04 20:46:13 -04:00
Henry Castro
d788fa92e9 loolwsd: let libreoffice handle http protocol 2015-07-03 10:04:24 -04:00
Tor Lillqvist
f4da368a52 Add a FIXME, found by looking, no time to investigate 2015-07-02 16:26:09 +03:00
Jan Holesovsky
4071022305 The payload format has changed, swap the parameters accondingly. 2015-06-25 17:03:18 +02:00
Jan Holesovsky
7c48ea1fe3 Change the tiles cache to 2-level cache.
Now we have 2 caching directories: 'persistent', and 'editing'.

The Persistent cache always represents the document as it is saved, the
Editing one caches the current edits.  The Editing state is copied to
Persistent on save.  The Editing state is destroyed on reload.
2015-06-24 22:07:58 +02:00
Mihai Varga
e8007ea405 Server getTextSelection implementation 2015-06-24 18:08:15 +03:00
Tor Lillqvist
f7a769ef28 Avoid assertion when the --lotemplate parameter ends with a slash 2015-06-17 16:52:54 +03:00
Tor Lillqvist
6804750463 Don't bother with storing a ref to Application::instance() in a variable in some places 2015-06-09 18:30:21 +03:00
Tor Lillqvist
d3f4ddd355 Use a queue also in the child processes 2015-06-09 18:30:12 +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
a7f2e5aa29 The buffer parameter to handleInput() can be const 2015-06-08 17:56:10 +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
1b85e8eaaa Be more consistent in using 'using' 2015-05-29 08:49:49 +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
f6a00edbee Use shared_ptr to the WebSockets for increased robustness
Why did I wait so long to do this? This is obviously the right thing to do, I
hope, and has a very significant impact on the robustness of the server...
2015-05-28 16:46:37 +03:00
Tor Lillqvist
d0dbc5e1dd Send a nextmessage: message also preceding a tile: message from the cache 2015-05-28 16:46:37 +03:00
Tor Lillqvist
09b261d57b Handle LOK_CALLBACK_DOCUMENT_SIZE_CHANGED even better
Just call the getStatus() function directly in the child process, which will
always cause a complete status: message to be sent to the client. No
documentsizechanged: messages now sent to the client at all.
2015-05-28 16:46:37 +03:00
Tor Lillqvist
13645eb769 There should be whitespace after the message keyword and colon 2015-05-28 12:59:11 +03:00
Tor Lillqvist
cedee8f1a9 Log the input to MasterProcessSession::handleInput() earlier 2015-05-28 12:58:08 +03:00
Tor Lillqvist
0092414470 Handle LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callbacks more cleverly
When a child process sends a documentsizechanged: message to the parent, to be
forwarded to the client, parse it and update a cached status of the doucment,
if available, and send an updated status: message to the client instead.

Note that clients should not rely on getting only status: messages and never
documentsizechanged: messages, though; the cache might be cleaned at any time
even while the server is running. If there is no cached status of the document
to update and re-use, we have to forward the documentsizechanged: message as
such to the client.
2015-05-28 12:53:14 +03:00
Tor Lillqvist
84819b6f0c Improve error handling 2015-05-27 21:44:39 +03:00