Commit graph

4189 commits

Author SHA1 Message Date
Tor Lillqvist
4d717182ad Look for setcap during configury 2015-04-23 16:00:48 +03:00
Jan Holesovsky
bf929d5618 Add libcap-progs to the README as dependency. 2015-04-23 14:54:14 +02:00
Tor Lillqvist
ae500514f5 Forgot to actually have the --test switch in the example of its use 2015-04-23 15:51:10 +03:00
Tor Lillqvist
a181692255 Simplify
Just use find ... -type f instead of a for loop.

One note: I wonder how text rendering by the LO code in the child process
works even if we haven't copied any actual fonts into the sys template (and
thus chroot jail)? Is FreeType (or whatever it) already present in the
process, and font files open, even before the chroot? Weird.
2015-04-23 15:24:20 +03:00
Tor Lillqvist
d970d327b9 Don't exit if cp fails
It might be that for instance there is no /lib64/ld-*, as on a 32-bit system.
2015-04-23 15:18:22 +03:00
Tor Lillqvist
b8f2ce741e Fix thinko 2015-04-23 14:44:41 +03:00
Tor Lillqvist
b49d4d8885 Use shared_ptr and weak_ptr in attempt to make the pointer dance more robust
It was obviously very wrong to use both a unique_ptr to the
MasterProcessSession in WebSocketRequestHandler::handleRequest(), and then a
bare pointers to the peer object in the MasterProcessSession object. We got
crashes here and there related to the destructors.

Let's see if we can manage without mutexes.
2015-04-22 21:50:17 +03:00
Tor Lillqvist
eade187ebb Bin pointless logging
We logged effectively the same information a few lines earlier.
2015-04-22 21:50:04 +03:00
Tor Lillqvist
59bd08299c _childId is used only in MasterProcessSession 2015-04-22 21:49:53 +03:00
Tor Lillqvist
08f53df08a _childIdToChildSession[childId] is not used 2015-04-22 21:49:37 +03:00
Tor Lillqvist
e83559795d Mention that sudo is used 2015-04-22 21:49:23 +03:00
Tor Lillqvist
8534aebf8e Only the MasterProcessSession class uses a tile cache 2015-04-22 21:49:12 +03:00
Tor Lillqvist
d94b494c0c Check if the peer MasterProcessSession has a tile cache yet 2015-04-22 21:48:48 +03:00
Tor Lillqvist
54d106f47b Factor out WebSocket::shutdown() ignoring IOException 2015-04-22 21:48:42 +03:00
Tor Lillqvist
6b7dcdb544 Typo 2015-04-22 21:48:35 +03:00
Tor Lillqvist
520236fb7e Updates 2015-04-22 21:48:27 +03:00
Tor Lillqvist
a0292468da Catch (and ignore) Poco::IOException in a couple of places
There probably are more places where I should catch those and act
appropriately. At least in these places, where the websocket connection is
already closed, or being closed, anyway, the right thing to do is just to
ignore exceptions, which are generated from attempts to write to an already
closed Poco WebSocket, for instance.
2015-04-22 21:48:14 +03:00
Tor Lillqvist
fcea475bb5 Use separate classes derived from LOOLSession for parent and child processes
Work in progress. Does not work properly yet.
2015-04-22 21:48:04 +03:00
Tor Lillqvist
fda13c6c74 Tweak temporary timing parameters a bit while hacking 2015-04-22 21:47:53 +03:00
Tor Lillqvist
84eff99fde Add --help option 2015-04-22 21:47:38 +03:00
Tor Lillqvist
faec3cd961 We indeed don't need the signalfd stuff, I hope
As such it worked, but if we can manage with simpler code, no need to use it.
2015-04-22 21:47:20 +03:00
Tor Lillqvist
a63f797fff Call shutdown on the peer's websocket when the session to the client dies
Also, seems that calling LOKitDocument::destroy() (in the child process's
LOOLSession dtor) causes crashes, avoid that. The can be little need for any
cleanup as the process is about to exit anyway, and the user profile is a
temporary one that will be binned.
2015-04-22 21:47:13 +03:00
Tor Lillqvist
02f12402bf This was what I meant
But actually I wonder why I thought I would need signalfd at all; wouldn't it
be enough to just loop in the undertaker thread, calling waitpid(), as long as
there are child processes? I'll try after this commit.

(Besides, I now notice that when I client disconnects, we don't close the
websocket to the child process, so it never goes away. Will fix that.)
2015-04-22 21:46:56 +03:00
Tor Lillqvist
59e4d4d25d This is done 2015-04-22 21:46:50 +03:00
Tor Lillqvist
39b6258aa9 Clean up the jail after the prisoner has died 2015-04-22 21:46:33 +03:00
Tor Lillqvist
291710cc1c Typo 2015-04-22 21:46:23 +03:00
Tor Lillqvist
af3545b897 No need for the SLEEPFORDEBUGGER thing any more
As the child processes are pre-spawned and just hang around waiting, there is
ample time to attach one in a debugger in a controlled debugging scenario
anyway.
2015-04-22 21:46:04 +03:00
Tor Lillqvist
27a680457e Pre-spawn a new child when we take one into use 2015-04-22 21:45:57 +03:00
Tor Lillqvist
1b32383875 Improve help messages 2015-04-22 21:45:47 +03:00
Tor Lillqvist
b760359bda Terminology change: s/fork/spawn
We aren't doing any fork-but-not-exec trick anyway, just a straightforward
start of a child process.
2015-04-22 21:45:31 +03:00
Tor Lillqvist
a2e2102ad1 Call dispatchChild() only if needed 2015-04-22 21:45:22 +03:00
Tor Lillqvist
c33d3a3aae Add a couple of items 2015-04-22 21:45:06 +03:00
Tor Lillqvist
acbad93ac7 Update README 2015-04-22 21:44:53 +03:00
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
Mihai Varga
497a50c76d Tiles are added again in batch
This gives us smoother and faster tile loading
and a tile is requested just once
2015-04-22 20:49:20 +03:00
Mihai Varga
d0f77df767 Removed image link 2015-04-22 20:15:42 +03:00
Mihai Varga
caf1773e54 The map no longer moves when zooming == smoother zooming
The zoomed tiles now perfectly match the new ones that are about
to be received from the server.
The zooming factor is again exponentail (1.2) instead of linear.
TODO: when the window size modifies the gets paned out of the bounds
2015-04-22 17:49:06 +03:00
Jan Holesovsky
0214f331e7 test document: Make it clear the white area is deliberate. 2015-04-22 08:41:09 +02:00
Jan Holesovsky
ff81959c7b Updated the loleaflet README. 2015-04-21 16:03:48 +02:00
Jan Holesovsky
44553f82c0 loolwsd: Don't even start when the cache dir is not available. 2015-04-21 15:51:28 +02:00