summaryrefslogtreecommitdiffstats
path: root/net/WebSocketSession.hpp
Commit message (Collapse)AuthorAgeFilesLines
* rename: remaining lool->cool changesAndras Timar2021-11-181-3/+3
| | | | | Signed-off-by: Andras Timar <andras.timar@collabora.com> Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
* No need for the template class MessageQueueBaseTor Lillqvist2021-07-211-1/+1
| | | | | Signed-off-by: Tor Lillqvist <tml@collabora.com> Change-Id: Ie007344f9a0ffe7fdf767cb9e9069db99aa224b9
* Make WebSocketHandler::_isClient const and drop default values for bool parmsTor Lillqvist2021-05-051-1/+1
| | | | | | | | | 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>
* Fix Debian 8 / gcc-4.9 warningsMiklos Vajna2021-04-301-6/+6
| | | | | | | | | | | 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
* wsd: specify the minimum bytes we can write to the socketAshod Nakashian2021-04-271-3/+3
| | | | | | | | | | | | | | | | | | | | | 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>
* wsd: notify outside the lockAshod Nakashian2021-04-271-5/+11
| | | | | Change-Id: I4b1c693dc561221161768ff0ddc0da5a23d512f2 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: improved WebSocketSession interfaceAshod Nakashian2021-04-271-24/+67
| | | | | | | | | | | | 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>
* wsd: safer asyncShutdown in WebSocketSessionAshod Nakashian2021-04-271-6/+19
| | | | | Change-Id: I3108a10be7691ed532301dcd42b659bdeb553473 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: override getPollEvents in WebSocketSessionAshod Nakashian2021-04-121-0/+9
| | | | | Change-Id: I3f59e60f74830998739ae03ff1979a784b9cc8fe Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: trap disconnection in WebSocketSessionAshod Nakashian2021-04-111-0/+31
| | | | | Change-Id: I519a24d72c3eb8e249450e9a49def077ecf0dc10 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: support asyncronous shutdown of WebSocketSessionAshod Nakashian2021-04-111-6/+10
| | | | | Change-Id: I4c50c718388ae8c790d2e2bb1e3d4db93e92aee5 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: improved WebSocketSessionAshod Nakashian2021-04-111-10/+53
| | | | | Change-Id: If3c92b59ae6303079bd544e29cb995ac3e0d6742 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: WebSocketSession isSecure() -> secure()Ashod Nakashian2021-04-111-2/+2
| | | | | Change-Id: I3d15414e0527b6651f5e8bce172e15e646003144 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: http: WebSocketSession supports flexible message pollingAshod Nakashian2021-04-111-8/+26
| | | | | Change-Id: Ic8b54e08fdeae4af1713931d96bbe2cd27ee9f4d Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: log the context in WebSocket Session logsAshod Nakashian2021-04-111-12/+12
| | | | | | | Useful for debugging, especially for unit-tests. Change-Id: I820e584203a643a396d26c8817b9af1e750232c7 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: test: use WebSocketSession::create in unit testAshod Nakashian2021-04-111-1/+1
| | | | | Change-Id: Ib4aecd163237220f80ff9e169c4a463ef2c08983 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: WebSocketSession create helper and shutdown memberAshod Nakashian2021-04-111-0/+30
| | | | | Change-Id: I1cdf3f4f763a66972c9c84cec6a80f380ebcc2db Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: http: reuse parseUriAshod Nakashian2021-04-111-37/+12
| | | | | Change-Id: Ia54c767e8f63cca9990b54f49ce6ef5a47397496 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: http: move WebSocket creation into RequestAshod Nakashian2021-04-111-29/+2
| | | | | Change-Id: Idb8251fc07d35a996673f91fcb14d5fd9835a414 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: improved WebSocket supportAshod Nakashian2021-04-111-1/+1
| | | | | Change-Id: Ic1b9464819f5a91df46243c376237d064beeace4 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: WebSocketSession handshake and wait for messageAshod Nakashian2021-04-111-9/+49
| | | | | | | With improved test. Change-Id: I137a35195a81a4d2fbf530be3805e5350cb78644 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: new WebSocketSession to createa a WebSocket connectionAshod Nakashian2021-04-111-0/+202
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>