Commit Graph

8 Commits

Author SHA1 Message Date
Ali Mohammad Pur
51c2c69357 AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
2021-06-06 00:27:30 +04:30
DexesTTP
812875bc89 LibWebSocket: Fixed occasional infinite loop with TLS sockets
This was caused by a double notifier on the TLS socket, which caused
the TLS code to freak out about not being able to read properly. In
addition, the existing loop inside of drain_read() has been replaced by
code that actually works, and which includes new warnings when the
drain method is called before initialization is done or after the
websocket gets closed.
2021-05-18 08:07:56 +02:00
Linus Groh
0aab774343 Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
DexesTTP
62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
DexesTTP
c11ca9df33 LibWebSocket+telws: Use my own copyright headers :^)
Since I guess I'll start attributing my own code, might as well change
it for the previously written WebSocket code too !
2021-04-25 19:04:34 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
DexesTTP
d3a89ce737 LibWebSocket: Add a new websocket library
This library currently contains a basic WebSocket client that can
handle both standard TCP websockets and TLS websockets.
2021-04-18 22:42:10 +02:00