Commit graph

1318 commits

Author SHA1 Message Date
Michael Meeks
f7079c9644 remove un-necessary includes.
Change-Id: I360169b15fc245dfe43befb2934739b101547e26
2019-09-02 15:50:37 -04:00
DarkByt31
22f1656e08 tdf#107038 Poco::Timestamp replacement with std::chrono
Added functions to get file timestamp and to convert
chrono timestamp in ISO8601 fraction format and some
test cases.

Change-Id: I58961a31f7262b367cff9f33cffdec7571a2f8f7
2019-09-02 15:50:37 -04:00
Michael Meeks
f384b8a414 Add watermark opacity setting.
Change-Id: I839e8aef91acfed40d4afd8c1b50176ed54c670a
2019-08-26 16:29:12 -04:00
Michael Meeks
327869fffe re-factor childsession onLoad callback to cleanup parameter clutter.
Change-Id: I0665db05845a910abf1cc56e13d2f9845cc5c373
2019-08-26 16:29:12 -04:00
DarkByt31
7850c944e2 tdf#107038 Poco::Timestamp replacement with std::chrono
Change-Id: I85e041a778f14071e55fa6bd05b7b145f7887c57
2019-08-26 16:29:12 -04:00
Aron Budea
cfe43ef3f5 Improve SSL initialization
Always log cipher list, and disable any chance of fallback
to deprecated protocols.

