Commit graph

18001 commits

Author SHA1 Message Date
Tor Lillqvist
1e17966bb9 Drop super-user privileges if using sudo by necessity when debugging
It doesn't work to debug a program that has file capabilities set, it seems,
so to debug the loolwsd master process, one in practice needs to run sudo gdb
on it. But it is not necessarily a good idea to run all of the code as
root. When configured for debugging (--enable-debug), reset real and effective
uid to a non-root one, either one given with an --uid option (typically that
of the developer), or "nobody".
2015-05-13 17:52:20 +03:00
Tor Lillqvist
efd750d2ee Add ENABLE_DEBUG to the config.h 2015-05-13 17:52:20 +03:00
Tor Lillqvist
60801cd014 Be less verbose: don't log messages received 2015-05-13 17:52:20 +03:00
Tor Lillqvist
72304b1593 Send the part number, too (always 0 for now) 2015-05-13 17:52:20 +03:00
Tor Lillqvist
5ea8efe602 Loop through tiles in x direction, too 2015-05-13 17:52:20 +03:00
Mihai Varga
1f073e6219 Fixed unused result compile error 2015-05-13 13:00:33 +03:00
Mihai Varga
906e9e28fc Search scrolls to result if it's out of the viewing area 2015-05-13 12:39:57 +03:00
Mihai Varga
5e4225c860 In fact, it is better not to prefix the url 2015-05-13 12:05:13 +03:00
Mihai Varga
04d2b531a1 Check if file:// is added in the url 2015-05-13 12:01:10 +03:00
Mihai Varga
0a7e20e851 Encode spaces in the URL 2015-05-13 11:54:12 +03:00
Mihai Varga
124de292d1 Updated the text selection handler
And also removed an unnecessary method
2015-05-13 11:17:34 +03:00
Mihai Varga
e4b1624d2b Updated the search bar to send the correct command to the server 2015-05-13 11:17:34 +03:00
Mihai Varga
bc23033537 Fixed tiwps->latlng and backwards conversion 2015-05-13 11:17:33 +03:00
Tor Lillqvist
b6c36e23f3 Improve error handling for documents that can't be opened
Catch IOException when trying to copy the document and send error message.
Otherwise, the exception will just propagate up to handleRequest() and the
connection will be silently closed. Closing the connection is fine as such, I
think, but we need to send an error message first.
2015-05-12 12:44:19 +03:00
Mihai Varga
d78642806a Removed URL tiles specific methods 2015-05-11 17:55:38 +03:00
Mihai Varga
47e301cc92 Parts command from the server is parsed but not yet interpreted 2015-05-11 17:05:03 +03:00
Mihai Varga
4c6d87231c Parts control for switching between parts 2015-05-11 17:05:03 +03:00
Mihai Varga
90b3b32bbc Renamed method to _parseServerCmd 2015-05-11 17:05:03 +03:00
Mihai Varga
13582c7f04 Fixed typo 2015-05-11 17:05:03 +03:00
Tor Lillqvist
c91d77c684 Check that the POCO version used is the one we want
Currently we require the current version, 1.6.0, and as soon as 1.6.1 is out,
I will start requiring that, because I want to use a feature I submitted to
it.

Surround most of configure.ac with AC_LANG_PUSH([C++]) while at it, as this is
all C++ code anyway.
2015-05-11 11:24:27 +03:00
Tor Lillqvist
6393cbfd7d Improve help for --port a bit
It must bit be the port number used for listening for the child processes
contacting the master process.
2015-05-08 21:30:32 +03:00
Tor Lillqvist
3e9c4d4bf3 Use a separate HTTPServer listening for child processes connnecting
Otherwise, if we use the same port number and same HTTPServer, if enough
clients try to contact us and, we won't be able to accept child processes
having been spawned.

