Commit Graph

7 Commits

Author SHA1 Message Date
Ali Mohammad Pur
65f7e45a75 RequestServer+LibHTTP+LibGemini: Cache connections to the same host
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-19 21:10:23 +04:30
Max Wipfli
1d990b3e7b LibHTTP: Add HTTP Basic Authentication header generation and parsing
This patch adds two new static methods to HttpRequest.
get_http_basic_authentication_header generates a "Authorization" header
from a given URL, where as parse_http_basic_authentication_header parses
an "Authorization" header into username and password.
2021-06-11 11:37:15 +02:00
Max Wipfli
ce80188d6f LibHTTP: Percent encode/decode request URI
This percent encodes/decodes the request URI when creating or parsing
raw HTTP requests. This is necessary because AK::URL now contains
percent decoded data, meaning we have to re-encode it for creating
raw requests.
2021-06-01 09:28:05 +02:00
Gunnar Beutner
f1dc8e12d2 LibHTTP: Make sure we're not sending an empty path in requests
When the path component of the request URL was empty we'd end up
sending requests like "GET  HTTP/1.1" (note the missing /). This
ensures that we always send a path.
2021-05-17 21:28:00 +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
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00