Commit graph

124 commits

Author SHA1 Message Date
Pranam Lashkari
8b349716eb killpoco: removed Poco::Process completely
Change-Id: Iba67abf9342c11517c69c1d94903bf4752aa87d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83770
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-29 14:27:54 +02:00
Ashod Nakashian
df6d942d08 wsd: harden socket weakptr
Weak pointers can be null and must be
checked before using. This fixes at least
one segfault and prevents a number of others.

Also, minimizes locking of weak pointers
in the message handlers.

Change-Id: I306501c26c3441d7bd6812d51fa17e7356126f32
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92828
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-04-24 15:39:17 +02:00
Michael Meeks
3e4ac31c7c killpoco: remove WebSocket includes from a couple of places.
Change-Id: I06740cd978bec8e6a74beb8ed9ef8f4f970a2535
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92470
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-18 18:29:04 +02:00
Tor Lillqvist
4eb598711c Use #pragma once
LibreOffice core uses that, too, and we support an even more
restricted set of compilers.

Change-Id: I0d0e2c8608e323eb5ef0f35ee8c46d02ab49a745
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92467
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-18 15:00:18 +02:00
Michael Meeks
28a9c4dc05 Poll - cleanup method naming, and fix merge issues.
This mends several problems from commit
5710c86323.

Change-Id: I1b29f29ca81679608a2692488fa1ef22b2e62dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92032
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 13:58:00 +02:00
Michael Meeks
5710c86323 Poll - switch to ppoll for closer to microsecond accuracy.
Change-Id: Ib8a2bb6f60302df8631edadbbb8db626894c457c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92000
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 10:06:23 +02:00
Pranam Lashkari
fba0be787f killpoco: removed Poco::Thread from tools directory
Change-Id: I3fc4a04c62a064eaefd5c31452abc4a7fe100fb4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83224
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-08 17:22:10 +02:00
Michael Meeks
e924625cc1 re-factor: Socket / WebSocketHandler.
Essentially we want to be able to separate low-level socket code
for eg. TCP vs. UDS, from Protocol handling: eg. WebSocketHandler
and client sessions themselves which handle and send messages
which now implement the simple MessageHandlerInterface.

Some helpful renaming too:

s/SocketHandlerInterface/ProtocolHandlerInterface/

Change-Id: I58092b5e0b5792fda47498fb2c875851eada461d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90138
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-03-11 16:48:03 +01:00
Miklos Vajna
a7d3efdd4e Introduce StringVector::equals()
Allows comparing tokens with C strings without a heap allocation. Do the
same when comparing two tokens from two different StringVectors.

And use it at all places where operator ==() has an argument, which is a
StringVector::operator []() result.

Change-Id: Id36eff96767ab99b235ecbd12fb14446a3efa869
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90201
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-03-09 09:46:33 +01:00
Miklos Vajna
797c996c56 Fix -Werror,-Woverloaded-virtual warnings
Probably these were just not adapted by accident in commit
f70e627795 (WebSocket - simplify
handleMessage for now., 2020-03-05).

Change-Id: I578d95d938c0c466e9547dcda3d2b297dc347a34
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90076
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-06 11:31:43 +01:00
Miklos Vajna
b8bd1990aa Rework LOOLProtocol::tokenize() to return a StringVector object
The bulk of this commit just changes std::vector<std::string> to
StringVector when we deal with tokens from a websocket message.

The less boring part of it is the new StringVector class, which is a
wrapper around std::vector<std::string>, and provides the same API,
except that operator[] returns a string, not a string&, and this allows
returning an empty string in case that prevents reading past the end of
the underlying array.

This means in case client code forgets to check size() before invoking
operator[], we don't crash. (See the ~3 previous commits which fixed
such crashes.)

Later the ctor could be changed to take a single underlying string to
avoid lots of tiny allocations, that's not yet done in this commit.

Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-28 16:07:56 +01:00
Michael Meeks
9126a641a9 test: switch to using ClientPortNumber to allow parallelism.
Change-Id: Ifef3bce1b217605000300b240ea74df4d264e0df
2020-01-21 15:07:54 +00:00
Miklos Vajna
d0fee8c6ad These can be made const
Change-Id: I952a7566176bda727f8c2e9618d41bfb7bb1240f
Reviewed-on: https://gerrit.libreoffice.org/85197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-16 09:24:08 +01:00
Pranam Lashkari
aabb5b0633 killpoco: removed StringTokenizer from tools directory
removed use of Poco::StringTokenizer from the tools directory using LOOLProtocol::tokenize and std::vecor<std::string>

Change-Id: I0673e658fd35cbdc7425a99f1dcea0b54923f52c
Reviewed-on: https://gerrit.libreoffice.org/82568
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-13 09:43:10 +01:00
Jan Holesovsky
5b5e29b430 killpoco: Don't use POCO for app exit values.
Change-Id: I2948ac45a7b4243f7afde08d5245530fdbf9a070
Reviewed-on: https://gerrit.libreoffice.org/82125
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-11-07 12:23:47 +01:00
DarkByt31
8aea22a32b tdf#107038 Poco::Timestamp replacement with std::chrono
Replaced Poco::DateTimeFormatter with Util::getHttpTimeNow

