Commit graph

2036 commits

Author SHA1 Message Date
Tor Lillqvist
d513536cfe Must seed the RNG explicitly
Otherwise it uses a timestamp with one-second granularity as seed, and thus
most of the child processes pre-spawned at start will use the same seed, which
causes breakage.
2015-04-22 21:44:42 +03:00
Tor Lillqvist
3abb6d0307 Now the chroot etc re-work is getting closer to working
Works now for the trivial 'connect' test program. Still need to add
pre-spawning of a new child process as soon as an existing one from the pool
has been taking into use. And need to test with the actual JS client.
2015-04-22 21:44:17 +03:00
Tor Lillqvist
8800dd46e1 Fix typo and bin leftover FOO debug output 2015-04-22 21:43:55 +03:00
Tor Lillqvist
652580a761 Another intermediate commit, code still in a non-working state 2015-04-22 21:43:44 +03:00
Tor Lillqvist
a4480e2a8e Add "sleep <n>" pseudo-request 2015-04-22 21:43:32 +03:00
Tor Lillqvist
0a60ea9dcc Bump Emacs fill-column to 100
The default 70 is so last century.
2015-04-22 21:43:11 +03:00
Tor Lillqvist
7f50f06bf4 Add some comments 2015-04-22 21:42:47 +03:00
Tor Lillqvist
4c7b5a39e3 master LibreOffice no longer does the "restart required" thing when used from LOKit 2015-04-22 21:42:28 +03:00
Tor Lillqvist
f9d93ea57c Work in progress: "pre-forking", chroot, etc. Non-working state
Lots of changes to the server code, LOOLWSD and LOOLSession mainly. This is an
intermediate commit.
2015-04-22 21:42:17 +03:00
Tor Lillqvist
defbb6a809 Remove write of superfluous empty line 2015-04-22 21:42:09 +03:00
Tor Lillqvist
6950f7d841 Adapt to changed LibreOfficeKitDocument::postUnoCommand() API 2015-04-22 21:41:49 +03:00
Jan Holesovsky
44553f82c0 loolwsd: Don't even start when the cache dir is not available. 2015-04-21 15:51:28 +02:00
Jan Holesovsky
4715df9587 Reformatted loolwsd README. 2015-04-21 12:48:17 +02:00
Tor Lillqvist
c72f197e71 Handle LOK_CALLBACK_STATE_CHANGED 2015-04-14 14:51:36 +03:00
Tor Lillqvist
32ec786180 Update 2015-04-14 12:54:41 +03:00
Mihai Varga
7d66119532 Command type handler for selectText, selectGraphic, key, mouse 2015-04-13 20:42:44 +03:00
Tor Lillqvist
803ace146b Some compilers seem very picky about ignoring return values 2015-04-10 12:51:42 +03:00
Tor Lillqvist
e6ddb042cd WaE: ignoring return value 2015-04-10 12:40:13 +03:00
Tor Lillqvist
bf709edf08 Adapt for older libpng 2015-04-10 12:39:12 +03:00
Tor Lillqvist
aedea4229f Call LibreOfficeKitDocument::initializeForRendering() 2015-04-10 12:21:28 +03:00
Tor Lillqvist
06d98ec0b7 This is C++ 2015-04-10 01:25:48 +03:00
Michael Meeks
abec49b4bc memcpy in string.h 2015-04-09 14:38:20 +01:00
Tor Lillqvist
ceae121b16 Can remove this, too 2015-03-28 13:58:15 +02:00
Tor Lillqvist
6d9f298ee9 Prefer C++ std headers 2015-03-28 13:57:10 +02:00
Tor Lillqvist
41f41f7af5 Have lokitclient display tiles using ImageMagick's 'display' if available
Refactor the PNG encoding of a pixmap out to Util.
2015-03-28 13:57:03 +02:00
Tor Lillqvist
c5a8104c4f Add a new minimal non-GUI LOKit test program
For easier debugging of the LO code invoked through LibreOfficeKit, with is no
GUI stuff complicating debugging.
2015-03-28 13:56:03 +02:00
Tor Lillqvist
56f3678b36 Add a separate include file for some helper functions 2015-03-28 13:22:15 +02:00
Tor Lillqvist
7cb0449b8e More hacking 2015-03-27 18:25:06 +02:00
Tor Lillqvist
6e36de4534 For debugging, sleep a bit before initialising LOKit if requested
Set the SLEEPFORDEBUGGER environment variable to the number of seconds a child
process should sleep before calling lok_init(), so that you have time to
attach the process in a debugger.
2015-03-27 18:23:27 +02:00
Tor Lillqvist
cec37456ef Set no receive timeout 2015-03-27 16:53:51 +02:00
Tor Lillqvist
58f00ca165 Remove the dead "migratory socket" stuff 2015-03-27 16:26:33 +02:00
Tor Lillqvist
bb162a6ba7 Add trivial test program for sending commands to the LOOL server 2015-03-27 16:23:20 +02:00
Tor Lillqvist
022592e65c Do remove also the first level of subdirectories 2015-03-27 14:52:30 +02:00
Tor Lillqvist
70f175c9a7 Make Util a namespace instead of a class with just static member functions
This is not Java or C#.
2015-03-26 17:07:52 +02:00
Tor Lillqvist
422dfd1767 Start on load testing
Add a new program, loadtest, that runs a requested number of client sessions
in parallel to a loolwsd server. A client session loads one of a list of test
documents, and does some operations on it.

