summaryrefslogtreecommitdiff
path: root/Userland/Services/RequestServer/ConnectionCache.h
AgeCommit message (Collapse)Author
2022-04-09LibCore+RequestServer: Add support for SOCKS5 proxiesAli Mohammad Pur
2022-02-18RequestServer: Bump the ConnectionCache concurrent connection limit to 4Ali Mohammad Pur
With ECDHE, our TLS handshake performance has increased, so we can afford to bump this limit to 4, and get some faster loads :^)
2022-02-11RequestServer: Recreate socket if it reached EOFIdan Horowitz
This ensures we don't continue using a socket that has EOF'ed (meaning the protocol has disconnected in the case of TCP) for new requests.
2022-02-08RequestServer: Avoid Vector OOB access in ConnectionCacheAli Mohammad Pur
`it.is_end()` could be updated to return false for a previously-invalid iterator after we append a new socket, copy its value out to a local variable to not hit this behaviour.
2022-02-06LibCore+Userland: Remove Core::TCPSocket :^)sin-ack
This was deprecated in favor of Core::Stream::TCPSocket, and now has no users.
2022-02-06Userland: Convert TLS::TLSv12 to a Core::Stream::SocketAli Mohammad Pur
This commit converts TLS::TLSv12 to a Core::Stream object, and in the process allows TLS to now wrap other Core::Stream::Socket objects. As a large part of LibHTTP and LibGemini depend on LibTLS's interface, this also converts those to support Core::Stream, which leads to a simplification of LibHTTP (as there's no need to care about the underlying socket type anymore). Note that RequestServer now controls the TLS socket options, which is a better place anyway, as RS is the first receiver of the user-requested options (though this is currently not particularly useful).
2022-01-29Everywhere: Remove redundant inline keywordLenny Maiorani
`constexpr` implies `inline` so when both are used it is redundant.
2022-01-28RequestServer: Replace disconnected sockets in the grace period tooAli Mohammad Pur
We previously only replaced disconnected sockets on the queued-request path, leading to attempts to send requests on a disconnected socket if the disconnection happened in the deletion grace period.
2022-01-22RequestServer+AK: Move happy-path logging behind REQUESTSERVER_DEBUGNico Weber
vdbgln() was responsible for ~10% of samples on pv's flamegraph for RequestServer (under request_did_finish) when loading github.com in Browser and recording a whole-system profile. This makes that almost completely disappear.
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-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-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-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).