mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
LibTLS: Remove unused methods
Affected methods are: - can_read_line - can_read - read_line
This commit is contained in:
parent
b46667639f
commit
9581fe1d7d
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 };
|
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)
|
ErrorOr<size_t> TLSv12::write_some(ReadonlyBytes bytes)
|
||||||
{
|
{
|
||||||
if (m_context.connection_status != ConnectionStatus::Established) {
|
if (m_context.connection_status != ConnectionStatus::Established) {
|
||||||
|
|
|
@ -342,10 +342,6 @@ public:
|
||||||
|
|
||||||
void alert(AlertLevel, AlertDescription);
|
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(AlertDescription)> on_tls_error;
|
||||||
Function<void()> on_tls_finished;
|
Function<void()> on_tls_finished;
|
||||||
Function<void(TLSv12&)> on_tls_certificate_request;
|
Function<void(TLSv12&)> on_tls_certificate_request;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue