Commit graph

52 commits

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