Move the getTokenInteger() and getTokenString() functions out from LOOLSession
into a new namespace LOOLProtocol, as they are neeeded also in the loadtest
program.

Add, also in LOOLProtocol, functions to parse some of the messages from the
server. (In general that is done in client JavaScript code, of course; only
for testing purposes needed in C++ code.)
2015-03-26 17:04:08 +02:00
Tor Lillqvist
425cae6b29 No need for <unistd.h> as far as I see 2015-03-26 17:04:08 +02:00
Tor Lillqvist
eb695513de Use const reference parameter 2015-03-26 17:04:08 +02:00
Tor Lillqvist
3cb43839ea Cosmetics 2015-03-26 17:04:08 +02:00
Tor Lillqvist
df95739819 Make DEFAULT_PORT_NUMBER public 2015-03-26 17:04:08 +02:00
Tor Lillqvist
b7c08d373e WaE: private field '_helpRequested' is not used 2015-03-26 14:37:38 +02:00
Tor Lillqvist
e8aa011af4 Undo accidental indentation 2015-03-25 15:48:28 +02:00
Tor Lillqvist
5df0766dad Return an error if the documentLoad() fails 2015-03-25 15:48:20 +02:00
Tor Lillqvist
867a66aa62 A bit more info 2015-03-24 19:04:16 +02:00
Tor Lillqvist
cae997c184 Check 'tile' parameter validity 2015-03-24 18:59:23 +02:00
Tor Lillqvist
97fbe8e857 Add 'saveas' 2015-03-23 22:14:11 +02:00
Tor Lillqvist
4974ea15b1 Bin leftover debug output 2015-03-20 15:53:00 +02:00
Tor Lillqvist
1e734c2c0e Reduce copypasta
Handle the start of a child process when needed centrally, not in each command
handler.

Also, handle unrecognized commands always already in the parent
process. (Command syntax checks still done in child process, though.)
2015-03-20 15:53:00 +02:00
Tor Lillqvist
e05092ece2 Obviously need to handle input events etc in the child process
I need to re-factor this stuff, too much copypasta.
2015-03-20 15:52:43 +02:00
Tor Lillqvist
a3897bd906 paintTile does not take a row stride parameter any more 2015-03-20 13:18:01 +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
27ea953a3b Update 2015-03-18 15:40:50 +02:00
Tor Lillqvist
e8ea0f0d2e Use separate child processes for LibreOfficeKit
For now, each LOOL client has a separate child process (or none at all, if it
has accessed only information found in the cache). This will obviously have to
chnage to handle collaboration. Etc.

The parent process talks the same Websocket protocol with the child
processes. When there is a child process for a client, traffic from the client
is forwarded as such to the child process and vice versa.
2015-03-18 15:38:01 +02:00
Tor Lillqvist
d43e148ff4 Updates 2015-03-18 01:57:37 +02:00
Tor Lillqvist
ff8ceac560 Caller expects empty string as failure, not nullptr
Fixes crash.
2015-03-16 21:08:14 +02:00
Tor Lillqvist
bd35c1aeb8 Intermediate commit, will not actually do it like this
My comment in 1b0230e4df was misleading, even if
doing this for Unix only, if we had done it as I was first thinking, we would
have needed to pass sockets between processes. But we won't, we will instead
keep all the connections to the clients in the same master process, and pass
on the WebSocketg protocol as such to child processes. That way the child
processes can go away when idle, or crash, without the connections
breaking. Or something.
2015-03-16 19:19:30 +02:00
Tor Lillqvist
50e36c7ca5 Sort 'using' statements 2015-03-16 19:19:30 +02:00
Tor Lillqvist
1b0230e4df Intermediate commit of start on transporting sockets to child process
Will be needed if we want loolwsd to run on Windows. Then we will have one
process receiving the connections from WebSocket clients and sending the
accepted connection sockets to child processes thatr might be already running,
either because they have been "pre-forked", or because of a collaboration
scenario where new clients join a session working on a document.

