From 9f92e1bf11f0da989293df3fbf71f6497cab0592 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sat, 14 Jan 2023 11:41:55 +0100 Subject: [PATCH] LibProtocol: Remove `Request::stream_into(OutputStream&)` --- Userland/Libraries/LibProtocol/Request.cpp | 19 +++---------------- Userland/Libraries/LibProtocol/Request.h | 3 --- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Userland/Libraries/LibProtocol/Request.cpp b/Userland/Libraries/LibProtocol/Request.cpp index 03398ba7f7..bde230c289 100644 --- a/Userland/Libraries/LibProtocol/Request.cpp +++ b/Userland/Libraries/LibProtocol/Request.cpp @@ -20,8 +20,7 @@ bool Request::stop() return m_client->stop_request({}, *this); } -template -void Request::stream_into_impl(T& stream) +void Request::stream_into(Core::Stream::Stream& stream) { VERIFY(!m_internal_stream_data); @@ -54,10 +53,8 @@ void Request::stream_into_impl(T& stream) auto read_bytes = result.release_value(); if (read_bytes.is_empty()) break; - if (!stream.write_or_error(read_bytes)) { - // FIXME: What do we do here? - TODO(); - } + // FIXME: What do we do if this fails? + stream.write_entire_buffer(read_bytes).release_value_but_fixme_should_propagate_errors(); break; } while (true); @@ -69,16 +66,6 @@ void Request::stream_into_impl(T& stream) }; } -void Request::stream_into(Core::Stream::Stream& stream) -{ - stream_into_impl(stream); -} - -void Request::stream_into(OutputStream& stream) -{ - stream_into_impl(stream); -} - void Request::set_should_buffer_all_input(bool value) { if (m_should_buffer_all_input == value) diff --git a/Userland/Libraries/LibProtocol/Request.h b/Userland/Libraries/LibProtocol/Request.h index 4bbe7a4597..c8029ee392 100644 --- a/Userland/Libraries/LibProtocol/Request.h +++ b/Userland/Libraries/LibProtocol/Request.h @@ -39,7 +39,6 @@ public: int fd() const { return m_fd; } bool stop(); - void stream_into(OutputStream&); void stream_into(Core::Stream::Stream&); bool should_buffer_all_input() const { return m_should_buffer_all_input; } @@ -63,8 +62,6 @@ public: private: explicit Request(RequestClient&, i32 request_id); - template - void stream_into_impl(T&); WeakPtr m_client; int m_request_id { -1 };