mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibTLS+LibHTTP: Tolerate improperly closed TLS sockets
Some really cursed servers simply drop the TCP socket on the floor when they're trying to close an HTTP connection going through a TLS socket. This commit makes LibTLS tolerate these silly servers, and LibHTTP accept their idea of "EOF == connection closed". Fixes loading wpt.live/acid/acid3/test.html. Note that this means TLSv12::on_ready_to_read can fire with an empty buffer signifying EOF; one test refused this behaviour, and has been changed in this commit.
This commit is contained in:
parent
2d90317c20
commit
06386ab2b5
Notes:
sideshowbarker
2024-07-19 16:49:21 +09:00
Author: https://github.com/alimpfard 🔰
Commit: 06386ab2b5
Pull-request: https://github.com/SerenityOS/serenity/pull/23981
3 changed files with 32 additions and 8 deletions
|
@ -61,11 +61,7 @@ TEST_CASE(test_TLS_hello_handshake)
|
|||
auto tls = TRY_OR_FAIL(TLS::TLSv12::connect(DEFAULT_SERVER, port, move(options)));
|
||||
ByteBuffer contents;
|
||||
tls->on_ready_to_read = [&] {
|
||||
auto read_bytes = TRY_OR_FAIL(tls->read_some(contents.must_get_bytes_for_writing(4 * KiB)));
|
||||
if (read_bytes.is_empty()) {
|
||||
FAIL("No data received");
|
||||
loop.quit(1);
|
||||
}
|
||||
(void)TRY_OR_FAIL(tls->read_some(contents.must_get_bytes_for_writing(4 * KiB)));
|
||||
loop.quit(0);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue