Commit graph

33 commits

Author SHA1 Message Date
Michael Meeks
7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Ashod Nakashian
7e1a23f47a wsd: test: helper to wait for any of the given messages
Change-Id: Ice48f59202306134dbafb411b8078f416e56b1c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 09:20:32 +02:00
Ashod Nakashian
756560642f wsd: test: better polling in tests
Shorter waits to break the polling
loop when the test finishes and we
need to terminate.

Change-Id: I79d9d89675d0a37f25a03b265b3ae636a90e57d5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-31 07:40:11 -04:00
Ashod Nakashian
1dd2aba82d wsd: log the socket FD of ProtocolHandlerInterface
Change-Id: I362aca685f79868bdf685695d625a832eee02821
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
8bbf7717db wsd: change message logging level to trace
Messages are high-frequency events and logging
them at debug level is too noisy. Increase the
level to trace.

Debug level should produce legible entries that
outline the main activities, rather than log
each message. That is best done at trace level.

Change-Id: I722ab8b58e0adcab6ecb2f8c571966af0d952051
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 17:33:11 +03:00
Ashod Nakashian
7fa1cff0af wsd: improve various logs
Change-Id: Ib4c0792eeba4da76c800f6afe4737f91c4d319f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:34 -05:00
Ashod Nakashian
78ab6136f7 wsd: test: correct shutdown of WebSocketSession
Change-Id: I7d1aad4c26c4144038b9ed782a0f27454bb02eeb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian
3cbee21ec1 wsd: test: break WebSocketHandler polling when terminating
Change-Id: I0b177a031a8d1115823ad5161d5129aa9447c20f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian
7fb9a0588f wsd: test: killpoco for UnitClose
We now use our http::Socket and SocketPoll
instead of Poco.

Change-Id: I728f9c975b67da76dbbc78e94f1fb5f224c9bc57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian
b972c7e0a1 wsd: test: clang-tidy some args
Change-Id: If9dcbfb2e3eab5617fee60b8f233e400e3d38916
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian
60e64ec8c9 wsd: test: remove COOLWebSocket from WopiTestServer
Change-Id: Ia56c2a7f34503907fb1257b966125e4d94a61645
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Tor Lillqvist
8b6ee5b8bf No need for the template class MessageQueueBase
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ie007344f9a0ffe7fdf767cb9e9069db99aa224b9
2021-07-21 09:54:28 +03:00
Tor Lillqvist
686f1ba1cb Make WebSocketHandler::_isClient const and drop default values for bool parms
Avoiding default values for parameters makes the code easier to read.
Especially true for bool parameters. But sure, just a question of
taste.

Change-Id: I473f70bdfafe3a9ccfb325def8760d78fee7e9a6
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-05 09:03:29 +03:00
Miklos Vajna
656eb310bb Fix Debian 8 / gcc-4.9 warnings
net/HttpRequest.cpp:126:19: error: declaration of 'end' shadows a member of 'this' [-Werror=shadow]

kit/Kit.cpp:163:29: error: missing initializer for member 'statfs::f_bsize' [-Werror=missing-field-initializers]

kit/Kit.cpp:171:14: error: 'OVERLAYFS_SUPER_MAGIC' was not declared in this scope

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibbd35ab5af3adad403ed22a0aeb70917b9e21970
2021-04-30 10:38:09 +02:00
Ashod Nakashian
3decba7eec wsd: specify the minimum bytes we can write to the socket
When writing to the socket, it's always more efficient
to fill the buffer up to the hardware limit for each
write. This is doubly important for efficiency with
SSL, due to the overhead of encrypting multiple
small buffers instead of one large one.

Currently we don't write more than one message
at a time, primarily due to limitations in
the Poco sockets in the unit-tests, which
have a hard time consuming multiple WS frames
with a single poll (subsequent calls to poll
doesn't enter signalled state until new data
arrives, possibly because the data is read and
buffered internally, making the whole scheme
of using poll unreliable and meaningless).

Change-Id: Ic2e2cf1babfb5ab4116efd93f392977ba234d92b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 17:48:23 -04:00
Ashod Nakashian
55309e128d wsd: notify outside the lock
Change-Id: I4b1c693dc561221161768ff0ddc0da5a23d512f2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
b47c81e7a8 wsd: improved WebSocketSession interface
SocketPoll is captured as weak_ptr into
WebSocketSession and a much better shutdown
support is now available. The new logic
can do async-shutdown after flushing and
will do sync-shutdown if SocketPoll is
no longer around.

Change-Id: Ia206cab58a13f20f7aeb3a6d8c57afee731c8231
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
bc38af30dc wsd: safer asyncShutdown in WebSocketSession
Change-Id: I3108a10be7691ed532301dcd42b659bdeb553473
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
0bf5f97b15 wsd: override getPollEvents in WebSocketSession
Change-Id: I3f59e60f74830998739ae03ff1979a784b9cc8fe
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
0fb4cd8bb7 wsd: trap disconnection in WebSocketSession
Change-Id: I519a24d72c3eb8e249450e9a49def077ecf0dc10
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
60344a0052 wsd: support asyncronous shutdown of WebSocketSession
Change-Id: I4c50c718388ae8c790d2e2bb1e3d4db93e92aee5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
7b28fe2d41 wsd: improved WebSocketSession
Change-Id: If3c92b59ae6303079bd544e29cb995ac3e0d6742
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
374f278228 wsd: WebSocketSession isSecure() -> secure()
Change-Id: I3d15414e0527b6651f5e8bce172e15e646003144
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
09f0554891 wsd: http: WebSocketSession supports flexible message polling
Change-Id: Ic8b54e08fdeae4af1713931d96bbe2cd27ee9f4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
4ca35edd8c wsd: log the context in WebSocket Session logs
Useful for debugging, especially for unit-tests.

Change-Id: I820e584203a643a396d26c8817b9af1e750232c7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
fecf32d872 wsd: test: use WebSocketSession::create in unit test
Change-Id: Ib4aecd163237220f80ff9e169c4a463ef2c08983
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
eb2424feb9 wsd: WebSocketSession create helper and shutdown member
Change-Id: I1cdf3f4f763a66972c9c84cec6a80f380ebcc2db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
ec18cefae8 wsd: http: reuse parseUri
Change-Id: Ia54c767e8f63cca9990b54f49ce6ef5a47397496
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
7587ebd84f wsd: http: move WebSocket creation into Request
Change-Id: Idb8251fc07d35a996673f91fcb14d5fd9835a414
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
1190e7f2e0 wsd: improved WebSocket support
Change-Id: Ic1b9464819f5a91df46243c376237d064beeace4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
7b2a0da05b wsd: WebSocketSession handshake and wait for message
With improved test.

Change-Id: I137a35195a81a4d2fbf530be3805e5350cb78644
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
e8705abc96 wsd: new WebSocketSession to createa a WebSocket connection
A utility class to create a WebSocket connection based
on WebSocketHandler, http::Request, and SocketPoll.

Change-Id: I00dfd6fc88e210860e0e378587ef1c0a0a65bb5c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00