From f74131d50a5730f9c7f4ec6596626c7a33f68146 Mon Sep 17 00:00:00 2001 From: devgianlu Date: Sat, 22 Feb 2025 12:42:48 +0100 Subject: [PATCH] LibTLS: Pass socket address as const reference --- Libraries/LibTLS/TLSv12.cpp | 6 +++--- Libraries/LibTLS/TLSv12.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LibTLS/TLSv12.cpp b/Libraries/LibTLS/TLSv12.cpp index 292595b97b0..1d238869f46 100644 --- a/Libraries/LibTLS/TLSv12.cpp +++ b/Libraries/LibTLS/TLSv12.cpp @@ -18,13 +18,13 @@ namespace TLS { ErrorOr> TLSv12::connect(ByteString const& host, u16 port, Options options) { auto tcp_socket = TRY(Core::TCPSocket::connect(host, port)); - return connect_internal(move(tcp_socket), host, options); + return connect_internal(move(tcp_socket), host, move(options)); } -ErrorOr> TLSv12::connect(Core::SocketAddress address, ByteString const& host, Options options) +ErrorOr> TLSv12::connect(Core::SocketAddress const& address, ByteString const& host, Options options) { auto tcp_socket = TRY(Core::TCPSocket::connect(address)); - return connect_internal(move(tcp_socket), host, options); + return connect_internal(move(tcp_socket), host, move(options)); } static void wait_for_activity(int sock, bool read) diff --git a/Libraries/LibTLS/TLSv12.h b/Libraries/LibTLS/TLSv12.h index 2b7613d56f1..015d474b82c 100644 --- a/Libraries/LibTLS/TLSv12.h +++ b/Libraries/LibTLS/TLSv12.h @@ -59,7 +59,7 @@ public: virtual ErrorOr set_blocking(bool block) override; virtual ErrorOr set_close_on_exec(bool enabled) override; - static ErrorOr> connect(Core::SocketAddress, ByteString const& host, Options = {}); + static ErrorOr> connect(Core::SocketAddress const&, ByteString const& host, Options = {}); static ErrorOr> connect(ByteString const& host, u16 port, Options = {}); ~TLSv12() override;