1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

LibTLS: Only try to flush data when needed

This patchset drops the write notifier, and schedules writes only when
necessary.
As a result, the CPU utilisation no longer spikes to the skies :^)
This commit is contained in:
AnotherTest 2020-05-19 19:03:57 +04:30 committed by Andreas Kling
parent 41da1a4336
commit 379cb061d7
3 changed files with 64 additions and 56 deletions

View file

@ -375,6 +375,9 @@ private:
void build_random(PacketBuilder&);
bool flush();
void write_into_socket();
bool check_connection_state(bool read);
ssize_t handle_hello(const ByteBuffer& buffer, WritePacketStage&);
ssize_t handle_finished(const ByteBuffer& buffer, WritePacketStage&);
@ -463,7 +466,7 @@ private:
OwnPtr<Crypto::Cipher::AESCipher::CBCMode> m_aes_local;
OwnPtr<Crypto::Cipher::AESCipher::CBCMode> m_aes_remote;
RefPtr<Core::Notifier> m_write_notifier;
bool m_has_scheduled_write_flush = false;
};
namespace Constants {