1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibTLS: "Properly" handle the server dropping the connection

Contrary to popular belief, not every implementation of TLS follows the
specs.
Some of them just drop the connection without sending a proper
close_notify, and we should handle that gracefully.
This commit is contained in:
AnotherTest 2020-05-03 21:26:23 +04:30 committed by Andreas Kling
parent 8aeccf4f02
commit b028a123b8
3 changed files with 42 additions and 30 deletions

View file

@ -50,6 +50,7 @@ private:
RefPtr<TLS::TLSv12> construct_socket() { return TLS::TLSv12::construct(this); }
void on_socket_connected();
void finish_up();
void read_body(TLS::TLSv12&);
enum class State {
InStatus,
@ -66,6 +67,7 @@ private:
Vector<ByteBuffer> m_received_buffers;
size_t m_received_size { 0 };
bool m_sent_data { false };
bool m_queued_finish { false };
};
}