Also add some temporary debugging output here and there to debug lifecycle
management issues.
2015-05-08 21:30:32 +03:00
Tor Lillqvist
5b1233bdb4 Be sure avoid global object dtors when exiting a child process
The LO ones have a tendency to crash anyway on Solar Mutex assertions (in a
build where assertions are active, obviously).
2015-05-08 21:30:32 +03:00
Tor Lillqvist
3a23186217 If we run out of pre-spawned children, spawn one more
Just a stopgap measure so far. Clearly will need some logic to get rid of too
many children if they are just hanging around with no clients incoming. Also,
we need some sanity check not to spawn an unlimited number of children.
2015-05-08 21:30:17 +03:00
Tor Lillqvist
aa40335328 Include also the childId in this (temporary) log output 2015-05-08 21:29:45 +03:00
Mihai Varga
febaaa1900 Mouse event handlers for selection 2015-05-08 15:24:47 +03:00
Mihai Varga
1858147801 Twips to latlng and reverse methods 2015-05-08 15:24:26 +03:00
Mihai Varga
affdbc6ff1 Added search command (from the server) handler 2015-05-08 13:58:13 +03:00
Mihai Varga
5dabc12660 Search bar buttons are updated based on the current search index 2015-05-08 13:56:28 +03:00
Mihai Varga
c622852514 Removed the Draw plugin interface
We don't actually need this plugin because the server
dictates how the selection will work.
Will remove the whole plugin when I'm sure this won't have other
applications
2015-05-08 11:44:37 +03:00
Mihai Varga
5bde4775f6 Added cancel search button + search bar sends propper events 2015-05-08 11:10:48 +03:00
Tor Lillqvist
e22e1da038 Must use thread-local storage for the variables used by the nftw callback
Otherwise two or more linkOrCopy() functions running simultaneously will lead
to a mess.

Actually nftw() is not guaranteed to be thread-safe, I think, so we should
really use something that is, like Poco's SimpleRecursiveDirectoryIterator.
2015-05-07 20:24:14 +03:00
Tor Lillqvist
c69fc09a1b Use just one RNG for the MasterProcessSession objects
It probably is not a good idea to keep depleting the entropy source needlessly
by having a separate RNG in the preSpawn(). Use just one shared RNG and
protect access to it with a mutex.
2015-05-07 20:24:06 +03:00
Tor Lillqvist
de52608a35 Drop setuid-root on Linux too, if we for some reason have it 2015-05-07 18:31:59 +03:00
Tor Lillqvist
caea0f9986 Try to make the server more stable when heavily loaded by connections
Use an explicit backlog parameter to the ServerSocket, and an explicit max number
of threads to use for the HTTPServer's thread pool.
2015-05-07 18:26:03 +03:00
Tor Lillqvist
0ca7f3129b Add code to wait for a child session to become available
Not sure it is completely correct. Lots of testing needed.
2015-05-07 16:29:36 +03:00
Tor Lillqvist
d3acdbb225 String::startsWith is Firefox-only it seems 2015-05-06 18:41:09 +03:00
Tor Lillqvist
5aec1fc2f8 Register for callbacks from the LibreOfficeKit object, too
They are used for statgus indicator callbacks while loading a document. (This
is a fresh feature in LO master.)
2015-05-06 17:58:00 +03:00
Tor Lillqvist
cb65bbbc36 Include <string> for completeness
Sure, it seems to get included indirectly already, but we can't be sure that
holds for all compilers.
2015-05-06 17:58:00 +03:00
Mihai Varga
15a889db91 Search bar implemented as a leaflet Control
It is not ready yet, buttons' functionality and the search
functionality is to be added
2015-05-06 12:39:03 +03:00
Mihai Varga
57a2663cb9 Search bar bax with prev and next buttons 2015-05-06 10:41:26 +03:00
Mihai Varga
1b5f9b1f22 Readme update that describes how to open a doc 2015-05-06 10:08:56 +03:00
Mihai Varga
bc5bee6751 Smoother scroll without intertia 2015-05-06 09:44:32 +03:00
Mihai Varga
b9351c6fed Forgot to replace evt.data with textMsg 2015-05-06 09:37:44 +03:00
Mihai Varga
6c6f8c29de Document file path and host are encoded in the url
Usage:
http://web-page?file_path=/PATH/TO/DOC&host=ws://localhost:9980
2015-05-06 09:35:22 +03:00
Tor Lillqvist
9bce431eea We have setcap only on Linux
Use setuid root otherwise. (But note that the portablity to other
Unixes is a work in progress, and for instance it is known that this
doesn't work on OS X yet.)
2015-05-04 21:00:02 +03:00
Tor Lillqvist
295e8305f9 Use the Linux capability API only on Linux 2015-05-04 21:00:02 +03:00
Tor Lillqvist
580c99d76c Add SIGPIPE which was missing by mistake, and make it compile on OS X 2015-05-04 20:54:46 +03:00
Tor Lillqvist
8a3dfa4936 The ld -rpath switch means a different thing on OS X 2015-05-04 20:52:05 +03:00
Tor Lillqvist
4ecc431159 Look for setcap and libcap only on Linux 2015-05-04 20:17:41 +03:00