And guard http data dumping with debug directives.
Change-Id: I22a725ba49bfb0399a27889ce9732dfe061e2563
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
A broken loolwsd may be lurking around, which will
then get used during the next `make` invocation to
cleanup the jails. If it fails, it will break the
build altogether. This is not ideal. In this case,
we delete the loolwsd binary so that we force
building it anew. And in any case it was useless
for make, if it failed to do the only thing that
make needs it for: cleaning up the jails.
The new loolwsd will subsequently get used to
clean any left over jails before running the
tests, so that should be fine.
Change-Id: I76c16b5fc7c6f08308c9fb2e619228f8e0266b74
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This makes things more consistent in naming
and in namespace.
Change-Id: I2149c9e0b96eddf9fe2ad1dbc80c932fa7582f84
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This moves WebServerPoll and PrisonerPoll
from the global namespace into LOOLWSD
while converting them to unique_ptr. This
is to manage their lifetimes better and
avoid having out-of-order destruction,
especially with regards to Poco and other
statics that are out of our control.
The PrisonerPoll class had to be renamed
to PrisonPoll because the following is
otherwise invalid:
PrisonerPoll = Util::make_unique<PrisonerPoll>();
Change-Id: Id6c50ebf12ad0f313fea130ffba364beff54f686
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
LOOLWSDServer needs to shutdown its
accept_poll SocketPoll in its destructor,
which may be called after Poco's Logging
subsystem has been destroyed.
Instead of managing the lifetime of
accept_poll member of LOOLWSDServer,
it is safer to manage the lifetime
of LOOLWSDServer itself, and destroy
it in the cleanup stage. This makes
sure that its other members, or indeed
LOOLWSDServer itself, can't have any
late-destoryed objects that can cause
trouble.
The stacktrace for this crash:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff613f801 in __GI_abort () at abort.c:79
#2 0x00007ffff6d51957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff6d57ae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff6d56b49 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff6d574b8 in __gxx_personality_v0 () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff671f573 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7 0x00007ffff671fad1 in _Unwind_RaiseException () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#8 0x00007ffff6d57d47 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x00007ffff6d582dc in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00005555556b6127 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .isra.41] ()
#11 0x0000555555986b94 in Poco::Message::Message(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&, Poco::Message::Priority) ()
#12 0x000055555585ea49 in SocketPoll::~SocketPoll (this=0x555555d13490 <srv+16>, __in_chrg=<optimized out>) at net/Socket.cpp:145
#13 0x000055555575d794 in TerminatingPoll::~TerminatingPoll (this=0x555555d13490 <srv+16>, __in_chrg=<optimized out>) at ./net/Socket.hpp:832
#14 LOOLWSDServer::AcceptPoll::~AcceptPoll (this=0x555555d13490 <srv+16>, __in_chrg=<optimized out>) at wsd/LOOLWSD.cpp:3766
#15 LOOLWSDServer::~LOOLWSDServer (this=0x555555d13480 <srv>, __in_chrg=<optimized out>) at wsd/LOOLWSD.cpp:3640
#16 0x00007ffff6142041 in __run_exit_handlers (status=0, listp=0x7ffff64ea718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#17 0x00007ffff614213a in __GI_exit (status=<optimized out>) at exit.c:139
#18 0x0000555555753658 in LOOLWSD::innerInitialize (this=<optimized out>, self=...) at wsd/LOOLWSD.cpp:1213
#19 0x0000555555789527 in LOOLWSD::initialize (this=<optimized out>, self=...) at wsd/LOOLWSD.hpp:439
#20 0x00005555558e1964 in Poco::Util::Application::run() ()
#21 0x00005555556b6d74 in main (argc=3, argv=0x7fffffffe4f8) at wsd/LOOLWSD.cpp:4286
Change-Id: I28ea6215ce49c752cbb90bc33269ab3b662accf1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The lifetime management of static objects
is extremely unpredictable and depends on
many variables outside of our control or
even reliable reproducibility.
Complex static objects that own threads
and other objects are doubly problematic
because of their dependency and/or
interaction with other objects.
Here we replace the static DelayPoll
instance with one we control its lifetime
in the LOOLWSD main body, such that it
is destroyed properly.
Specifically, DelayPoll's dtor was
accessing Poco's Logging subsystem out of
order. That is, after Poco had been
destroyed.
Another advantage to this approach is that
we don't even create the DelayPoll at all
if we don't need it. The onus now is on
the user of DelayPoll to make sure they
create a Delay object with a long-enough
lifetime to encompase it use.
For completeness, here is the stacktrace:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff613f801 in __GI_abort () at abort.c:79
#2 0x00007ffff6d51957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff6d57ae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff6d56b49 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff6d574b8 in __gxx_personality_v0 () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff671f573 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7 0x00007ffff671fad1 in _Unwind_RaiseException () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#8 0x00007ffff6d57d47 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x00007ffff6d582dc in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00005555556b5927 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .isra.41] ()
#11 0x0000555555982a14 in Poco::Message::Message(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&, Poco::Message::Priority) ()
#12 0x000055555585a909 in SocketPoll::~SocketPoll (this=0x555555d10f60 <DelayPoll>, __in_chrg=<optimized out>) at net/Socket.cpp:145
#13 0x00007ffff6142041 in __run_exit_handlers (status=0, listp=0x7ffff64ea718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#14 0x00007ffff614213a in __GI_exit (status=<optimized out>) at exit.c:139
#15 0x0000555555752d78 in LOOLWSD::innerInitialize (this=<optimized out>, self=...) at wsd/LOOLWSD.cpp:1213
#16 0x0000555555788b07 in LOOLWSD::initialize (this=<optimized out>, self=...) at wsd/LOOLWSD.hpp:432
#17 0x00005555558dd7e4 in Poco::Util::Application::run() ()
#18 0x00005555556b6574 in main (argc=2, argv=0x7fffffffe528) at wsd/LOOLWSD.cpp:4276
Change-Id: Ifda55fe869fa6734b9c2490da4497d2551ac21c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Makes it accessible to more code.
Change-Id: I73dd1895defe47ae40873b6155203768055206ec
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Allow dragging event even when the mouse is outside the document.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I2b871e9a7556b465d55aa0d1b50ac9f489246d17
In commit 64dc25f70 a new branch of coordinate transformation was
introduced to avoid breaching the coordinate limits supported by
canvasRenderingContext2D.transform(). But this caused additional burden
on testers by forcing them to test all branches and made the code harder
to maintain.
It is straighforward to implement the features of
transform()/translate() that we need and use them always and not rely on
those apis. This is what the patch implements.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: If690a254b44fb4e6ca9a5536785de6f3310413d8
there are no freezes active and view is anchored on A1.
Description of the fixed issue:
Open a blank sheet in mobile Calc. Make sure the cell A1 is
full visible, place cell cursor on A1 and zoom in a bit. The cursor
rectangle now is drawn incorrectly over the headers for every zoom
animation frame.
Description of the fix:
The root cause is that the clip area in this situation is incorrectly
set since the conditional assumes that the pane is a fixed one as its
top left is (0, 0) which is not correct when there are no active
freeze.So set the clip area to the correct rectangle derived from the
computed transformation like it is done for any free-pane.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I827e7992acaa56e60e1938fc83b566d7adb8a30c
"Specifies whether the macro execution is enabled in
general. This will disable Basic, Beanshell, Javascript
and Python scripts. If it is set to false, the
macro_security_level is ignored. If it is set to true,
the mentioned entry specified the level of macro security".
Change-Id: I4bc5b690268a93994d17e2b02b7b60b6398646b7
Signed-off-by: Henry Castro <hcastro@collabora.com>
- Add proper html structure
- Add style to communicate that his is a empty state and thus different
from the regular mobilewizard view
- Add icon
- Fix alignments and sizes
- Add suggestion as action (insert comment)
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I9815efe1a5b96862dba9d0e4c5863b5975132596
The clipboard content is handled by the DocBroker,
if it it's available, otherwise, we fallback to the
cached clipboard entries.
When DocBroker has already terminated polling and
is no longer valid, we may end up using it for
the clipboard. In this case, we don't send anything
back, since there is no SocketPoll thread to
process the request or the socket data plumbing.
We avoid this by simply using the fallback (cache)
when we don't have a valid DocBroker.
Change-Id: Idf7f27b453605d173dd8e40d4a5d101f50355468
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Especially error reporting is now better.
Change-Id: I032f6e8403660c2ac24be2d80b53b63831ec1066
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When we fail to read any data from the WS,
'bytes' is -1 and is unsuitable for creating
a std::string instance from, as it throws.
Make failure in this case more informative
with proper assertion.
Change-Id: I8966b922aa0053502c58b528005602193b0593c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The issue is: On creating a page break on a empty writer file and
hitting backspace, the deleted page or parts of it is still rendered.
We get a 'status' message containing the document size every time it
changes. So avoid the issue do not draw tiles that are not within the
document area.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I88d1715e861f068326d28d2930d01e3b5355be02
canvasRenderingContext2D.translate() and friends only seem to function
with numbers < 2^24, at least on Chrome 89.
So when the pane being drawn where this limit is hit, lets do the
translation ourselves.
But in the case of zoom-animation more complicated transformations are
needed. Till we implement the manual matrix transformations correctly,
lets not animate overlay objects when the view area has hit this limit.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib48d6029ba1c6f1d7ade35060baf4ebe3e0a5fd3
- Position the number of replies near to the chevron to indicate what
that is supposed to do.
- Reply counter gets the same color as its icon
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Idd692f40f5f3420d7577147e8ca7bcf306e59899
The view area after zoom is computed by the following rules:
1. If there are not edit cursors or it is out of view, anchor on the
top left cell.
2. Else, compute the new view area w.r.t top left cell, but if the edit
cursor is not in that resulting area, translate it such that edit cursor
is just inside the closest edge of the final view rectangle.
Notes:
As part of the implementation the default behaviour of view scrolling on
cursor msg was disabled while the new view area is being set.
If there was an active edit cursor to start with, ensure it remains the
same way. This is acheived by replaying the last print twips cursor
messages after the new view area is set.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Iaada6ec1f4a06f7ad05dec759e702bd37240dff8
by setting a top padding of right amount.
Before the patch the top border of toolbar "appear" white on the part that
intersects with row-headers and it was gray where it intersects with the
document content(tiles). These were due to the background of body and
tile-pane div respectively.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ia3b95d41ea150d815469498e3e2044d7e1d36a4d
(cherry picked from commit 66416be43980205dea1a2addefbf5954e013c3cc)
When CellCursor command result arrives we focused
the document what caused annotation closing.
Change-Id: Idf2eb8c5b3b0049dd0aeb7c82cca80083b304698
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>