summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-10-10 01:40:53 +0330
committerAndreas Kling <kling@serenityos.org>2021-10-10 00:27:44 +0200
commite8891e6d56fe001c92a3981f59e747283238a02f (patch)
tree3bb9c1f252fd7bfa4c831fd024ceb5fbf816455e
parentc8d825e1b34698ff37436d9482f0257fc9c231b1 (diff)
downloadserenity-e8891e6d56fe001c92a3981f59e747283238a02f.zip
LibTLS: Remove useless ByteBuffer allocation in TLSv12::read_line()
-rw-r--r--Userland/Libraries/LibTLS/Socket.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/Userland/Libraries/LibTLS/Socket.cpp b/Userland/Libraries/LibTLS/Socket.cpp
index 3f3aa3c0e8..0005b6cce0 100644
--- a/Userland/Libraries/LibTLS/Socket.cpp
+++ b/Userland/Libraries/LibTLS/Socket.cpp
@@ -51,14 +51,6 @@ String TLSv12::read_line(size_t max_size)
if (offset > max_size)
return {};
- auto buffer_result = ByteBuffer::copy(start, offset);
- if (!buffer_result.has_value()) {
- dbgln("TLS: Failed to read line, not enough memory");
- dbgln("max_size < offset: {} < {} (size = {})", max_size, offset, m_context.application_buffer.size());
- dbgln("-> {:32hex-dump}", ReadonlyBytes { start, offset });
- return {};
- }
-
String line { bit_cast<char const*>(start), offset, Chomp };
m_context.application_buffer = m_context.application_buffer.slice(offset + 1, m_context.application_buffer.size() - offset - 1);