Change-Id: I1a8591a434140270929406386218d08c71a888cc
Reviewed-on: https://gerrit.libreoffice.org/78700
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-09-06 13:25:41 +02:00
Ashod Nakashian
159e6d0f72 looltool: support anonymizing strings
The user is able to override the salt,
or use the one from the config file.

Change-Id: Ida634374549fb490ec2437f557d46c44d4760c56
Reviewed-on: https://gerrit.libreoffice.org/70036
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71094
2019-08-17 04:28:49 +02:00
Ashod Nakashian
32007cbb32 Update LOK headers and reuse callback-type-to-string helper
Also, avoid repeatedly converting INT_MAX to string.
It's an arbitrary large number, so use 1 billion,
which is probably more easily recognizable as an
arbitrary large number.

Change-Id: Ie6f898d6e8978efa29c355f3cb50b60114870f0d
Reviewed-on: https://gerrit.libreoffice.org/77593
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-17 03:38:08 +02:00
Tomaž Vajngerl
cc70602939 tdf#122529 Support for table overlay - column/row change markers
This adds table markers for resizing rows and columns if the user
has the table selected or the cursor is in the table. The code
reacts to the callback "tableselected:", where the markers are
created for each column and row, if the payload (json) of course
has any data. When the marker is dragged, a uno command to resize
the table column or row border is send to the core.

Change-Id: I9b21d09639c1b2be70a1a897f9e3340b453d847e
Reviewed-on: https://gerrit.libreoffice.org/77360
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-08-15 05:16:04 +02:00
Tomaž Vajngerl
42c4c864fe tdf#125425 add cell selection markers and cell auto fill marker
This replaces the standard text selection marker with a cell
selection markers to resize the cell selection. This looks and
behaves better for cells in Calc and it is also easier to deal
with.

Additionally add auto fill marker to perform the auto fill action
on the cells. This was not possible to do previously unless you
hit an invisible part of the cell selection, which is not
convenient when using touch.

Change-Id: Ia02d03b7b8e8d98412ea98eb92fb47d1505ef979
Reviewed-on: https://gerrit.libreoffice.org/76494
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-29 08:51:55 +02:00
Jan Holesovsky
3a03f50784 Revert "Adapt paths to new package name"
It is not a good idea to change the configuration directory, it will affect all the existing installations.

And the service is called loolwsd - so the configuration should be called that way too.

This reverts commit 9278574289.

Change-Id: I7e6eee644e21ad2dd842742585d16133ff8e36c9
Reviewed-on: https://gerrit.libreoffice.org/72730
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 12:06:06 +02:00
Samuel Mehrbrodt
9278574289 Adapt paths to new package name
After 1dbbc5acc7

Change-Id: I64a12fb13bc8f9371821b2d5969941bfddc2514a
Reviewed-on: https://gerrit.libreoffice.org/72728
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 10:27:33 +02:00
Michael Meeks
729c124b3b perftrace: consume PROFILE_FRAME messages and chart lok ProfileZones.
Also - enable performance tracing in the kit when we're logging at
trace level.

Change-Id: I838e8d7769b0ead8508c4482c58e0e2564dcee91
2019-04-16 20:27:37 +01:00
Miklos Vajna
6d57f0a005 net: make members private in DelaySocket
Change-Id: I5970d55f0723e46892ed5bea87bb79376c7ea530
2019-01-17 08:46:11 +01:00
Miklos Vajna
e1adc6ff17 tools: make members private in Config
Change-Id: I3127d0d1f460ea535295fbf8dc2bb1856b1c2ff8
2019-01-16 08:59:45 +01:00
Miklos Vajna
51adedfa67 tools: make members private in Connect
It was not used externally.

Change-Id: Ie96af8aa4c72efc17c40f453ce200e520d954365
2019-01-15 09:35:20 +01:00
Miklos Vajna
6bc1fa6215 tools: make members private in AddrSpace
Only _addrToStr needed a getter, the rest is not used externally.

Change-Id: Ie1c0f860c6aa0acc26c8c7272298225a4804a5e5
2019-01-14 08:44:04 +01:00
Miklos Vajna
6c8af8091f tools: make members private in StringData
Change-Id: I6c080264d2c66abdb6760c190f3727dd0159c865
2019-01-11 09:08:44 +01:00
Miklos Vajna
5391c09fba tools: make members private in Map
Change-Id: I9f23d5095e387888e43c0a0d2e6ed041ac5aed68
2019-01-10 09:11:55 +01:00
Samuel Mehrbrodt
c377ca3fb2 loolconfig: Only show "config updated" message when something was changed
Change-Id: I2d2b1e4b57cccbbe6f5608f0468bc9dfed3fd120
Reviewed-on: https://gerrit.libreoffice.org/65997
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-01-09 10:45:06 +01:00
Miklos Vajna
a725fea9fa Replay: make members private
Only some members neded only read-only access.

