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:
parent
b46667639f
commit
9581fe1d7d
Notes:
sideshowbarker
2024-07-17 18:38:54 +09:00
Author: https://github.com/LucasChollet
Commit: 9581fe1d7d
Pull-request: https://github.com/SerenityOS/serenity/pull/19764
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/shannonbooth
2 changed files with 0 additions and 25 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue