From 9581fe1d7d3bd9efbddb897a279f95ca5dc381d3 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Thu, 9 Feb 2023 19:32:56 -0500 Subject: [PATCH] LibTLS: Remove unused methods Affected methods are: - can_read_line - can_read - read_line --- Userland/Libraries/LibTLS/Socket.cpp | 21 --------------------- Userland/Libraries/LibTLS/TLSv12.h | 4 ---- 2 files changed, 25 deletions(-) diff --git a/Userland/Libraries/LibTLS/Socket.cpp b/Userland/Libraries/LibTLS/Socket.cpp index be0681b28c..b6ec2f5630 100644 --- a/Userland/Libraries/LibTLS/Socket.cpp +++ b/Userland/Libraries/LibTLS/Socket.cpp @@ -32,27 +32,6 @@ ErrorOr TLSv12::read_some(Bytes bytes) return Bytes { bytes.data(), size_to_read }; } -DeprecatedString TLSv12::read_line(size_t max_size) -{ - if (!can_read_line()) - return {}; - - auto* start = m_context.application_buffer.data(); - auto* newline = (u8*)memchr(m_context.application_buffer.data(), '\n', m_context.application_buffer.size()); - VERIFY(newline); - - size_t offset = newline - start; - - if (offset > max_size) - return {}; - - DeprecatedString line { bit_cast(start), offset, Chomp }; - // FIXME: Propagate errors. - m_context.application_buffer = MUST(m_context.application_buffer.slice(offset + 1, m_context.application_buffer.size() - offset - 1)); - - return line; -} - ErrorOr TLSv12::write_some(ReadonlyBytes bytes) { if (m_context.connection_status != ConnectionStatus::Established) { diff --git a/Userland/Libraries/LibTLS/TLSv12.h b/Userland/Libraries/LibTLS/TLSv12.h index f84923869c..54a8400fcd 100644 --- a/Userland/Libraries/LibTLS/TLSv12.h +++ b/Userland/Libraries/LibTLS/TLSv12.h @@ -342,10 +342,6 @@ public: void alert(AlertLevel, AlertDescription); - bool can_read_line() const { return m_context.application_buffer.size() && memchr(m_context.application_buffer.data(), '\n', m_context.application_buffer.size()); } - bool can_read() const { return m_context.application_buffer.size() > 0; } - DeprecatedString read_line(size_t max_size); - Function on_tls_error; Function on_tls_finished; Function on_tls_certificate_request;