1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibTLS: Mark the underlying stream as nonblock

LibTLS does not want to be blocked.
This commit is contained in:
Ali Mohammad Pur 2022-04-07 02:16:56 +04:30 committed by Andreas Kling
parent e2f1da8cec
commit bd5403adf1

View file

@ -95,7 +95,7 @@ ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(String const& host, u16 port, Opt
ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(String const& host, Core::Stream::Socket& underlying_stream, Options options) ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(String const& host, Core::Stream::Socket& underlying_stream, Options options)
{ {
StreamVariantType socket { &underlying_stream }; TRY(underlying_stream.set_blocking(false));
auto tls_socket = make<TLSv12>(&underlying_stream, move(options)); auto tls_socket = make<TLSv12>(&underlying_stream, move(options));
tls_socket->set_sni(host); tls_socket->set_sni(host);
Core::EventLoop loop; Core::EventLoop loop;