Commit graph

104 commits

Author SHA1 Message Date
Miklos Vajna
cc18cc702f loolwsd: extraft filename from convert-to parameters 2015-10-19 16:03:55 +02:00
Mihai Varga
0ea00afb99 loolwsd: allow the specification of the mime type 2015-10-16 19:45:57 +03:00
Miklos Vajna
fed0cbc77c loolwsd: -Werror=unused-parameter 2015-10-16 17:45:03 +02:00
Miklos Vajna
9212c1c321 loolwsd: convert-to handler skeleton 2015-10-16 17:38:24 +02:00
Miklos Vajna
63bf9a1329 loolwsd: invert this condition, so it's possible to add other cases 2015-10-16 15:47:39 +02:00
Miklos Vajna
700b7d08b7 loolwsd: allow frame size of 200K
I got:

WebSocketException: Insufficient buffer for payload size 113579

So double the allocated size: that seems to help.
2015-10-16 15:24:19 +02:00
Tor Lillqvist
7e78f3f0c6 bugs.ccu#1248: If locale is C, set it to en_US.utf8 2015-10-13 20:05:42 +03:00
Mihai Varga
c4825f5492 loolwsd: allow cross origin requests 2015-10-12 20:33:29 +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
Henry Castro
8a10a16855 loolwsd: restore interactive testing 2015-09-11 16:31:43 -04:00
Mihai Varga
564572e561 loolwsd: also add /etc/host.conf in chroot 2015-09-08 13:03:14 +03:00
Mihai Varga
e17598e866 loolwsd: also copy /etc/nsswitch.conf 2015-09-08 11:31:49 +03:00
Mihai Varga
5396a83c26 loolwsd: copy /etc/hosts when running the server 2015-09-07 15:56:47 +03:00
Mihai Varga
515e6f7fea loolwsd: copy /etc/resolv.conf in the jail
Because sometimes the hostname is not resolved
2015-09-04 18:43:47 +03:00
Henry Castro
7aeca2f92b loolwsd: destroy LOKit when child finished 2015-08-08 08:20:16 -04:00
Henry Castro
54b1e1b612 loolwsd: set thread name to debug socket 2015-08-08 07:55:54 -04: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
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
Henry Castro
6dafcc753f loolwsd: process sleep for amount of time ...
specified by MAINTENANCE_INTERVAL
2015-07-24 14:10:24 -04:00
Mihai Varga
8f48dabf28 loolwsd: discard requests that are in the queue already 2015-07-21 11:08:36 +03:00
Henry Castro
de3d97d5a4 loolwsd: create PID log file.
The PID log file is used by external utilities
to report processes, threads, etc.
2015-07-19 16:49:11 -04:00
Henry Castro
66756a77a9 loolwsd: change named mutex to private static. 2015-07-18 12:35:16 -04:00
Henry Castro
161e5534ec loolwsd: mutex lock when loKit initialization. 2015-07-17 21:54:26 -04:00
Henry Castro
63a33b39f6 loolwsd: moved server socket to main function. 2015-07-17 17:55:57 -04: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
Henry Castro
061a2bfc3d loolwsd: rework child monitor status. 2015-07-16 18:05:28 -04:00
Henry Castro
fd5b676b2d loolwsd: set RTLD_NOW, all undefined symbols in
the library are resolved before dlopen() returns.
Also remove unnecessary commented code.
2015-07-15 20:57:39 -04:00
Henry Castro
3f3b9f7675 loolwsd: remove WSTOPSIG(status).
No child returns status process stop. This cause problems
when we attach one child to debug.
2015-07-15 09:15:12 -04:00
Mihai Varga
0d80d63cb4 loolwsd: don't cancel special tile requests that have an ID 2015-07-14 19:46:29 +03:00
Henry Castro
bb3611399b loolwsd: Use fork but no execve 2015-07-13 10:13:06 -04: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
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
ea2141ffe7 Take the tile cache directory as an option, too 2015-06-04 17:09:19 +03:00
Tor Lillqvist
bbf844f8da Fix copy/paste error in help message 2015-06-01 19:52:48 +03:00
Tor Lillqvist
1b85e8eaaa Be more consistent in using 'using' 2015-05-29 08:49:49 +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
73273eb027 Also let the nextmessage: from a child process be forwarded to the client
The loadtest program needs it as it, too, uses Poco, which currently does not
have an API to receive an arbitrarily large WebSocket message.
2015-05-28 16:46:37 +03:00
Tor Lillqvist
f7d001ed45 Bin the uid debug output 2015-05-22 17:43:45 +01:00
Tor Lillqvist
180f8fcba0 Pass the --uid option to the child too 2015-05-22 17:42:36 +01:00
Tor Lillqvist
73505aa550 On OS X libsofficeap.dylib is in Frameworks 2015-05-22 14:40:09 +01:00
Tor Lillqvist
9af39d189a Add some fairly hackish things to make this run better on OS X 2015-05-22 14:34:21 +01:00
Tor Lillqvist
8612aab7c4 Make this build on OS X
Note that I said build, not work.
2015-05-22 10:57:17 +01:00
Tor Lillqvist
bc49cccee2 Log the capabilities after dropping one 2015-05-19 13:54:12 +03:00
Tor Lillqvist
65ab397d34 We need CAP_FOWNER, too, on newer Linuxes to be able to hardlink the LO files
At least when not running as the owner of those files. Refactor the capability
dropping so that we can separately drop the CAP_FOWNER and CAP_SYS_CHROOT
capabilities. The child process never needs CAP_FOWNER and the parent process
never needs CAP_SYS_CHROOT.
2015-05-19 13:48:20 +03:00
Tor Lillqvist
e50f243897 Let's not over-complicate this 2015-05-19 07:52:42 +03:00