diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGemini/GeminiRequest.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibGemini/GeminiRequest.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGemini/Job.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGemini/GeminiRequest.cpp b/Userland/Libraries/LibGemini/GeminiRequest.cpp index ef395771ac..14287b390f 100644 --- a/Userland/Libraries/LibGemini/GeminiRequest.cpp +++ b/Userland/Libraries/LibGemini/GeminiRequest.cpp @@ -10,12 +10,12 @@ namespace Gemini { -ByteBuffer GeminiRequest::to_raw_request() const +ErrorOr<ByteBuffer> GeminiRequest::to_raw_request() const { StringBuilder builder; - builder.append(m_url.to_deprecated_string()); - builder.append("\r\n"sv); - return builder.to_byte_buffer(); + TRY(builder.try_append(m_url.to_deprecated_string())); + TRY(builder.try_append("\r\n"sv)); + return builder.try_to_byte_buffer(); } Optional<GeminiRequest> GeminiRequest::from_raw_request(ByteBuffer const& raw_request) diff --git a/Userland/Libraries/LibGemini/GeminiRequest.h b/Userland/Libraries/LibGemini/GeminiRequest.h index 56df2bb78f..97ff92989b 100644 --- a/Userland/Libraries/LibGemini/GeminiRequest.h +++ b/Userland/Libraries/LibGemini/GeminiRequest.h @@ -21,7 +21,7 @@ public: const URL& url() const { return m_url; } void set_url(const URL& url) { m_url = url; } - ByteBuffer to_raw_request() const; + ErrorOr<ByteBuffer> to_raw_request() const; static Optional<GeminiRequest> from_raw_request(ByteBuffer const&); diff --git a/Userland/Libraries/LibGemini/Job.cpp b/Userland/Libraries/LibGemini/Job.cpp index b7937c6af6..a7cde0a21f 100644 --- a/Userland/Libraries/LibGemini/Job.cpp +++ b/Userland/Libraries/LibGemini/Job.cpp @@ -111,7 +111,7 @@ void Job::flush_received_buffers() void Job::on_socket_connected() { - auto raw_request = m_request.to_raw_request(); + auto raw_request = m_request.to_raw_request().release_value_but_fixme_should_propagate_errors(); if constexpr (JOB_DEBUG) { dbgln("Job: raw_request:"); |