Change-Id: Ifdfc7a3e44e98b078a36fdda6f3c813354a79e60
Reviewed-on: https://gerrit.libreoffice.org/76465
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-08-21 15:25:43 +02:00
Miklos Vajna
7952bfc32f wsd: fix assertion failure on 'make run'
loolwsd: ./common/Util.hpp:918: void Util::RuntimeConstant<bool>::set(const T &) [T = bool]: Assertion `!_initialized' failed.

Probably introduced in commit 3c1a130004
(wsd: fix build, with argument "--disable-ssl", 2019-08-20).

Change-Id: Ia7c310f1a8d6ed1b3b69bd91f9e117b97d15e7d7
2019-08-21 09:13:01 +02:00
Miklos Vajna
532ae61caf Fix UB in StorageBase::isExitSave()
StorageBase::_isExitSave was uninitialized:

wsd/Storage.hpp:181:38: runtime error: load of value 190, which is not a valid value for type 'bool'
    #0 0xd02260 in StorageBase::isExitSave() const /home/vmiklos/git/libreoffice/online-san/./wsd/Storage.hpp:181:38

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior wsd/Storage.hpp:181:38 in

Seen during unit-wopi-temp.

Change-Id: I3284637d411450a35680f6499e9d29c6f94aa723
2019-08-21 09:06:50 +02:00
Henry Castro
3c1a130004 wsd: fix build, with argument "--disable-ssl"
wsd/LOOLWSD.cpp:1034:14: error: ‘SSLEnabled’ is not a member of ‘LOOLWSD’
wsd/LOOLWSD.cpp:1049:14: error: ‘SSLTermination’ is not a member of ‘LOOLWSD’

Change-Id: I3e81431ef56f46a844733b797b4c443a77afeb6e
Reviewed-on: https://gerrit.libreoffice.org/77850
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-08-20 18:24:15 +02:00
Henry Castro
2872bc7be9 post logs JavaScript runtime errors to the loolwsd server
Change-Id: Ic8ccff52d2f051ea6d31b6d2bfe08fc08ea4d8c2
Reviewed-on: https://gerrit.libreoffice.org/77849
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-08-20 18:24:04 +02:00
Tor Lillqvist
1d3ac69ffd Avoid some "RuntimeConstant instance read before being initialized" issues
(In the !ENABLE_SSL case.)

Possibly the SSL or not ifdeffery could be cleaned up a bit more.

Change-Id: I0c9b4e956dcd317d6622a7394044fed0c4f2d976
Reviewed-on: https://gerrit.libreoffice.org/77780
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-08-20 10:55:32 +02:00
Ashod Nakashian
6d94b35c35 wsd: block save of read-only documents
WSD is responsible for checking permissions,
as we do with DisableCopy and DisablePrint,
but until now we allowed saving even on
read-only documents.

The reason, it seems, was that when we failed
to save a document due to disk space, we
set documents as read-only. So presumably
we still had to allow saving, so users
preserve their latest changes when the disk
has some free space. Meanwhile, we didn't
let users make further changes. At least
this seems to be a reasonable explanation.

Unfortunately this meant that we allowed
saving when the user had no permission,
or the document was loaded as read-only.

Now we no longer mark documents that fail
to save due to disk-space limitation as
read-only, and instead expect the client
to notify the user and (possibly) block
further edits. And read-only documents,
or users without write permission, are
no longer allowed to get saved.

This change makes sure that the ctrl+s
shortcut respects the read-only flag,
while we allow clients to disable
the default handler and decide what to
do (although now they cannot force saving
when the user has no permission, something
they could do previously).

Change-Id: I16c3b75fd3e54435d750948a25afd6f71c9f963b
Reviewed-on: https://gerrit.libreoffice.org/77594
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-17 04:44:51 +02:00
Ashod Nakashian
2eab5cea76 wsd: leaflet: support reordering of slides via drag-and-drop
Change-Id: I1b471ba07dd0a1016a0759de729171ae968262cb
Reviewed-on: https://gerrit.libreoffice.org/69635
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71099
2019-08-17 04:33:04 +02:00
Ashod Nakashian
8e118889cb wsd: leaflet: support statusupdate: messages to sync clients
This new message is identical to status: except it doesn't
imply (re)connection. It's unfortunate that status: is
assumed to be sent only when establishing connection and
loading a document, so we need a different notification
that can be sent at any time, without triggering
initalization logic on the client-side.

Change-Id: I9c804119aec292b873aeed132cc32f13c030d845
Reviewed-on: https://gerrit.libreoffice.org/69634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71098
2019-08-17 04:32:09 +02:00
Ashod Nakashian
eaed3615bb wsd: loleaflet: select multiple parts
Primarily support for selecting multiple slides
to edit their properties together.

Change-Id: I96c7ec048668494b5b769677db6874df91cbb42d
Reviewed-on: https://gerrit.libreoffice.org/69631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71095
2019-08-17 04:30:05 +02:00
Ashod Nakashian
919a93cd4b wsd: improved anonymization algorithm
Better hashing algorithm based on FNV-1a.
Adds support for salting the hash, and
for providing salt via configuration.

More unit-tests added, and better formatting.

Change-Id: I2be42675d0cdbaa73c3d7faed99e07631a9c20fc
Reviewed-on: https://gerrit.libreoffice.org/70034
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71091
2019-08-17 04:26:35 +02:00
Ashod Nakashian
226c2fe71c wsd: unify anonymization flags under one
This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.

Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71090
2019-08-17 03:42:19 +02:00
Tor Lillqvist
a158686422 The SavedClipboards stuff presumably makes no sense for MOBILEAPP
It seems to be strongly related to HTTP things at least in error
handling. So bypass as cleanly as possible in the MOBILEAPP case for
now.

Change-Id: If9540f166293635513a3ab06371f01ad381a8cb2
2019-08-12 13:20:52 +03:00
Tor Lillqvist
5d0c858770 Avoid unexpected exception in the iOS app
There is no "host" or "server name" in the MOBILEAPP case. The
getHost() call throws an exception.

Change-Id: If950f83b2f0b9fa7ee91bf2e2194e637414bff06
2019-08-12 13:20:52 +03:00
Miklos Vajna
1263694944 common: wrap ShutdownRequestFlag in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
ShutdownRequestFlag:

==13663==ERROR: AddressSanitizer: odr-violation (0x00000208f860):
  [1] size=1 'ShutdownRequestFlag' ../common/SigUtil.cpp:60:19
  [2] size=1 'ShutdownRequestFlag' common/SigUtil.cpp:60:19
These globals were registered at these points:
  [1]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f9b903f1d0b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ad0b)

  [2]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b9fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b9fe)

Change-Id: I247760325f804813249e814dbb4576493619dee7
2019-08-12 09:03:42 +02:00
Miklos Vajna
35646b7bf9 common: wrap DumpGlobalState in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
DumpGlobalState:

==5783==ERROR: AddressSanitizer: odr-violation (0x00000208f7a0):
  [1] size=1 'DumpGlobalState' ../common/SigUtil.cpp:49:19
  [2] size=1 'DumpGlobalState' common/SigUtil.cpp:49:19
These globals were registered at these points:
  [1]:
    #0 0x5f9a08 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f5c5edf1c9b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ac9b)

  [2]:
    #0 0x5f9a08 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b98e in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b98e)

Change-Id: I4b7b0238eb9b38a30875e8788c1dcb27f1d1643f
2019-08-09 09:23:17 +02:00
Miklos Vajna
bd4d72d41f common: wrap TerminationFlag in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
TerminationFlag:

==11732==ERROR: AddressSanitizer: odr-violation (0x00000208f4a0):
  [1] size=1 'TerminationFlag' ../common/SigUtil.cpp:41:19
  [2] size=1 'TerminationFlag' common/SigUtil.cpp:41:19
These globals were registered at these points:
  [1]:
    #0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f5df9cf18cb in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60a8cb)

  [2]:
    #0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b4fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b4fe)

Change-Id: Ic620b143ecb77699f40676ff39d0fa7abceb34d5
2019-08-08 09:10:59 +02:00
Tor Lillqvist
c1ebc62c3a Fix build for MOBILEAPP
The iOS app does not work any longer, though. Hits an assertion failure.

Change-Id: Ia135c12a79427e5c2b6c3c98adef4c354d1ceb68
2019-08-07 14:41:37 +03:00
Michael Meeks
617a5d69b0 Account for a state change race.
We can have un-processed incoming mesages in transit after a local
transition to WAIT_DISCONNECT including some that change state.

Change-Id: I577aebbc0a6ecca695f4bc35b4d226e1a465817d
2019-08-06 14:50:52 -04:00
Michael Meeks
80fb9ac96f clipboard: unit tests need clipboard tags during init.
Ensure we always have a valid clipboard key at start.

Change-Id: Ia2d37e038d8baa877d147f507a5ff4c867f55813
2019-08-06 14:50:52 -04:00
Michael Meeks
53bb8261d2 clipboard: remove inadvertent debug.
Change-Id: I59833519d5f4a8b16c7925a8094c974a1e7f5c11
2019-08-06 14:50:51 -04:00
Ashod Nakashian
9a0bb531eb wsd: Logging corrections
Change-Id: Ib4472c203d29992f08966a78961ab364e589f8d0
2019-08-05 22:21:54 -04:00
Ashod Nakashian
d12227c839 wsd: send clipboard key on loading
While we don't send the clipboard key
to the client during the construction
of ClientSession, we do so upon handshake
(loolclient message), and by then our state
is no longer DETACHED, rather it is LOADING.

This restores copy/paste across documents.

Change-Id: I0db50210f232afa05b1273edeb2cc163fd07c504
2019-08-05 22:21:54 -04:00
Michael Meeks
9e791fb0d4 clipboard: persist selections for a while after a view closes.
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.

Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
2019-08-05 22:21:54 -04:00
Ashod Nakashian
2492faf225 wsd: add 'meta origin' to clipboardcontent payloads too
Change-Id: I61233fd9b2559a28a0da67dd0a869e97c8b34da7
2019-08-05 21:58:10 -04:00
Michael Meeks
eeff5ee173 clipboard: include /lool/ into the clipboard base URL.
Helps older load-balancers.

Change-Id: Ibc1529a5784bb7fe6e11f914f4ee01cd1bae52a2
2019-08-05 21:46:39 -04:00
Michael Meeks
00a4fc0cd7 clipboard: good places to dump the raw byte stream.
Change-Id: Idb81bd9f1e090ad337c3f98c03c4fd79f7da51a6
2019-08-05 21:44:54 -04:00
Michael Meeks
fbd021958b clipboard: de-combine whole clipboard fetch from just text/html.
Now we can copy/paste smileys internally again.

Change-Id: Ibc6c77ccb9c501230947a7172cf591b2e12531b3
2019-08-05 21:44:29 -04:00
Szymon Kłos
18305c8a44 Request text/html in get clipboard
Change-Id: I9096fb2470da0255722f58bdeaeba87fcae3511d
2019-08-05 21:38:01 -04:00
Michael Meeks
1c3ff3f336 clipboard: implement the async download & re-up-load.
Change-Id: Ib6ad55568f56acc9c9bd677224472e56ce19c13e
2019-08-05 21:36:49 -04:00
Michael Meeks
67354ba185 clipboard: don't continually send new keys.
Change-Id: I802c4c1bd6f163fed8555e0f8fd6ffe87e48d585
2019-08-05 21:36:49 -04:00
Michael Meeks
b3415abea0 clipboard: test two separate views' clipboards.
Change-Id: Ie6f2eeb1f1dd3c762cca847f4c77a5cd7d39f70a
2019-08-05 21:36:49 -04:00
Szymon Kłos
3fab8a9937 Fix crash: Send bad request when no data
Change-Id: I705c47925b1e44bf7b112325f06c915e841dab2a
2019-08-05 21:28:09 -04:00
Ashod Nakashian
26303bf340 Add complexselection message
Change-Id: Iecf5d96451e2548e6a44edac164096bca57139a8
2019-08-05 21:28:09 -04:00
Michael Meeks
3c42f3525a Rename to clipboardkey.
Change-Id: Idba1d839e75a5525a8b0e71b9aecff17b8aa05e9
2019-08-05 21:21:45 -04:00
Michael Meeks
13469e8b00 clipboard - set it with a post now.
Change-Id: I6b9234988185984335408da502f479ccda8a95a7
2019-08-05 21:18:44 -04:00
Michael Meeks
149b861975 clipboard: a more helpful calc test.
Change-Id: Ibe0e583a2019e7bc5968dd8f73cf4e4a07d363b2
2019-08-05 21:18:27 -04:00
Michael Meeks
ba4907b791 clipboard: factor out parsing, and add checks in unit test.
Change-Id: I8c23b10769293b07cc94fdc0d6110e9d540a16b9
2019-08-05 21:18:20 -04:00
Michael Meeks
9726ce6f77 Various copy/paste fixes, unit test passing, parsing of result.
Change-Id: I9168853dd011e86896c3bd474a4d05ee82c0e336
2019-08-05 21:18:12 -04:00
Michael Meeks
c7956349f6 More work getting the unit test closer to passing.
Change-Id: If2ec0d5465a84e11dec1f5c5b9839a369b393784
2019-08-05 21:16:37 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Michael Meeks
4a9de331ed Unit testing - add more hooks and helpers.
Change-Id: Ieb12699e3b012606eaa0be3cc94d6f9b58adc441
2019-08-05 21:08:01 -04:00
Ashod Nakashian
da455c486a Serve a decidedly unpretty clipboard download page
The initial bits to serving some page with provision
to ingest the different formats into a table.

Doesn't yet link with the actual document, but it's
a start.

The link will have some unique id(s) in it to
reference the document in question, which will
be some hash (possibly changing with some logic for
security reasons). This hash will have to be
something valid that WSD will use to locate
the DocBroker in question, connect to it and
fetch the formats supported and generate unique
links for each. When the user clicks on a link,
the contents will be downloaded in the given
format and copied to the user's clipboard.

The clipboard.html template is based on loleaflet.html
as we're very likely to use the same customization,
branding, localization, and javascript bits.

We would probably want to add a brandable title
with logo etc. and possibly some more reasable
background (ideally, an image enlarged and blured
to give the page some semblance of having content).

Change-Id: If0550184d4423bef1e98fecbb072bdf8df07701b
2019-08-05 20:26:13 -04:00
Michael Meeks
c36da1cd97 Implement getClipboard and start of a unit test.
includes Change-Id: I47d38f9285c855dcc6fbeeb73d35f22a46a30c05

Change-Id: I60b84bef1cf832ec5c191d664afd90a080b7ffbc
2019-08-05 20:25:49 -04:00
Michael Meeks
d3887f7a94 handle web clipboard request. 2019-08-05 20:06:54 -04:00
Michael Meeks
52e477e57e Switch to text/html for paste where we can.
Build special URLs to detect the same host being in-use, and much more.

Change-Id: I0ca639ea416cb78bf5e5274eac4400542b6b2cda
2019-08-05 15:47:47 -04:00
Michael Meeks
f2c6facb29 Don't combine tiles a long way from each other.
We currently combine only horizontally, but ctrl-right arrow in
calc can throw us to the other side of the sheet, creating a very
large area to re-render.

Change-Id: I7125ab815e3de1296b3af32632626005eeee0ec9
2019-07-26 10:12:00 +01:00
Jan Holesovsky
82bcd8db73 Add a comment where the HULLO response is handled.
Useful for git grep HULLO :-)

Change-Id: Ia7696f91f6452aaab6df95b640ac361b4904d4b5
Reviewed-on: https://gerrit.libreoffice.org/76300
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-07-25 13:03:09 +02:00
Henry Castro
760864870f wsd: introduce "TemplateSource" WOPI property
Change-Id: I9df1d5d0d4be7fe10ee15c40c36195c86ccf857e
Reviewed-on: https://gerrit.libreoffice.org/76190
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-07-24 12:10:15 +02:00
George
360d5a0956 added server uptime field to admin console
Change-Id: Id23fee1299b87095f186ce7aaa8c2d2e0f3cef52
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2019-07-19 21:14:01 +01:00
Jan Holesovsky
397e7236c9 android: Issue an error message when the document cannot be loaded.
Instead of keep spinning the spinner, show an error message.

Relevant for iOS too I guess.

Change-Id: I9fb45a1808a12e133bc2548c4cf07c1ba8bb629f
2019-07-15 20:18:09 +02:00
Miklos Vajna
0bd44822e1 wsd: update outdated link in README
Version number is one thing, but missing Leap made this even more
confusing.
2019-07-08 09:06:23 +02:00
Andras Timar
82aeee991b typo: separeted -> separated
Change-Id: I962c1943a05d014e055093d30de9577d3360a280
2019-06-24 15:52:47 +02:00
Michael Meeks
38934525dd Cleanup sensibly on exceptions.
Otherwise atexit handlers can get very upset.

Change-Id: I693ff3ee43dd8eedc0838b633445ae81229b7fcf
Reviewed-on: https://gerrit.libreoffice.org/74516
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-06-21 17:06:43 +02:00
Miklos Vajna
717816d44d wsd: add new always_save_on_exit config option
The default behavior is unchanged: once the last editor exits, we still
only perform a save when the document is modified.

It's possible to opt in for the new behavior, though: in that case the
save after the exit of the last editor will happen even for unmodified
documents.

Change-Id: I14c17035a932cf952217f3b71fdef57fede0ce24
2019-06-06 11:48:54 +02:00
Miklos Vajna
3c927a9f32 wsd: allow disabling idlesave and autosave from configuration
The code already assumed a signed integer, but the configuration advertised
unsigned, standardize on signed.

This way it doesn't matter if the "disable" value is zero or a negative
number.

Change-Id: I56632c8a36be01afefdc5f2a35e70bde945d69d3
2019-06-05 17:28:03 +02:00
Jan Holesovsky
230aa62d17 Answer 404 when the file to download does not exist.
This gives a better idea what has happened to those using the
Download_As postMessage.  Without this, the attempted download just gets
stuck.

Change-Id: Ic23bbca3761d795251664cf09956468fab13ed80
Reviewed-on: https://gerrit.libreoffice.org/73448
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 00c02138645c89560130be759500cfa0dad86fa8)
Reviewed-on: https://gerrit.libreoffice.org/73450
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-04 14:55:08 +02:00
Jan Holesovsky
3c45a0abab Introduce Download_As postmessage & a CheckFileInfo entry to enables that.
The Download_As is emitted when the user chooses 'Print' or 'Show
slideshow' or 'Download As [some type'] and the integration indicates
via DownloadAsPostMessage in the CheckFileInfo that it wants to handle
the downloading of pdf for printing or svg for slideshows or experted
document.

This is particularly useful in situations when the integration cannot
rely on browser's support for downloading like in mobile apps that use
the Online in a WebView.

Change-Id: Iefdf214937c0c0dafd7462340a1c5e88df94e716
Reviewed-on: https://gerrit.libreoffice.org/73449
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-04 14:54:36 +02:00
Samuel Mehrbrodt
a3481d8e23 Remove unused env vars from README.vars
Change-Id: Ia0b239f37d98534f278fa7e828ad5e4192b26f31
Reviewed-on: https://gerrit.libreoffice.org/73119
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-06-04 09:07:47 +02:00
Miklos Vajna
a4fd83794e Remove unused using declarations
Change-Id: I0d4336fc8f85a18b2c41de233166e725166385f6
2019-06-03 09:06:11 +02:00
Eduard Ardeleanu
5663817bab detecting password protected files on convertTo
Fail-fast when a file cannot be converted, using convertTo REST API, if the file is password protected and the password wasn't received.

Change-Id: I32d807bcecbbe72a38a70fec74caf13638803e1d
Reviewed-on: https://gerrit.libreoffice.org/72891
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-30 13:49:40 +02:00
Miklos Vajna
2827d50ee7 wsd: avoid unnecessary copy initialization in DocumentBroker
'filename' was copy-constructed from a const reference, no need to make a
copy.

Change-Id: I2ad86a1a524359c3bd50975484d7742558e88dfd
2019-05-30 08:43:45 +02:00
Miklos Vajna
106b7fbd8e TestStubs: add more stubs for sanitizers
This is needed to compile the tests without undefined references when
using sanitizers. Previously it was possible to run loolwsd, but
building the tests failed.

Change-Id: I6babd1c43816cb2387c82316cc1bf9ff14d7a068
2019-05-28 09:10:45 +02:00
Michael Meeks
6ad5f3a509 re-order to fix threading; probable mis-merge.
Change-Id: Id59042248db7572add2d06f62cd8f1d4969ed889
2019-05-27 23:16:47 +01:00
Andras Timar
1f67481fdb typo: retreieved -> retrieved
Change-Id: Ib991569167711ebfe057daf1e2ca89ce809d35c4
2019-05-27 13:58:02 +02:00
Miklos Vajna
1a41e368ad wsd: avoid UB in DocumentBroker::cancelTileRequests()
With this, it's possible to open a document and type keys with
sanitizers enabled.

/home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:9: runtime error: reference binding to null pointer of type 'TileCache'
    #0 0x911996 in std::unique_ptr<TileCache, std::default_delete<TileCache> >::operator*() const /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:2
    #1 0x8ecb2a in DocumentBroker::tileCache() /home/vmiklos/lode/dev/online/./wsd/DocumentBroker.hpp:265:37
    #2 0x8c6a63 in DocumentBroker::cancelTileRequests(std::shared_ptr<ClientSession> const&) /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:1586:37
    #3 0xb32b0e in ClientSession::_handleInput(char const*, int) /home/vmiklos/lode/dev/online/wsd/ClientSession.cpp:194:20
    #4 0xd45d3c in Session::handleMessage(bool, WSOpCode, std::vector<char, std::allocator<char> >&) /home/vmiklos/lode/dev/online/common/Session.cpp:219:13
    #5 0x768080 in WebSocketHandler::handleTCPStream(std::shared_ptr<StreamSocket> const&) /home/vmiklos/lode/dev/online/./net/WebSocketHandler.hpp:368:13
    #6 0x6f800d in WebSocketHandler::handleIncomingMessage(SocketDisposition&) /home/vmiklos/lode/dev/online/./net/WebSocketHandler.hpp:419:20
    #7 0xb2c644 in ClientSession::handleIncomingMessage(SocketDisposition&) /home/vmiklos/lode/dev/online/wsd/ClientSession.cpp:74:14
    #8 0xa6f641 in StreamSocket::handlePoll(SocketDisposition&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, int) /home/vmiklos/lode/dev/online/./net/Socket.hpp:1037:29
    #9 0x6ec63d in SocketPoll::poll(int) /home/vmiklos/lode/dev/online/./net/Socket.hpp:570:34
    #10 0x83af99 in DocumentBroker::pollThread() /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:387:16
    #11 0x8fc778 in DocumentBroker::DocumentBrokerPoll::pollingThread() /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:165:20
    #12 0xdff935 in SocketPoll::pollingThreadEntry() /home/vmiklos/lode/dev/online/net/Socket.cpp:184:9
    #13 0xe487bd in void std::__invoke_impl<void, void (SocketPoll::*)(), SocketPoll*>(std::__invoke_memfun_deref, void (SocketPoll::*&&)(), SocketPoll*&&) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14
    #14 0xe482ca in std::__invoke_result<void (SocketPoll::*)(), SocketPoll*>::type std::__invoke<void (SocketPoll::*)(), SocketPoll*>(void (SocketPoll::*&&)(), SocketPoll*&&) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14
    #15 0xe4817d in decltype(std::__invoke(_S_declval<0ul>(), _S_declval<1ul>())) std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:234:13
    #16 0xe47f87 in std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> >::operator()() /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:243:11
    #17 0xe4734a in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> > >::_M_run() /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:186:13
    #18 0x7f5c2ce55e2e in execute_native_thread_routine /home/vmiklos/lode/packages/gccbuild/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../gcc-7.3.0/libstdc++-v3/src/c++11/thread.cc:83
    #19 0x7f5c2c832558 in start_thread (/lib64/libpthread.so.0+0x7558)
    #20 0x7f5c2bf4682e in clone (/lib64/libc.so.6+0xf882e)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:9 in

Change-Id: Ief574a11c838c77f7f159b1133beeef0deada201
2019-05-24 09:04:16 +02:00
Henry Castro
898c47fbb4 wsd: fix the exception "Bad URI syntax"
if the file name has '%' character it throws
exception "Bad URI syntax", so use the encoded
file name string

Change-Id: I6a8d841761b46ac49a6c79956ba215e1affa53e5
Reviewed-on: https://gerrit.libreoffice.org/72385
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit b934c70f4f1f9f3ee4f873570633a3b1ec931652)
Reviewed-on: https://gerrit.libreoffice.org/72890
2019-05-24 08:57:36 +02:00
Michael Meeks
bf88897c47 Make renamefile more careful.
Change-Id: If39353fc01ea48d8e0077b228a6281839dde5c87
2019-05-23 17:55:38 +01:00
Miklos Vajna
d79666092d wsd: avoid UB in FileServerRequestHandler::readDirToHash()
wsd/FileServer.cpp:464:35: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/dirent.h:162:45: note: nonnull attribute specified here
    #0 0xbf566b in FileServerRequestHandler::readDirToHash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/vmiklos/lode/dev/online/wsd/FileServer.cpp:464:27
    #1 0xbf8417 in FileServerRequestHandler::initialize() /home/vmiklos/lode/dev/online/wsd/FileServer.cpp:531:13
    #2 0x98617a in LOOLWSD::initialize(Poco::Util::Application&) /home/vmiklos/lode/dev/online/wsd/LOOLWSD.cpp:1155:5
    #3 0x7f17fc9c8263 in Poco::Util::Application::run() (/usr/lib64/libPocoUtil.so.60+0x3e263)
    #4 0x9c29f3 in main /home/vmiklos/lode/dev/online/wsd/LOOLWSD.cpp:3466:1
    #5 0x7f17fa739f49 in __libc_start_main (/lib64/libc.so.6+0x20f49)
    #6 0x5c1e19 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior wsd/FileServer.cpp:464:35 in

Change-Id: Iadb90c4e98981283718be3e3e9f55cb0b7a3e917
2019-05-23 16:42:59 +02:00
Michael Meeks
24b9d6008d Don't allow readonly views to removesession on editors.
Change-Id: I5c00b83d5a3a5fc59f7c722b9ed7f9753b2b0dc8
2019-05-23 12:13:11 +01:00
Michael Meeks
9d723cb230 Initial chunked transfer encoding.
Important for convert-to on larger documents and/or with newer curls.

Change-Id: Id18be6d22741a3af7cee39a069c509e4f662977b
2019-05-22 11:07:42 +01:00
Michael Meeks
83d687825d Avoid exceptions in some shutdown corner cases.
Change-Id: I1c301dc96d925fd5d74c00bf4b9417782822a997
2019-05-22 02:56:11 +01:00
Michael Meeks
1845ed42af tdf#123482 - cleanup convert-to folder even more reliably.
Problems could occur if exceptiosn thrown when parsing the input stream.

Change-Id: Id82b3816450194164fc2093554c730b4a94acef1
Reviewed-on: https://gerrit.libreoffice.org/72695
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-22 01:57:48 +02:00
Miklos Vajna
73108db913 wsd: fix -Werror,-Winconsistent-missing-override
Change-Id: Ide9921e410a8e1401a25b85fda04de1b5a45617a
2019-05-21 09:13:13 +02:00
Tor Lillqvist
b5154eaf69 Make the document-specific threads in the iOS app go away more reliably
After a document is closed, the prisoner_poll, accept_poll,
websrv_poll, docbroker_nnn, and lokit_main threads that served that
document are supposed to go away as quickly and reliably as possible.
This change improves that significantly.

Change-Id: If658bea74f70a77d2d537f0ec6455a6b36f2667e
2019-05-21 02:40:28 +03:00
Michael Meeks
4e7f8b6e00 Remove vestige of legacy sockets.
Change-Id: I5c2175e95144b7e93eafce2a273ed5f3549850bb
2019-05-20 21:32:59 +01:00
Michael Meeks
046ab32e46 Use compile-time rather than run-time string concatenation.
Saves some time & space.

Change-Id: If1e62056447fb7e8f26e8cf107451876adf3fecb
2019-05-20 12:30:01 +01:00
DarkByt31
8e34705fe2 tdf#107038 Poco::DateTimeFormatter with Util::getHttpTimeNow()
Added a function to Util to get current time in HTTP
format using std::chrono.

Change-Id: I9e7a732f585c1758c9348c450a01713a66f1e7b7
Reviewed-on: https://gerrit.libreoffice.org/72585
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-20 11:53:13 +02:00
DarkByt31
a243fdef88 tdf#107038 Poco::Timestamp replacement with std::chrono
Change-Id: Ic577d304f2152c53895f4602cf55a98dd1e63ed0
Reviewed-on: https://gerrit.libreoffice.org/72531
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-18 23:42:14 +02:00
Michael Meeks
8be093ed67 Tolerate empty first lines.
Change-Id: Ib9aaf82560fc3f5adaa97f40a3de5f3946c6f65d
2019-05-17 14:27:47 +01:00
Michael Meeks
d8bcc1cf9c debug: cleanup ID display as a simple link.
And cleanup debug printout in 'make run' too.

Change-Id: I7a399eb00f15e43ceb230f66a2b17d437c5c79b0
2019-05-17 13:24:32 +01:00
Michael Meeks
289894c66c debug: show WebSocketURI & a unique host id in help -> about.
Rather useful for debugging clustering issues.

Change-Id: I6d5f224bf8a3e4034c419137c8ad2b17fdf265ed
2019-05-17 13:24:32 +01:00
Michael Meeks
1955287013 debug: dump content of paste messages.
Problematic not to be able to see the content, helps hunt weirdness
in eg. pasted RTF.

Change-Id: I301bfe040a2424b6ca84ab94b8eee865439fb680
2019-05-17 13:24:32 +01:00
Tor Lillqvist
d9e5a47058 Introduce new flag to speed up shutdown of the Online plumbing in the iOS app
Spent hours on trying to cleverly use the existing TerminationFlag
(with minor modifications to the code that checks it, and some
additional code to set and reset it), but could not get it to work.
This is simpler, but sure, using a global variable is ugly of course.
At least the new MobileTerminationFlag is very specific in semantics
and only used in the mobile apps.

Change-Id: I0775fdfa7880750ca12c6fd7ec41d3d3ceb2f0ad
2019-05-16 11:44:41 +03:00
merttumer
0dbf9bcf27 Added RenameFile Support for WOPI
This patch concerns rename file operation when the integration
supports it
Signed-off-by: merttumer <mert.tumer@collabora.com>

Change-Id: Ibb4f615b91dda2491bfcd4d4738198d69eca4e6f
Reviewed-on: https://gerrit.libreoffice.org/71587
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Signed-off-by: merttumer <mert.tumer@collabora.com>
2019-05-13 22:29:40 +03:00
Szymon Kłos
ded421bfd6 Update WOPI Extensions docs: App_LoadingStatus
Change-Id: I245aec62da3b19e7b81275b0a0a5e84bf0f5b699
Reviewed-on: https://gerrit.libreoffice.org/71958
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-05-13 13:46:45 +02:00
Szymon Kłos
e62cdfae82 Handle storage load errors
Pass information about storage loading failures
to the wopi host.

Change-Id: I8da3a80e47b15f246343dc8e4199d8f860e1fb8a
Reviewed-on: https://gerrit.libreoffice.org/71354
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-05-06 14:01:26 +02:00
Michael Meeks
264450758a test: close testCrashKit race.
LOOLWSD is conservative and leaves forkit to start processes for a
while. If we kill a kit before it has started and registered we can
end up with LOOLWSD holding off to wait for the (now dead) kit, and
the tearDown assertions that we have 1 kit failing.

Change-Id: Id25e48bf55d1757d2223816293500fde6ff9df1b
Reviewed-on: https://gerrit.libreoffice.org/71811
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-05 00:04:00 +02:00
Michael Meeks
c08b2f2ba4 Improve pid collection and printout for tests.
Change-Id: I820c1acbdbae41dd2c2c6bb7285b84bbb61e79d5
2019-05-03 13:52:15 +01:00
Michael Meeks
8172885f74 PNG compression a bottleneck: thread it to accelerate things.
Also have a separate hash <-> wid cache to avoid re-rendering
older tiles as/when we see them.

Change-Id: I238fe6701a1d1cb486473c67faba8c56e9c98dcb
2019-05-02 22:36:52 +01:00
Ashod Nakashian
ca1a83f96b wsd: reduce tile logging from debug to trace level
These are very frequent and not very useful without
the ability to trace them across the system, which
are all done at trace level. So it's highly unlikely
that these would be used at debug.

Change-Id: I479f2ead1bbd2996b9972082e00ebf984072f785
Reviewed-on: https://gerrit.libreoffice.org/71073
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:02:36 +02:00
Ashod Nakashian
c7ac68e8e3 wsd: tile serializer now supports adding a suffix
Moves appending tokens into the serializer and
avoids making extra copies of itself.

Change-Id: I62d374e69d9c4a55643ea20cb5f8c2b9c75c88c5
Reviewed-on: https://gerrit.libreoffice.org/71022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-04-23 03:01:30 +02:00
Michael Meeks
2871653bf4 Simplify legacy single tile rendering code-path.
Remove redundant _id member from TileCombined, add constructor
from TileDesc, and use it to shrink the code.

Change-Id: Idc0ded63166ed350ab81b07e191b7a60d4407cd4
2019-04-19 23:51:26 +01:00
Jan Holesovsky
ea659b3d99 Use the app name more generally, not only on iOS.
Preparation for using it on Android too.

Change-Id: Iee7778b2625a02a98daff5df87c39f4ab1d18144
Reviewed-on: https://gerrit.libreoffice.org/70651
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-04-12 13:44:40 +02:00
Tor Lillqvist
9c02d82f7c Fix build in the MOBILEAPP case
Did not check how well it works.

Change-Id: I5ca1b349aafcfddaed517e51ca6bd25e9749779d
2019-03-31 14:34:24 +03:00
Michael Meeks
201bcb0762 Use peercreds to identify processes connecting rather than URL params.
Change-Id: I241e80962fb8cf2f3fff1bb4be81d9f0ee74c648
2019-03-30 21:37:05 +00:00
Michael Meeks
81a27e26aa Switch local prisoner sockets to abstract UDS
Unix Domain Sockets are inaddressable remotely, and more efficient,
as well as allowing future SCM_CREDENTIALS / SCM_RIGHTS.

Change-Id: Ia2472260f75feb43e9022cdfa0fe005ccd489454
2019-03-30 16:51:06 +00:00
Michael Meeks
38bb1db96c Only erase buffer if socket is not shutting down.
Change-Id: I23886db8d2fdb6297862947e031e14d7a485ecd7
Reviewed-on: https://gerrit.libreoffice.org/69949
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-03-30 17:50:43 +01:00
Tomaž Vajngerl
02a07d62a5 tdf#124146 touch gesture support, send pan gesture in dialogs
Pan gesture should work for comboboxes, for which panning is
implemented in core.

Change-Id: I0a7e49e9335159a302716f666e2334a9d532c115
Reviewed-on: https://gerrit.libreoffice.org/69720
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-26 10:48:17 +01:00
Tor Lillqvist
c459ad77a1 tdf#124055: Idle timeout is pointless in mobile apps
We don't want to unload the document and show any "Idle document -
please click to reload and resume editing" overlay.

What the iOS (and presumably Android) app *would* need, though, is
proper restore functionality. I.e. if you have a document open, and
the app is put in the background (i.e. the user does something else),
and the OS kills it (as is perfectly normal for iOS or Android to do
to idle background apps), then when the user returs to the app, it
should reopen the same document and restore the view location and zoom
level.
2019-03-21 14:36:46 +02:00
Jan Holesovsky
c8285addec Kill some extra whitespace.
Change-Id: If0899266ab0ca0d3717fce6eff3a8fca0b4f90ea
2019-03-20 08:50:14 +01:00
Eduard Ardeleanu
d87146d3fa fix: saveAs breaks when '%' character is used within the filename
Change-Id: I2df059abd67be88acae8bd44ae2c74be7778a595
Reviewed-on: https://gerrit.libreoffice.org/69424
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-03-19 18:31:15 +01:00
Jan Holesovsky
3f95b81535 Revert "wsd: use a tiny parser, variable substitution"
This reverts commit ed89931ae8.
2019-03-15 18:24:25 +01:00
Jan Holesovsky
b132738476 Revert "wsd: tokenize symbol "_('') _("")""
This reverts commit 6144d55f44.
2019-03-15 17:27:04 +01:00
Jan Holesovsky
e78a93e747 Revert "wsd: create a static function "parse""
This reverts commit fcfc257162.
2019-03-15 17:26:54 +01:00
Jan Holesovsky
0087e9fbc3 Revert "wsd: add boost::locale generation and caching"
This reverts commit c2aef68601.
2019-03-15 17:26:42 +01:00
Jan Holesovsky
2383a205c7 Revert "wsd: preprocess javascript file for L10n"
This reverts commit 306b12b9bc.
2019-03-15 17:26:22 +01:00
Jan Holesovsky
b2bd10445d Revert "wsd: allow compression gzip for html and js resources"
This reverts commit b879f9dd06.
2019-03-15 17:26:12 +01:00
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
Michael Meeks
d8bb92cdcf Don't count convert-to connections vs. the document count.
Change-Id: I350905fb98c503ae8f22a377e4af5cbcb9f3c52d
2019-03-15 11:27:31 +01:00
Miklos Vajna
0d5ee512b3 wsd, tile cache: avoid copy in loop when result is only used as const ref
Change-Id: I7f5d3b0a52c5257b8e8d23fb2eafb5919aaae5f6
2019-03-08 08:37:14 +01:00
Henry Castro
b879f9dd06 wsd: allow compression gzip for html and js resources
Change-Id: I0c6030c91e379cf1d78950516d2b6b8aa6bd018b
2019-03-05 21:14:04 -04:00
Henry Castro
306b12b9bc wsd: preprocess javascript file for L10n
Change-Id: Ib802beca673e1e90ad5dd9c33cd5191300ae7bf8
2019-03-05 20:56:46 -04:00
Henry Castro
c2aef68601 wsd: add boost::locale generation and caching
Change-Id: I75009a87038632ceaddb29094d340b6d9066d5ef
2019-03-05 19:40:58 -04:00
Henry Castro
fcfc257162 wsd: create a static function "parse"
Change-Id: Ifffae9a0d38bf64c41863a98395a2f41a6470441
2019-03-05 18:53:20 -04:00
Henry Castro
6144d55f44 wsd: tokenize symbol "_('') _("")"
Change-Id: I9c0e7f30a96a355f6d69b2c5a5244dbfbd863e08
2019-03-05 18:27:58 -04:00
Henry Castro
ed89931ae8 wsd: use a tiny parser, variable substitution
Change-Id: I821d27ef504a01d0b040f2b7ae7f66e75b16eb96
2019-03-05 16:31:51 -04:00
Michael Meeks
23b2c74af2 TileCache: add dumpState for TilesBeingRendered.
Change-Id: I60e40110d6bc9eb795f761693b52243a26746da1
2019-03-05 07:15:50 +01:00
Michael Meeks
6634d3b3e9 TileCache: key almost everything on TileDesc instead of string names.
Saves lots of string construction and storage, simplifies lots of code.

Store the more exotic font-caching bits etc. in a separate store: we
should also pre-render these really and share them.

Change-Id: Icaeff8fd72f52d7215c06a687b1e39cfb7631503
2019-03-05 06:58:50 +01:00
Michael Meeks
829e94b779 TileCache: remove redundant, expensive tracking in ClientSession.
No need for all these call outs. removeOutdatedTileSubscriptions can't,

Expect it is quicker now and more reliable to trace the tiles being
rendered and count the waiters.

Change-Id: I9724c7f38cf888b35c628857c0f11b51e74613ca
2019-03-02 21:42:34 +01:00
Michael Meeks
2d473222e4 tdf#123482 - cleanup convert-to folder more reliably.
Change-Id: I029bb4136984e05485e462c92da80b92b00fdebc
2019-03-01 22:34:29 +01:00
Michael Meeks
09211bad8c Authenticate socket earlier.
Change-Id: Idf3caba6276dd71450b86574ef39a1a16e73f61c
2019-03-01 22:05:11 +01:00
Michael Meeks
51b72b04a9 Simpify DocumentBroker constructor.
Change-Id: I0bf29df9316b129d34862c7464bb6636d42a850d
2019-03-01 22:03:35 +01:00
Michael Meeks
b255ce528b Avoid using un-necessary reference.
Change-Id: Id5a9fed8fb790f2af8facac119e9e0da476b1e47
2019-03-01 21:59:55 +01:00
Ashod Nakashian
406a7dd59e Fix PostMessageOrigin typo in log
Change-Id: I3d41c832561f9de1b46ef1444d8d0b1d633c7b63
Reviewed-on: https://gerrit.libreoffice.org/68249
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 9bc70150c856e8d671ade99e1d2024a8f0f45d9d)
Reviewed-on: https://gerrit.libreoffice.org/68390
2019-02-26 14:23:00 +01:00
Miklos Vajna
8928ff96ce wsd: remove unused using declarations
Change-Id: I2a64b3d75df1626436e050bb32538ad1a64658d1
2019-02-25 09:11:06 +01:00
Andras Timar
f7de69fcbe fix release build
Change-Id: I20a65d878aa931219af12aa1ada7cf90324ffda7
2019-02-20 13:52:46 +01:00
Michael Meeks
150d20cf37 TileCache: dumpState.
Change-Id: I6289f0b77eb0649be8254aa8c9647c47d4db3008
2019-02-15 21:36:28 +01:00
Tor Lillqvist
8f71365f0f Remove unnecessary leftovers after Michael's removal of the on-disk tile cache
Change-Id: I435679b48f90d2580bb9c5c86a26c9a1d43c5b59
Reviewed-on: https://gerrit.libreoffice.org/67885
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-02-15 21:36:16 +01:00
Michael Meeks
66ac62429c TileCache: switch to in-memory, rather than persistent.
Remove significant complexity; if we need it later lets do it more simply
serializing when we start / finish a session.

Turn off caching for mobile - possibly should kill for single-user too.

Change-Id: I5ea56088ddbb61f22fe7920f8c9ac7440cb3296a
2019-02-15 12:10:16 +01: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
Tor Lillqvist
5849a8f8a3 getServerURL() is not used in MOBILEAPP
Change-Id: I30a96c89884b6259b0a2fcd5bc5d4bc104569913
2019-02-13 19:50:54 +02:00
Michael Meeks
e1f3a6a388 Tweak problemms.
Change-Id: I35d82dffba9f0e58ea70c782ee8ce7fcf8f9b314
2019-02-13 18:35:32 +01:00
Michael Meeks
af31537a2a Expose tile-id generation to unit tests.
Change-Id: Ie56967c82192f3983ac13d53fd73346f25e6c840
2019-02-13 18:24:36 +01:00
Michael Meeks
f98a7f0592 Improve unit test / SSL handling & detection.
Change-Id: I6bd3116ac94d3d2c61e2ec543cb17896834ef2df
2019-02-13 18:24:36 +01:00
Jan Holesovsky
e3b17cdc3c android: Don't try to read discovery.xml, it's not needed on mobile.
With this, the actual loolwsd startup does not crash any more, so let's
enable it :-)  Of course it still does not work yet.

Change-Id: I5a1ee7adac64c57f1aa5b597c3dbdc0089a1ac11
2019-02-13 17:36:19 +01:00
Jan Holesovsky
dc37e633ef android: JNI for the LOOLWSD initialization.
For the moment it crashes, so the actual call is commented out.

Change-Id: Ie4acb2a91f280dcc08951dcce417b8d4552cbfe7
2019-02-13 15:17:50 +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
d15fc93f31 android: Define MOBILEAPP via config.h. 2019-02-12 10:50:40 +01:00
Jan Holesovsky
df5565674e android: Fix minor build issues. 2019-02-12 10:50:40 +01:00
Tor Lillqvist
fb29e39899 There is no DocumentBroker::handleDialogPaintResponse() either
Change-Id: I84daa5da83b9d27c8bedadeb8a5d660573e00eb4
2019-02-08 15:47:35 +02:00
Tor Lillqvist
214fb20e7f There is no DocumentBroker::handleDialogRequest()
Change-Id: Ide3f00e898dd1d3dfde62f1eea1728beb6067b04
2019-02-08 15:38:40 +02:00
Ashod Nakashian
9811b0fc98 wsd: reduce warnings
Don't stop the polling thread and attempt cleanup
when the thread is no longer alive; just avoid
logging warnings and other noise.

Demote a couple warning logs to info since
they are neither critical nor actionable.

Change-Id: Ibe8e8491723f1beeaea03a6e935d606b01e275f0
2019-01-22 14:52:40 +01:00
Tomaž Vajngerl
7137c953d8 add export, sign and upload as one function for PDF signing
PDF export, signing and upload needs to be done in one operation
as PDF doesn't change the current document. The workflow is just
a bit different to the ODF / OOXML that it needs a change in
behaviour.

Change-Id: I752b293494a2d677fa7f12f2317954cfcf47859b
2019-01-13 23:50:18 +01:00
Miklos Vajna
5391c09fba tools: make members private in Map
Change-Id: I9f23d5095e387888e43c0a0d2e6ed041ac5aed68
2019-01-10 09:11:55 +01:00