1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibTLS: Remove unused methods

Affected methods are:
 - can_read_line
 - can_read
 - read_line
This commit is contained in:
Lucas CHOLLET 2023-02-09 19:32:56 -05:00 committed by Jelle Raaijmakers
parent b46667639f
commit 9581fe1d7d
Notes: sideshowbarker 2024-07-17 18:38:54 +09:00
2 changed files with 0 additions and 25 deletions

View file

@ -32,27 +32,6 @@ ErrorOr<Bytes> 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<char const*>(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<size_t> TLSv12::write_some(ReadonlyBytes bytes)
{
if (m_context.connection_status != ConnectionStatus::Established) {

View file

@ -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<void(AlertDescription)> on_tls_error;
Function<void()> on_tls_finished;
Function<void(TLSv12&)> on_tls_certificate_request;