summaryrefslogtreecommitdiff
path: root/Userland/Services/RequestServer
AgeCommit message (Collapse)Author
2021-12-08LibHTTP: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-06LibIPC: Add IPC::take_over_accepted_client_from_system_server<Client>()Andreas Kling
This is an encapsulation of the common work done by all of our single-client IPC servers on startup: 1. Create a Core::LocalSocket, taking over an accepted fd. 2. Create an application-specific ClientConnection object, wrapping the socket. It's not a huge change in terms of lines saved, but I do feel that it improves expressiveness. :^)
2021-12-05Services: Cast unused IPC::new_client_connection() results to voidSam Atkins
These ones all manage their storage internally, whereas the WebContent and ImageDecoder ones require the caller to manage their lifetime. This distinction is not obvious to the user without looking through the code, so an API that makes this clearer would be nice.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-23LibCore: Make LocalSocket takeover mechanism return ErrorOr<T>Andreas Kling
2021-11-23LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCoreAndreas Kling
With this change, System::foo() becomes Core::System::foo(). Since LibCore builds on other systems than SerenityOS, we now have to make sure that wrappers work with just a standard C library underneath.
2021-11-23RequestServer: Port to LibMain :^)Andreas Kling
2021-11-08RequestServer: Replace Result<T, E> use with ErrorOr<T>Andreas Kling
2021-11-02Services: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-10-24LibIPC: Add missing <signal.h> includeAndreas Kling
2021-10-01RequestServer: Don't hide the SIGINFO state dump behind a debug macroAndreas Kling
Until we're confident that RequestServer doesn't need this runtime debug dump helper, it's much nicer if everyone has it built in, so they can simply send a SIGINFO if they see it acting up.
2021-10-01RequestServer: Ignore preconnect requests for available connectionsAli Mohammad Pur
There's no need to schedule a useless job when the connection is already there and established.
2021-09-30RequestServer: Avoid storing a strong reference to a socket in callbacksAli Mohammad Pur
Unused sockets created by EnsureConnection should not keep the socket around (storing a strong reference will create a reference cycle). This fixes a whole bunch more RS spins.
2021-09-30RequestServer: Use an OwnPtr for the connection cache vectorAli Mohammad Pur
Just as removing individual connections can cause the vector entries to change positions, adding or removing connections to the cache can also move the connections around, which would make it possible for a connection to avoid being deleted (and make the RS spin on the Notifier for that connection). This commit makes it so that no connection cache is left when it's supposed to be deleted. Fixes a few more RS spins.
2021-09-29RequestServer: Use an OwnPtr for cached connectionsAli Mohammad Pur
Otherwise we'd end up trying to delete the wrong connection if a connection made before us is deleted. Fixes _some_ RequestServer spins (though not all...). This commit also adds a small debug mechanism to RequestServer (which can be enabled by turning REQUEST_SERVER_DEBUG on), that can dump all the current active connections in the cache, what they're doing, and how long they've been doing that by sending it a SIGINFO.
2021-09-29RequestServer: Correctly start preconnected TLS socketsAli Mohammad Pur
We need to set the root certificates, and tell the connection cache that the preconnect job finished (otherwise it would spin forever, waiting for us to tell it that).
2021-09-28RequestServer+LibProtocol: Add an 'EnsureConnection' IPC endpointAli Mohammad Pur
This will allow LibWeb (and other components) to request a connection to be premade and cached, to make subsequent loads faster.
2021-09-19LibCore+RequestServer: Ignore callbacks for cancelled network jobsAli Mohammad Pur
Also cancel the jobs when they're destroyed. This makes sure that jobs whose owners have discarded don't end up crashing because of a did_fail().
2021-09-19RequestServer+LibHTTP+LibGemini: Cache connections to the same hostAli Mohammad Pur
This makes connections (particularly TLS-based ones) do the handshaking stuff only once. Currently the cache is configured to keep at most two connections evenly balanced in queue size, and with a grace period of 10s after the last queued job has finished (after which the connection will be dropped).
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-05RequestServer: Exit early to avoid executing protocol destructorsBrian Gianforcaro
I broke this when I made the protocol objects be wrapped by smart pointers to appease static analysis. The Protocol base class currently VERIFY's that it's never called. So to have the best of both worlds until someone actually fixes the code to do proper de-registration, just call `exit(..)` so the smart pointers never go out of scope.
2021-09-01RequestServer: Use smart pointers for allocating protocolsBrian Gianforcaro
2021-08-01Services: Remove unused header includesBrian Gianforcaro
2021-07-03Everywhere: Use IPC include syntaxTimothy
Remove superfluous includes from IPCCompiler's generated output and add include directives in IPC definitions where appropriate.
2021-06-24Userland: Disambiguate dependent typesDaniel Bertalan
Clang produced an error on these pieces of code without the `typename` keyword.
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-05-23RequestServer: Remove unnecessary greet() messageAndreas Kling
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
Since applications using Core::EventLoop no longer need to create a socket in /tmp/rpc/, and also don't need to listen for incoming connections on this socket, we can remove a whole bunch of pledges!
2021-05-10RequestServer: Make the certificate_requested IPC call asynchronousAndreas Kling
It was already being used asynchronously inside RequestServer anyway.
2021-05-03Userland: Use snake case names in .ipc filesGunnar Beutner
This updates all .ipc files to have snake case names for IPC methods.
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-03Userland: Split IPC endpoints into proxies and stubsGunnar Beutner
This enables support for automatically generating client methods. With this added the user gets code completion support for all IPC methods which are available on a connection object.
2021-05-03Userland: Change IPC funcs to use plain arguments instead of a structGunnar Beutner
Instead of having a single overloaded handle method each method gets its own unique method name now.
2021-05-02Userland: Make IPC handlers return void if they don't have any outputsGunnar Beutner
2021-05-02Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlersGunnar Beutner
2021-04-29Everywhere: Use "the SerenityOS developers." in copyright headersLinus Groh
We had some inconsistencies before: - Sometimes "The", sometimes "the" - Sometimes trailing ".", sometimes no trailing "." I picked the most common one (lowecase "the", trailing ".") and applied it to all copyright headers. By using the exact same string everywhere we can ensure nothing gets missed during a global search (and replace), and that these inconsistencies are not spread any further (as copyright headers are commonly copied to new files).
2021-04-25Services: Rename ProtocolServer to RequestServerDexesTTP
The current ProtocolServer was really only used for requests, and with the recent introduction of the WebSocket service, long-lasting connections with another server are not part of it. To better reflect this, this commit renames it to RequestServer. This commit also changes the existing 'protocol' portal to 'request', the existing 'protocol' user and group to 'request', and most mentions of the 'download' aspect of the request to 'request' when relevant, to make everything consistent across the system. Note that LibProtocol still exists as-is, but the more generic Client class and the more specific Download class have both been renamed to a more accurate RequestClient and Request to match the new names. This commit only change names, not behaviors.