This merges multiple implementations of
assertCorrectThread and simplifies its
usage.
Change-Id: I7be5dea62c6046fb0412d7f885fcbcc4b66e3fd9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Also, don't set webView.configuration.userContentController to nil as it
generates a "nil not allowed" compiler warning.
Signed-off-by: Patrick Luby <plubius@neooffice.org>
Change-Id: Ibb49228a65f102fa6d97d4e5affafae8ad528c0d
Similar code is scattered in the code. This
should help clean them up and make usage
easier.
Change-Id: I02f82c9aa169f591c5688c4b2adca257eecf8221
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>
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 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>
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
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
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>
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>
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
Trying to construct a string using sprintf() and std::stringstream
is unnecessarily complicated for something as simple as this,
and it shows up in my profiling. This commit makes the hex values
change to uppercase because that's what hexFromByte() returns,
but I don't think it matters.
Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
Change-Id: I31c7b8e7cf4c2a495eca0bf03ae4cab53b26a04b
The default behavior of LOK_ASSERT is that of assert,
which is to evaluate the argument(s) multiple times.
This obviously has side-effects, and is therefore
problematic. It seems it's not safe to assume all
uses of assertion is aware of this side-effect.
To prevent side-effect issues, now the LOK_ASSERT
family of macros evaluate the arguments only once.
Change-Id: I5827264ca7fcd77a7d7f5ad787353c6a7beb4fab
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We cleanup all the relevant objects and instances
before exiting the wsd process, however some libraries
may still misbehave and deadlock during this final
cleanup stage. Notably, Poco has been observed to
deadlock during cleaning up the SSL context static
instance (used for the singleton) by waiting on
its internal mutex indefinitely.
Here we exit forcefully after cleaning up.
Change-Id: I76621c1de7f9a4ff918624b3019b9869c08787c2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit f776d87cf595bab084e53202777251a38e482147)
Records the uno commands from different instances of ChildSession and
dumps the last 4 uno commands into the crashlog during a fatal crash
Signed-off-by: Gopi Krishna Menon <krishnagopi487.github@outlook.com>
Change-Id: I838f71769dc08df7076c040f3d72c15f7607e9d3
Using for fuzzing and integration testing.
With unit-tests.
Change-Id: I23f8c619e239310d92c74c4d5e4157afb52a5e56
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
std::atoi() assumes a null-terminated string and our strings are not
always null-terminated. So add a version that takes a length parameter,
this way we don't have to copy strings around.
Also switch to this in http::StatusLine::parse().
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I449b356c1b9948c562434618596e8e3b38656088
To differentiate between non-printable data
and no-data, we use '.' for non-printables
and print nothing visible (i.e. whitespace)
when we run out of data. This makes the hex
dumps more readable.
Change-Id: I8eeb78ab72d63ed613b7c330949063c0cb8cbfca
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
And guard http data dumping with debug directives.
Change-Id: I22a725ba49bfb0399a27889ce9732dfe061e2563
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>