Commit graph

306 commits

Author SHA1 Message Date
Michael Meeks
5627c767ab Anonymization: don't log when it is disabled.
Also fix unexpected concatenation error in Poco::URI::encode generating
eg. authorid=localhost0 xauthorid=localhost0localhost0 in the output.

Change-Id: I560e47e31884eeb1c662f468436ed7541cfb082d
2019-03-15 11:27:38 +01:00
Tor Lillqvist
a1feac0c24 Fix -Werror=stringop-truncation: Make sure FatalGdbString is NUL-terminated
(Note that when I say 'NUL' I mean the ASCII character called NUL,
i.e. a zero byte. Not to be confused with 'NULL'.)

Why FatalGdbString has to be a C style fixed size char array I don't
know. Or wait, I do know. Because SPEED!!! And using C strings safely
is trivial.

Change-Id: Id28b00a6e3219cf6f015c4209732f33216f83b22
2019-03-06 11:48:33 +02:00
Michael Meeks
36e9d5b376 TileCache: re-factor API to work in terms of vectors, not file references.
Change-Id: Ia9d48773121ab965b79ddb16b55b5d3fdcd7fd5c
2019-02-14 21:46:39 +01:00
Michael Meeks
f98a7f0592 Improve unit test / SSL handling & detection.
Change-Id: I6bd3116ac94d3d2c61e2ec543cb17896834ef2df
2019-02-13 18:24:36 +01:00
Jan Holesovsky
7b48434d0d android: Better logname for the native part.
Change-Id: I25d091075def09b605d8fcd8cf4f956b6569f90d
2019-02-13 17:33:53 +01:00
Jan Holesovsky
7f0f6e5a36 android: Restart if anything goes wrong.
But sleep for a bit of time between the runs to avoid a busy loop.

Change-Id: I90a7bee052d82e8a0488e6a34fb1b6f43e6f6e64
2019-02-13 16:37:54 +01:00
Jan Holesovsky
73b93777f7 android: Implement logging to logcat.
Change-Id: I68d7861af019a24d9ecd80782cca38d09485345d
2019-02-13 16:08:01 +01:00
Jan Holesovsky
f76b36193d android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
2019-02-12 12:20:11 +01:00
Jan Holesovsky
df5565674e android: Fix minor build issues. 2019-02-12 10:50:40 +01:00
Jan Holesovsky
e60421e5d5 android: No execinfo.h on Android (yet). 2019-02-12 10:50:40 +01:00
Miklos Vajna
daa3384b53 UnitHTTPServerRequest: make members private
None of this was used by subclasses.

Change-Id: Iaaa3e726e9aabec581f2c0599f65d7513e0a0e07
2018-12-17 09:15:05 +01:00
Miklos Vajna
b1f06d1c0a FileUtil: make fs members private
Change-Id: I921118c42a20117725074169f6425e9ff87bc54b
2018-12-10 08:55:39 +01:00
Ashod Nakashian
33aff0ce61 wsd: utility to parse integer lists
A quite common logic that is best moved to a utility
and optimized for best performance.

Includes unit-tests.

Change-Id: Id63a388690c17355eb2fac529070c38e9b082fd0
2018-12-07 12:39:27 +01:00
Miklos Vajna
da8785ed50 Log::StaticNameHelper: make members private
Change-Id: I7c46dc6757b98867c4893ee019b3fd6d903020fc
2018-12-04 09:06:58 +01:00
Tomaž Vajngerl
73c8fa9d09 Extract Authorization out of Auth and put it into common
This is needed so we can use this inside ChildSession.

Change-Id: I88f2cc767412fd52dbb242938f0f9897d4277639
Reviewed-on: https://gerrit.libreoffice.org/63836
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-29 21:47:13 +01:00
Tor Lillqvist
235c9b8a60 Use getAbbreviatedMessage() for its intended purpose
Don't log a potentially very long message in its entirety.