Change-Id: I8c90f315e8b946a6ce5fd8aec966d59a4b62383c
2019-01-07 08:34:07 +01:00
Miklos Vajna
32f4dd371d Stress: make members private
No external code used those members, so makes little sense to have them
as public.

Change-Id: I893dca4a42b83e0835829889d35fe3c756b97f96
2019-01-04 09:03:38 +01:00
Miklos Vajna
f204ff2333 Tool: make members private
Some of the members were not used externally at all, others were just
read-only externally.

Change-Id: I8fbe5c9c027e7d0adf516b311aafb6b66134776e
2019-01-03 09:05:36 +01:00
Miklos Vajna
a65a528220 TraceFileRecord: make members private
Change-Id: Ie83077b248185d7748423f512b7b61b4945bd779
2018-12-19 09:12:36 +01:00
Andras Timar
96760c5e43 ask for username (default to 'admin' if nothing set) with 'loolconfig set-admin-password'
Change-Id: I04bf3d225e4149ed69bc55e14d1ced1dd3f8f7ea
2018-11-13 14:32:37 +01:00
Jan Holesovsky
efe291c320 Notify about the editing context.
And also:

* Hint the compiler to warn about the missing callbacks.
* Add few missing ones.
* Update the bundled headers.

Change-Id: I8d31363eaaea289e8a517c0b9b1142b33ce3027e
2018-11-12 18:10:57 +01:00
Miklos Vajna
bf9df8d2bd Fix -Werror,-Wswitch warning
Change-Id: Id6d25955ee99d0c547d92cfbea407135a75ca47b
2018-11-09 09:20:44 +01:00
Tomaž Vajngerl
852ed5d981 handle signature status and prepare document signing in WSD
This adds handling of signature status (manually request for the
status or as a callback) in WSD.

In addition prepare support for signing of document, but don't yet
trigger the actual LOKit function (needs the JS building blocks
set up first to know how to handle the payload - certificate and
private key)

Change-Id: Ic76baa5847bb52adde616338187d5979e0093c6d
Reviewed-on: https://gerrit.libreoffice.org/62533
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-09 09:06:02 +01:00
Miklos Vajna
4724aa0cf7 Socket: do what the TODO says
Drop the list of friends and just add getters for the relevant
members.
2018-10-25 16:39:02 +02:00
Ashod Nakashian
63c3fce2c6 wsd: clang-format logging macros and pass logger explicitly
Change-Id: I37e7f4b5687b64b36e0985942627a4b84a8249eb
2018-10-16 20:12:23 -04:00
Miklos Vajna
ec008efd73 tools: remove unused Poco::Util::Option include / using decl 2018-07-20 10:23:48 +02:00
Tor Lillqvist
c852d9340b Fix the help message after my option handling changes last night
Change-Id: I9cc869b9957236803d41f3495eb1a444fa8ebad1
2018-07-11 11:35:59 +03:00
Tor Lillqvist
42e6a1e96d Make the loolconvert tool compatible with libreoffice --convert-to
Accept the same options, as applicable. Ignore irrelevant options
(like -env:userInstallation or --headless, but actually just ignore
anything we don't need). Handle options manually so that we can accept
them also with just one dash.

Drop superfluous verbosity. Succeed silently, as is The Unix
Philosophy (haha).

Change-Id: I05793b11886f61955db4746b864be97a6bef5674
2018-07-11 01:29:57 +03:00
Tor Lillqvist
bc0f76d6ad It's /lool/convert-to, not /convert-to
(But it doesn't seem to work anyway any more.)

Change-Id: I53261cd24d945dc47e156ff16240679beeb85f6a
2018-07-10 23:14:51 +03:00
Tor Lillqvist
73dbf27ede The std::string compare() method is like strcmp(): it returns 0 on equality
Change-Id: I4d080afd98419cbdaa531cc6f2c306533bbc1737
2018-07-10 23:14:51 +03:00
Tor Lillqvist
c783485a3b The option is called "server" and not "uri"
(It's the parameter of that option that is called "uri".)

Change-Id: If247a932bf8879b4eb626d850e813c3e8d5a7d60
2018-07-10 23:14:51 +03:00
Tor Lillqvist
b7de2865dc Fix warning: private field '_isSSL' is not used [-Werror,-Wunused-private-field]
Change-Id: Iddf8ac7f0afa85559b03b980a558d9a4fd058473
2018-06-01 16:42:37 +03:00
Jan Holesovsky
93cc4b4548 Use std::shared_ptr consistently.
Change-Id: I6bf3ff7de47010fd78fab26a5a318bde21c1f153
2018-05-18 15:16:40 +02:00
Jan Holesovsky
82f2f2711b websocketdump: Read the port and ssl support from the config.
Change-Id: Ifc4566d5e1f2cdba1fd4bd7d53b359d81604083b
2018-05-18 15:16:40 +02:00
Michael Meeks
5a94614217 Enable SSL in outbound, client websockets ...
Switch SSL context creation to be generic rather than pure server.

Change-Id: I1b750b4ddc8c607381f5541a4f4412fa16e457d4
2018-05-18 15:16:39 +02:00