This prepares to start the next test
when the DocBroker of the current one
is destroyed.
Change-Id: I3a9672d8d03ad497f15a9bca262dfe1d4f197e41
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The default would be std:🧵:hardware_concurrency() which can be
ridiculously high for the WASM case.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I77902a58b96248d7afe638a039886712516fe905
We now upload 3 times to succeed.
This simulates a user modifying and saving
twice before giving up and closing the
document, which succeeds in uploading.
Change-Id: Ida40f79a76fc94436c0d4b4fc1ad3e7b7acc997b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The BaseUnit test didn't belong to UnitTimeout
and, more important, it needed access to
private members to both validate their state
and to reset them (since the test is artificially
initializing both WSD and Kit tests and cannot
uninitialize them, lest we unload ourselves).
As such, the self-test is now internal to
BaseUnit, with the added bonus that it
is called on all tests and not just UnitTimeout.
Also, more assertions have been added.
Change-Id: Ieaf60594f39e978a7250407262bd8bbc9b642c43
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Emscripten is very opinionated about sys/poll.h so use poll.h instead.
Signed-off-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I9691519e27a080f03a19f0cc0dd8f796fe323062
it will be used to store user data which shouldn't
be shared between views
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I58b7f22e4364ce9e07bb6cc74e8431363912a872
We no longer emit a fatal (FTL) log when
forced-exiting successfully.
Also, improved are some other logs to
better reflect the severity of the issue.
Change-Id: I22e79f685825f7ecd47cec76c9be9683deff2d55
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We need to differentiate between a document
that cannot be edited (due to permissions)
and Storage being read-only.
The distinction isn't always important,
except when readonly is set either by
the client side permissions, or is due
to opening a view-only document (such as
a PDF). Since for a view-only document,
adding and editing comments might be
allowed, while the document is read-only
and cannot be otherwise edited, we
still need to upload it to storage.
This is to preserve the changes done
to comments.
Since we need to differentiate between
read-only Storage vs the above cases,
we use a new flag in Session: isWritable.
Change-Id: I028e7908db7f0f10e5407a45c71d89aaab858390
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This helper is only true if editing of the document
is enabled and not whether or not the document is
writable in storage. Since it unifies isReadOnly
and isAllowChangeComments, which are in Session,
there is no advantage in having it in ClientSession.
It is now renamed to isEditable in Session.
Change-Id: Ib923b6162a8075be145049bc1442c42479c8ce4b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In some cases we don't really need the full
name of an enum, with the enum as namespace.
For those cases, we now support nameShort
and toStringShort.
Change-Id: Iddd383e15d900bb2d2f3d77e3de6a09470d51b62
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
There is no reason to print the test name
explicitly when each log entry is already
prefixed by the test name.
Change-Id: I72c0a0f2989a65f477902b97e6be816446fba5c3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now that we may have multiple tests in a
given Test Suite (i.e. a since unit-test
.so module), it is important to calculate
the timeout not from the total elapsed
time, but form the start of the *current*
test.
To that end, we capture the start time
on the first checkTimeout call, which
gives us the elapsed time from the very
start of the Test Suite. Using this, we
offset the elapsed time to arrive at
the time the current test consumed.
Change-Id: I01ebc3572bc147a3dabac7e1fb3237ea6d479116
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This decodes strings encoded using
encodeURIComponent.
For now, it wraps Poco::URI::decode,
which should be replaced in the future.
Change-Id: I608b327be81aeda37d2afc4dfd29828658e92dc8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In some cases mounting fails on /tmp, which
should be writable. This results in Poco
exception when trying to write to it during
mounting.
This catches exceptions and fails gracefully
to enable falling back to copying.
Change-Id: I38c8db4f452767ee43bb20a98d13bd5cc36fdba2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
add zotero UI only if user is logged in
when zotero citation edit button is clicked,
fetch the library with zotero API.
Let user select what to insert
at this stage its not a complete solution but just first stage
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id67d8409bcd6416994713acd9ace495b24823fb0
Since UnitBase (and children) are invoked from
different threads, UnitBase::exitTest could
have a race. This ultimately results in
invoking std:🧵:join() concurrently,
which is unsafe. This can result in the
following deadlock.
In this case websrv_poll had invoked
UnitBase::exitTest concurrently and
evidently finished, leaving the main
coolwsd thread deadlocked.
(gdb) info thread
Id Target Id Frame
* 1 Thread 0x7f67528f0840 (LWP 4058508) "coolwsd" __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=4058510, futex_word=0x7f675285c910)
at ./nptl/futex-internal.c:57
(gdb) t a a bt
Thread 1 (Thread 0x7f67528f0840 (LWP 4058508) "coolwsd"):
#0 __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=4058510, futex_word=0x7f675285c910) at ./nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common (cancel=true, private=128, abstime=0x0, clockid=0, expected=4058510, futex_word=0x7f675285c910) at ./nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7f675285c910, expected=4058510, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128) at ./nptl/futex-internal.c:139
#3 0x00007f67529cd6a4 in __pthread_clockjoin_ex (threadid=140081742857792, thread_return=0x0, clockid=0, abstime=0x0, block=<optimized out>) at ./nptl/pthread_join_common.c:105
#4 0x00007f6752d42337 in std:🧵:join() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x000055775c5fa8e0 in SocketPoll::joinThread (this=0x55775cc9b090) at net/Socket.cpp:282
#6 0x000055775c5c8121 in UnitBase::endTest (this=this@entry=0x55775cc0fe80, reason="") at common/Unit.cpp:545
#7 0x00007f67528df61f in UnitWSDClient::endTest (this=0x55775cc0fe80, reason="") at ./UnitWSDClient.hpp:118
#8 0x000055775c5cc4d1 in UnitBase::exitTest (this=0x55775cc0fe80, result=result@entry=UnitBase::TestResult::Ok, reason="") at common/Unit.cpp:486
#9 0x00007f67528d1fa3 in UnitWOPIFileUrl::invokeWSDTest (this=0x55775cc0fe80) at UnitWOPIFileUrl.cpp:269
#10 0x000055775c4accdb in UnitWSD::invokeTest (this=0x55775cc0fe80) at ./common/Unit.hpp:318
#11 0x000055775c4a38cd in COOLWSD::innerMain (this=0x7ffd34248650) at wsd/COOLWSD.cpp:5459
#12 0x000055775c4a59db in COOLWSD::main (this=<optimized out>) at wsd/COOLWSD.cpp:5706
#13 0x00007f6753ab0877 in Poco::Util::Application::run() () from /lib/libPocoUtil.so.80
#14 0x000055775c48316c in main (argc=14, argv=0x7ffd34248898) at wsd/COOLWSD.cpp:5845
Change-Id: If6162690462719f14a35241604f8a59b38a806c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
These only served to delete the Unit singletons,
but since we have GlobalArray, deleting them
isn't needed.
Change-Id: Ia2e53a1e3b43707196f45c06c38c6bb664c18e29
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is needed so we stop the DocBroker of
the old test, which is now finished.
Change-Id: I05df85fbbeca254928cd9a140198e7f4ae89fec8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Clang-tidy thinks, incorrectly, that an
assert(false) can be replaced with static_assert.
While the assert(false) in question is a trap
for code paths that shouldn't happen,
static_assert is a compile-time check that
has nothing to do with the execution path.
Since the assert in question is used in a
macro, it shows up countless times where
said macro is used. This silences it.
Change-Id: I19b35da6332a06335cc83b0584505a42741de97f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Apply the test filter on all tests,
not just the first.
Change-Id: Ib34e90e883f5de2ddcf04c710f433cb54677575d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now that we may have multiple tests in a
single unit-test module, we should call
UnitWSD::configure for each one, not just
once at the start. Each test can modify
the configuration settings to meet its
test conditions.
Change-Id: I08de2d998edee5b4cbade08f2496196b596a8600
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When invoking exitTest it's useful to know
something about the reason. Whether it's
because the test passed or timed out,
it's useful to log this information.
Change-Id: I8e8ae525b7c2ef1de2e394d08107341cdc87c008
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now that multiple tests and filtering are
supported, it's useful to know what tests
exist in each unit-test module.
Change-Id: Ifaa7eccabab6b23a57edf2786c0cd726ab0265db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Using the envar COOL_TEST_OPTIONS, which is
provisioned to support other options than
just filtering, it is now possible to
only run the tests with names partially
matching the filter's case-insensitive
string.
Change-Id: I6168887677fd0fddd72bac2538837615b10b9fae
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The event we trigger when we detect data-loss
is best named to reflect that fact.
And since we can override the behavior,
for example if the test expected to trigger
the data-loss detection, then we can signal
the non-failure by the return value.
Change-Id: I67ca69ae783c956cfdd14d54dab5efb7cc3d258c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
So far, we assumed only json objects are
used, but that's only because we didn't
have arrays. This adds support for detecting
both json arrays and objects alike.
Change-Id: If91bf092ab95869298e90e4f071505471ab1db19
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we can have multiple tests in a single
unit-test .so, we need to merge the results
of each test into a single result that is
used when we exit the process and flag for
failure or success.
Change-Id: Ia49f5542efd6dd998b61c17965fd3fe3245159ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we no longer need to set the handle,
this function is an initialization of the
given test, before running it.
Change-Id: Ia6fb16b06dd548977fcfcc35a81ac37d979be29d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds support for multiple tests
within a single unit-test .so.
We did have many, many tests within
the converted "old style" tests already.
Except, they couldn't support the proper
event-driven tests, nor were they running
as fast as possible. They also blocked the
main thread in COOLWSD.
With this support, we can now avoid
creating a new .so for each test case.
This will reduce the effort to add new
tests and the build time. In addition,
the execution of each unit-test is
dominated by the initialization, which
takes in the order of 5 seconds. Running
multiple tests after this high load time
reduces the per-test average time.
Later we will support listing tests,
running particular tests (i.e. filtering)
and other debugging and troubleshooting
facilities.
Change-Id: I7be43994265ebabdb5d379f7726bb9bd7f78795a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now properly cleanup unit-tests .so libs.
This helps having multiple tests by making
the dlhandle an independent variable of
all the tests.
Change-Id: Ifc8db400aebfe8ea41dcc4df2d11856c25b36074
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds support to having multiple tests in
a single unit-test .so.
Change-Id: I37526484e8a692b25393f659dedd846eedc22733
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And make arguments explicit for a setReadOnly
and setAllowChangeComment.
Default parameters are useful for backward
compatibility, when changing an API. But
they provide no benefit when the function
in question is new and is called a couple
times anyway. Code is harder to read with
default parameters because one has to
either guess (bad) or check (wasteful).
Change-Id: I105df928f4fb73e7c341218af11903bf1ee33943
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Normally, we should exit a test with a single result:
either a success or a failure. It is, however,
possible to have an early success that forgoes
proper cleanups and cause subsequent failures.
Here, we at least log these cases, because it
could unintentionally hide real failures.
Change-Id: I17e6365bd54b3f7336976fb51437776811733eb8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is compatible with the JavaScript
encodeURIComponent(), which supports
XML embedding.
Change-Id: I38bb64af67789bd5eea3f8f8bdb7f80e313599fb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This guarantees that the jail directory is always
created, especially in case mounting fails and
we cleanup and fallback.
Also, move the directory creation and setting
the perms into a helper, and reuse.
Change-Id: If6e9ef86afa5107638aa27050554e94c0af22b6e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
It seems that on some systems it is possible
to succeed in mounting, but fail to unmount.
This is proving very problematic and it is
best to detect unmount failures and disable
mount-binding altogether.
Change-Id: I6f708b3a1e585dcbd95cced45c668629410562d6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This was a regression introduced in
14d96957cd.
The result was that multi-part logs were
not flushed and therefore not written to
the output.
Change-Id: Ib22a1da83209b00872d91ca05a940226cbb4552d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
...when it's requested.
Previously always an empty string was returned on subsequent
calls, and the error message was only shown once.
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I7645c7770e3e1712c8ef1b3ad145daec14530fb0
Eg. if only the version was changed, config.h was updated, and
everything was recompiled.
New structure, maintain these manually:
config.h.in - for configured variables that are stable if
configuration parameters are unchanged
config_version.h.in - for version/hash related variables
----
config_unused.h.in - still generated by autoheader with all
variables, don't use it
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: Id9a50a9f1e798a3b3814778d8683b7d7cb57bb29
There is a race between the time of modifying
a document, receiving the modified flag, and
saving. This can happen when, for example,
the user modifies the document and closes
immediately. In that case, when uploading
we will not have the modified flag and will
not set the User-Modified attribute.
While this isn't 100% accurate, and it can
never be, it's still better to be conservative
and flag a version in storage as user-modified
than otherwise.
Change-Id: Ia504a7cddd4839bcbfeaaf9bf6c90ed8b68efa91
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When bind-mounting is disabled, we do a best-effort
to unmount any lingering mount-points. This is a
cleanup that helps with leftovers. Here, we
do a debug log level in case the unmounting fails,
and error, otherwise, when bind-mounting is enabled.
Change-Id: I199d6234aebfd84e6be812e5b7d3758273086815
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds support for code-coverage HTML reporting.
To achieve this, we must use file-linking in jails
so that we can update the coverage data (.gcda files)
from the jails. This means that creating jails is
slower than with bind-mounting and we need to
account for that in our timeouts.
We also can't kill child processes with SIGKILL,
which is un-catchable. Instead, we use SIGTERM
and dump the profile data before exiting.
Change-Id: I16fa534f6ed42f7133014d841bb024423315e0a4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Compile-time constants are far superior
to hard-coded magic numbers and they
make changing them trivial. We need that
when we enable profiling.
Change-Id: I9ee42fabf3feb1feecb9b76ebca663007e263680
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Explicit is always better. We also need to
terminate more gracefully when profiling.
Change-Id: I7145cb59583c5d7c6362bbf9c74e9d21799eaa33
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We need to flush and shutdown logging before exiting,
so we can't use _exit/_Exit directly.
In addition, with profiling (e.g. code-coverage) we
must flush the profile data, lest it's all for naught.
Change-Id: I726c5a2f4e699c17dd0d7d5b1c86d856e0118b3c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
- adds two new options
1. localize the dialog
2. change upsell image shown in dialog using proxy handler
- provides all the settings using dynamic configuration
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I7e21c1b31c806c88bf54f891de40f02fa342168f
We now have USR2 signal that dumps the
stack-trace of each process. This is useful for
capturing the state of misbehaving instances.
COOLWSD forwards USR2 to forkit and the kits
so they dump their stacktraces too.
This patch does not change the behavior of USR1.
Specifically, unlike USR2, USR1 is not forwarded
from wsd to frk and the kits. Also unlike USR2,
USR1 dumps into stderr.
Change-Id: I1d82f678f30f430f627692cc42961b1928f69e11
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
SIGUSR2 can now be used to dump the
stacktrace of coolwsd, forkit, and the
kit processes.
Also, support writing signalLog to files.
Although we write to stderr, we normalize
the interface used for signal logging and
allow for writing to any file descriptor.
Change-Id: If6366bb6ddbd9f8863baca52e4f65ebb468dc1f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This replaces the hardcoded STDERR_FILENO
to allow for writing to any file, including
stdout or a redirection to disk, if needed.
Change-Id: I76f6461f46fd4bc035fcf643d01e60c2e3236894
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In preparation to log to a file in the jail.
This will allow for including the log in the
log file, thus capturing all output from our
thread-group into the same log file.
Change-Id: Ia5c4ed35786d28f5d45f3065919d53f2c8492cb0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This simplifies the signal handling setup.
Change-Id: Id121a9df45fc11bfdea627f9828e0b624b1b2284
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is to ensure that libgcc is loaded and
backtrace is available during signal handling.
Change-Id: I5bb36b69401dbedf4c991ba7d60d2e806441a625
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since the value of the loSubPath (i.e. the directory
name of lo within the jail) is a compile-time constant,
there is no reason to pass it around at runtime.
Change-Id: If7457ea7f3e3fe5c42215eed3ce1ce4c8f328f16
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This prepares the way to remove loSubPath
being passed around at runtime, which is
completely unnecessary.
Change-Id: I728629e3cb5eb079add4232543319b89a7dc4a2a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is an internal rename of identifiers.
Child-Root is the top-level, configurable, directory
that stores the jails and related directories/files.
A Jail, by contrast, is the directory that contains
the filesyste tree of a Kit process. That is, it's
the directory that is chroot-ed.
To distinguish the two, we shall use "jail" for
the chroot-ed directory, and "child-root" for the
top-level directory.
Change-Id: Ie38b1c350234b75ddd15beb1c6bcdd2e53a82af0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This avoids problems with watermarking cross-talking betwene view.
Change-Id: Ifecf098423451bf7de3827dfdf9fdc078a06c5c9
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Needs a run-time check to avoid breaking concurrency assumption
during compression.
Change-Id: Icc959693e19b3506497eb1aa198477445085aeb8
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
if host has regex and group has no aliases, when we receive first request from host pattern we considered it as original host and all the host following first request which matches the pattern are considered as aliases
for example:
<group>
<host>https://.*:80</host>
</group>
if we receives first request from asustuf then behaviour will similar to the following config:
<group>
<host>https://asustuf:80</host>
<alias>https://.*:80</alias>
</group>
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I70fb91a4bb7bf38ed79db9efd9fe4bc46db325e1
Apparently for some subset of messages (presumably on busy queues)
we have been double compressing the same tiles ...
Change-Id: I79aea4f2162caa8a5b5660c13ae2cae855d90755
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
No need to complain when bind() didn't fail.
And assert when/if we are going to overflow.
Change-Id: I66f5ff1963c0afc6652afb5a7d017e197d945736
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We have around ~8k smaps lines for each process, polled regularly.
Change-Id: I7e78b17e52aeaec55fa17c5192a940aa9e44b045
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Squashed from feature/deltas-expanded.
TileCache changes:
+ add montonic sequence (wid) numbers to TileData
+ account for sizes of TileData with multiple blobs
+ simplify saving and notifying of tiles
Sends updates (via appendChanges) based on the sequence the
right mix of keyframes and/or deltas required as a single
message, and parse and apply those on the JS side.
We continue to use PNG for slide previews and dialogs,
but remove PngCache - used by document tiles only.
Annotates delta: properly as a binary package for the websocket.
Distinguishes between deltas and keyframes we get from
the Kit based on an initial un-compressed prefix
character which we then discard.
kit can be forced to render a keyframe by oldWid=0
Track invalidity on tiles themselves - to keep the keyframe around.
We need to be able to track that a tile is invalid, and so subscribe
to the updated version as/when it is ready - but we also want to
store the keyframe underneath any deltas.
force rendering of a keyframe for an empty slot in the TileCache.
force tile sequence to be zero for combinedtiles - so the client can
always request standalone tiles with explicit combinedtiles, or tile
requests.
move Blob to Common.hpp
use zero size for un-changed tiles.
remove obsolete render-id, and color deltas in debug mode.
cleanup unit tests for non-png tile results.
Change-Id: I987f84ac4e58004758a243c233b19a6f0d60f8c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
We want to always generate a delta vs. the last state we have so we
move linearly forward into the future.
Change-Id: I730d1dfb125a19e2c48b8f84ad5563664d196ab0
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
We should always set the shutdown flag first.
Otherwise, we run afoul of a race condition.
Change-Id: Ic99793d68b3b943496ff932b4bdafd336fef7f82
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
we added AllHosts to give admin the err log that host is not in alias_groups but now as we removed the host list entries from configuration we don't need that log
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8b5e9e6b7df7df59befb496c12966c7ddc60c707
This avoids the runtime overhead of strrchr used
in logged filenames on iOS, which is unnecessary
on string literals, and adds unit-tests.
We also strip leading './' and '../' in other builds.
Change-Id: I56ec722d1400fad9165eb046d1bd8d4438241ca3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.
This makes the code better organized.
Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And cleanup includes to reduce build time.
Change-Id: If2e242e6688b788b91d62351ef555b31aad1ecde
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
In NDEBUG builds, where there is no assert macro,
we log at debug level to still find issues without
adding noise to the logs.
However, in ENABLE_DEBUG builds not only do we assert
but we also log at error level.
Change-Id: I773dbf7bb2b459e505e73d91505b13d8ed2ed6d8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This primarily combines the string-literals
that form the filename and line number to
reduce four calls to operator<< to only one.
Also fix LOK_ASSERT_STATE to use its argument.
Change-Id: I5e8eeb4f862fe8679b1e1f7a57412dc84dc30e92
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
UTF-8 is expected to encode a code point using 1 to 4 bytes.
Also check that the promised chunks are there before accessing them.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I9b4f346738865fc18242e51a33c97e5b38ee90d8
fix: in regex, escaping special character fails to find host of the alias
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I19bfacc5e45af26832cb8c6a7d249e0c7de56624
Ensure that rendersearchresult: is terminated, and identified as binary.
Change-Id: I84e83c63351cd0aac0923bf7c833b14c1be2c051
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
When the Kit dies and there is no data saved to
disk to upload, there is nothing to do but unload
DocBroker and log the fact.
With unit-test that simulates the situation by
killing the Kit of a modified document.
Change-Id: I7dcc0583c053d7166935d15d045fcf6624e43b4e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds a new config option to enable/disable
experimental features and behavior. The default
value can be controlled at build time by
--enable-experimental.
Change-Id: Iffcb4c71d9e0933a646251b63033b6dadcd3b809
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
For some reason the disk-space check wasn't
done for WOPI storage. Here we add the check
and bubble the exception up to stop loading.
UnitStorage has been updated and re-enabled.
Change-Id: I15a093554b662d6c0828da7683ca0190a8225fc9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now we choose static-libasan vs static-libsan
at configuration time, dynamically. This
enables supporting post clang-9 releases
which do not have libasan.
In addition, clang warns about the order
and visibility of operator<< for the chrono
types. Those are fixed to.
Change-Id: I17f5fc4b3e34464194ad686542935c9f596366e4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The timestamps now helpfully include how
long ago they were.
This also improves the conversion between
chrono clocks by adding generic functions.
Change-Id: I18081330564c8d969b9364cf1b9e33546e241280
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
fetch JSON from remote server and apply new config without restarting coolwsd
- Extended the feature_locked configuration & functionality so that it can be set per wopi host ranges
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Id0e2b4b524a80de88b2b3559dd18c4a95b8163fb
In 'debug' log-level we expect a detailed, but
still readable output. Having one area with
disproportionately large number of logs reduces
the overall utility of the log output.
This patch reduces a number of redundant log
entries, including errors that are already
logged. It also reduces the level of some
others from 'information' to 'debug' and
from 'debug' to 'trace'.
The goal is to make 'debug' level as useful as
possible to read the progress and be able to
understand what was going on, such that one is
able to decide which area to dig deeper into.
Then, trace level could be used to get more
insight into that area, if necessary. For
example, when investigating a test failure,
one first enables 'debug' logs and reads through.
Once a section between two debug entries is
identified as being of interest, enabling 'trace'
level logs becomes more productive as it's
now possible to easily reach the first DBG
entry and read through until the second one.
It's unfortunate that we don't have per-area
control for enabling/disabling logs, so it
is common to see more and more 'debug' log
entries added all around, making logs
less and less readable.
It is also a limitation of the levels we have
that we really only have 3 usable levels:
one, two, many. That is, 'information' for
the most important events, 'debug' for
technical details needed to investigate issues,
and 'trace' for everything else. ('warning'
and 'error' aren't really 'levels'; they have
semantics that makes them special-cases.)
So we have to avoid degrading one into the
other, or have differences without distinction.
If any of these entries are needed to be
displayed more frequently, changing them
back to 'debug' or even 'information' should
be done. Though for me they seem special
cases that don't benefit most log readings.
Change-Id: Id2c6a9dc027483b81a066b0b4b50a298c5eff449
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This adds dumpState to DocumentState, SaveManager,
and StorageManager classes, and dumps all the
missing members.
Also, normalize the format and make it symmetric
and consistent.
Change-Id: Ie0cc8e07d13de60c33d64cd621abf4e815a4ef94
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Use it to create /dev/{u}random devices instead of calling mknod().
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I6ae7842c89255f3f43a8ac7f082a275d5496690a
Now the remaining tests that didn't have a name
get one and the logs are unified between old-
and new-style tests. Mostly.
This makes sure that all logs and assertions
properly log the test name and make test
failures easier to debug and fix.
Change-Id: Id159ffacc81642a6ec594c5143498408adab67cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>