From c3167afa3a2446e7e48aa0a4c6c4cf14ec06e9ec Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Wed, 3 Jan 2024 16:27:05 +0330 Subject: [PATCH] LibTLS: Notify the client for app data as soon as some data is available Previously we were waiting until the socket was no longer immediately readable to notify the client, resulting in large buffers and longer latency. --- Userland/Libraries/LibTLS/Record.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibTLS/Record.cpp b/Userland/Libraries/LibTLS/Record.cpp index 23fd488601..f2b4fcb494 100644 --- a/Userland/Libraries/LibTLS/Record.cpp +++ b/Userland/Libraries/LibTLS/Record.cpp @@ -502,6 +502,8 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer) payload_res = (i8)Error::DecryptionFailed; auto packet = build_alert(true, (u8)AlertDescription::DECRYPTION_FAILED_RESERVED); write_packet(packet); + } else { + notify_client_for_app_data(); } } break;