Change-Id: I01fbf76465d99bbab117d1dcacc6c7239a1da518
2018-11-29 01:07:03 +02:00
Miklos Vajna
e167cd173b StreamLogger: make members private
Change-Id: Ie9ec09a9b7b8885bd97e62bd65df27cf1454c408
2018-11-19 09:06:10 +01:00
Miklos Vajna
d52cf35418 MessageQueueBase: make members private
Change-Id: I65360bc23475b25b2c626ea75186e8863fc74b8f
2018-11-16 09:06:17 +01:00
Miklos Vajna
0122ba2a6a CursorPosition: make members private 2018-11-15 09:07:38 +01:00
Miklos Vajna
63bf882f73 Rectangle: make members private 2018-11-14 09:07:54 +01:00
Miklos Vajna
cd08cbf385 Session: make members private 2018-11-13 09:04:19 +01:00
Michael Meeks
fa74404019 Add a time limit for badly behaved / huge document load / conversions.
Also improve debug printing of load times in dumpstate.

Change-Id: Ib3fd70dffb57588cd90bd928c4be9890cee8bc65
2018-11-08 01:27:40 +00:00
Tor Lillqvist
2d1c865dd5 Use std::memcpy() here for consistency
Change-Id: I295b1db38333935ccf6efc4c2232bc2db8e84dd5
2018-11-02 16:20:49 +02:00
Tor Lillqvist
224bdad365 Use faster PNG compression in mobile app
Also, log the average time taken for PNG compression of tiles.

Change-Id: I720f55dc44bd6729dce710e3b781a7239a8bf585
2018-11-01 02:32:56 +02:00
Miklos Vajna
22fac18fcd WebSocket: make members private
All of them were protected, but only _socket was used actually. Add a
protected setter/getter for that field.
2018-10-24 09:36:13 +02:00
Tamás Zolnai
0bb8b7c7a8 Add /hosting/capabilities endpoint to advertise online features
Add an entry to discovery.xml with the urlsrc where capabilities end
point can be found. Use json format to send back the feature list.

Change-Id: I390a53d956d53ca79e5a8090aead7f4131ec4ca0
2018-10-19 18:15:22 +02:00
Tor Lillqvist
b7a42bd9d1 Add a FIXME 2018-10-19 02:02:54 +03:00
Tor Lillqvist
351193e1b7 Don't bother logging the full pathname __FILE__ on iOS 2018-10-17 12:54:36 +03:00
Tor Lillqvist
5f01fbdf81 The iOS memrchr() replacement should of course be marked inline 2018-10-17 12:34:49 +03:00
Tor Lillqvist
0d8912ffe9 Test also looking for the last char 2018-10-17 11:55:19 +03:00
Tor Lillqvist
b90fafa54f Adapt to change in LOG_BODY_ parameters 2018-10-17 11:48:22 +03:00
Tor Lillqvist
ccc7d2133d "The memrchr() function is a GNU extension, available since glibc 2.1.91."
Thus it doesn't exist on iOS, so add a trivial implementation. Include
an (ifdeffed out) unit test for it.
2018-10-17 11:46:56 +03:00
Jan Holesovsky
9a8e4fc0e8 wsd: safer string splitting
Reviewed-on: https://gerrit.libreoffice.org/57644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 17d1fdda7a0c29df12c43b956418c83b59bfe0da)

Change-Id: I88b82a3754c4f5e280f00be8e27614c3fe49eff8
2018-10-16 20:12:23 -04:00
Ashod Nakashian
9bfe8b70e2 wsd: don't warn on missing json
Change-Id: I28086152fbf9fc82ddead1a2feb80f21ffdcd208
(cherry picked from commit 7b48be5a9dde4fcec01b8804559ffa4f9c19d53c)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b6333ada8d wsd: anonymization improvements and unittests
Also support anonymization of downloadas documents
and renaming of documents.

Reviewed-on: https://gerrit.libreoffice.org/57541
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 78248a542c9ca31bf9ad4cad9b55d78690384395)

Change-Id: I81a80e6290217659987d73f625e5f0fb81cb7ef2
2018-10-16 20:12:23 -04:00
Ashod Nakashian
00a44d6e81 wsd: flush logs before existing
This is important for when we abort with some explanation.
Often said explanation doesn't show up anywhere to be useful.

Also, issue fatal logs for abnormal exist and use SFL to log errno.

Reviewed-on: https://gerrit.libreoffice.org/57540
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ad7964393eadb68873b820e0a620fb40f1e1b06a)

Change-Id: Ic67064ef40ef6e93d26e5847ecd32bdd49c3cc8b
2018-10-16 20:12:23 -04:00
Ashod Nakashian
053161b3f5 wsd: move string utilities into Util
Reviewed-on: https://gerrit.libreoffice.org/57539
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fb2671c4145edd4d4e359f0dcf5cc84835487cd4)

Change-Id: Idc578dff4e8ee5e48c1b7780d3feb2d21c6a9b13
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b516891815 wsd: prevent anonymization to empty strings
Change-Id: Ib4f90db5d39e7bf2e2f0b6566b1927363e6afcec
Reviewed-on: https://gerrit.libreoffice.org/57377
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 84245aa61e89cda6a9075a7059b5a7d839389719)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
4587dde56f wsd: anonymize filename by using the WOPI file ID
Reviewed-on: https://gerrit.libreoffice.org/57254
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 5e3568ff1029da948f05d1c0e0c56c6d0706690e)

Change-Id: I869cae3846c8630b192246bc68cc90e70c50d1fd
2018-10-16 20:12:23 -04:00
Ashod Nakashian
6c18aa7e88 kit: anonymize usernames and filenames in Kit
Change-Id: Id7928136db71ded7bf6b1a5e8e387db7251f8a35
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f25575181c kit: parse anonymized tokens in doc options
Also optimize the parsing in general.

Change-Id: Id1f5b5c12e867c98e523d1e32397853d7d4a6ee4
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f12883bc07 wsd: add anonymization helpers
Change-Id: Ic479218ab1b6e580c288a984f35795e1d0d6e8ad
2018-10-16 20:12:23 -04:00
Ashod Nakashian
3158d4c31c wsd: always use signal-safe calls
The async-signal-safe functions to get thread-id
and thread-name, which cache the results, are
faster, cleaner, and signal-safe. No reason why
we shouldn't always use them.

Especially since it appears the logic was
inverted in Log::prefix, such that the signal
un-safe calls were made during signal-handling,
and the safe ones were called otherwise!

Instead of passing the signal-safe flag to
Log::prefix, we pass the buffer size, for
improved security.

Furthermore, reduce header dependencies
and reduce clutter.

Change-Id: I697689b2f0a290b6d8cce4babc3ac1e576141da6
2018-10-16 20:12:23 -04:00
Ashod Nakashian
63c3fce2c6 wsd: clang-format logging macros and pass logger explicitly
Change-Id: I37e7f4b5687b64b36e0985942627a4b84a8249eb
2018-10-16 20:12:23 -04:00
Ashod Nakashian
a7a03c3c5d wsd: send copied text to client upon .uno:Copy
Change-Id: I39181a0e29e00a0eae389fbab6ee253cf2f23f84
2018-10-16 20:12:23 -04:00
Tor Lillqvist
58db979291 Start on a gtk+-based workalike to the iOS app
The idea is that it would work sufficiently identically, so that even
people without a Mac and without an iOS device could participate in
development of the non-iOS-specific bits, like the JavaScript, or the
online MOBILEAPP-specific plumbing. Which would be great.

No, this doesn't do anything sane yet. It does compile the same online
C++ files as the iOS app, though. (Some minor tweaks were needed in a
couple of them to silence gcc warnings.)

There is a plain Makefile, but I should change to using autofoo, too.
Eventually, this will need to be built in a separate tree from a
normal online, just like when using the --enable-iosapp configure
switch. (But for now, doesn't matter.)

Change-Id: I13e4d921acb99d802d2f9da4b0df4a237ca60ad6
2018-10-17 00:45:35 +03:00
Tor Lillqvist
42948f6d75 On iOS, Util::getThreadId() just wraps std::this_thread::get_id() 2018-10-16 23:04:33 +03:00
Tor Lillqvist
f40e05de42 It's enough to document a variable in one place
Let's not have slightly different documentation for the same variables
in the SigUtil.hpp and SigUtil.cpp files. That is just silly.
2018-10-15 16:33:54 +03:00
Tor Lillqvist
e9acbe175d ShutdownRequestFlag can be a constant false in the mobile app
We don't have any user-generated signals to handle by shutting down in
an app.

One less thing to worry about. Now it's just the global
TerminationFlag that is problematic when the code runs in just one
process.
2018-10-15 16:33:54 +03:00
Tamás Zolnai
ac2cd92d25 Upper limit of sent out versions of the same tile
We try to decrease the network usage with avoiding sending out
to much tiles to the client. When we already sent out two versions
of the same tile without having the tileprocessed message from the
client we delay sending out the next version to avoid spamming tiles
on the network.

Change-Id: Ia47cd7c0d3fb829f6777f0c3265970433591df19
2018-09-29 09:27:06 +02:00