But initially we will write this as if for Unix only, so development of this
migratory socket stuff is paused for now. (And it isn't even clear whether the
API design so far is a good idea and elegantly implementable.)
2015-03-16 12:30:56 +02:00
Tor Lillqvist
ea01aa2002 Cache also document status 2015-03-13 14:17:51 +02:00
Tor Lillqvist
44c2ef32f5 Small fix to error handling 2015-03-13 13:59:51 +02:00
Tor Lillqvist
1a5e1b0fa4 Incorporate LOK_CALLBACK_* generically 2015-03-13 11:30:45 +02:00
Tor Lillqvist
68fec97752 More LibreOfficeKitCallbackType values have been added 2015-03-13 11:30:23 +02:00
Tor Lillqvist
0bfd6ee02b Use -Wall -Werror 2015-03-13 11:29:55 +02:00
Tor Lillqvist
94254ec9e4 Missing break 2015-03-13 11:25:00 +02:00
Tor Lillqvist
ad3fda27af Further hacking on tile cache 2015-03-13 01:34:42 +02:00
Tor Lillqvist
79a4eff2cf Catch and log exceptions in the TestOutput thread 2015-03-12 18:58:51 +02:00
Tor Lillqvist
076733251f No need for the DUMPPNG debugging feature any more 2015-03-12 18:58:29 +02:00
Tor Lillqvist
08583f8ebe Add first cut at caching of tiles 2015-03-12 17:26:35 +02:00
Tor Lillqvist
38d4fda3f6 Expand shell variables in LOOLWSD_CACHEDIR 2015-03-12 17:26:35 +02:00
Tor Lillqvist
02815cb03e Adapt for LOOLWSD.cpp renameing here, too... 2015-03-12 14:15:31 +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
5c8c36b555 Simplify 2015-03-09 17:45:51 +02:00
Tor Lillqvist
163c08e62e Rename the LOOLWS class to LOOLWSD 2015-03-09 17:45:51 +02:00
Tor Lillqvist
7e363f6058 Add a few more fields for future 2015-03-09 17:45:51 +02:00
Tor Lillqvist
1fe46cdf8d Just use autoheader (or autoreconf), no need for config.h.in in git 2015-03-09 17:45:51 +02:00
Tor Lillqvist
c53f2ec458 Add LOOLWDS_CACHEDIR 2015-03-09 17:45:51 +02:00
Tor Lillqvist
a9af4ab657 Add missing comma 2015-03-09 14:11:39 +02:00
Tor Lillqvist
4f54efe815 Portabillity improvements 2015-03-09 13:40:39 +02:00
Tor Lillqvist
23702c6d84 We have a "proper" autofooized Unix build now 2015-03-09 11:30:56 +02:00
Tor Lillqvist
6b121b2fa6 Autofooize 2015-03-09 11:19:00 +02:00
Tor Lillqvist
ce438007b2 Rename LOOLConnectionServer to LOOLSession
That is hopefully a better name.
2015-03-09 10:02:47 +02:00
Tor Lillqvist
3f593403c3 Pass callbacks from LOKit on to the client, and some other changes
Use a larger buffer in the TestOutput class to handle a bit larger tiles. Too
bad that the current Poco::WebSocket::receiveFrame() takes a fixed size
buffer. (I will submit a patch to Poco for a receiveFrame() that takes a
dynamically resizable buffer and handles whatever size frame the other side
sends.)
2015-03-07 13:28:11 +02:00
Tor Lillqvist
a526b2faa2 Add the callbacks 2015-03-05 15:57:03 +02:00
Tor Lillqvist
049ea02870 Don't write more data than there is 2015-03-05 12:26:22 +02:00
Tor Lillqvist
798edd79ae Delete unused files 2015-03-05 01:57:13 +02:00
Tor Lillqvist
0798c3d1ea Initial commit of loolwsd
See loolwsd/README for some notes.
2015-03-05 01:25:49 +02:00