diff options
-rw-r--r-- | Userland/Libraries/LibHTTP/HttpJob.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibHTTP/HttpsJob.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibHTTP/Job.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibHTTP/Job.h | 2 | ||||
-rw-r--r-- | Userland/Services/RequestServer/HttpCommon.h | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibHTTP/HttpJob.h b/Userland/Libraries/LibHTTP/HttpJob.h index 57495f8c91..4f756dbe57 100644 --- a/Userland/Libraries/LibHTTP/HttpJob.h +++ b/Userland/Libraries/LibHTTP/HttpJob.h @@ -41,8 +41,8 @@ protected: virtual bool is_established() const override { return true; } private: - explicit HttpJob(const HttpRequest& request, OutputStream& output_stream) - : Job(request, output_stream) + explicit HttpJob(HttpRequest&& request, OutputStream& output_stream) + : Job(move(request), output_stream) { } diff --git a/Userland/Libraries/LibHTTP/HttpsJob.h b/Userland/Libraries/LibHTTP/HttpsJob.h index b53cf94a7d..e277cd14c2 100644 --- a/Userland/Libraries/LibHTTP/HttpsJob.h +++ b/Userland/Libraries/LibHTTP/HttpsJob.h @@ -45,8 +45,8 @@ protected: virtual void read_while_data_available(Function<IterationDecision()>) override; private: - explicit HttpsJob(const HttpRequest& request, OutputStream& output_stream, const Vector<Certificate>* override_certs = nullptr) - : Job(request, output_stream) + explicit HttpsJob(HttpRequest&& request, OutputStream& output_stream, const Vector<Certificate>* override_certs = nullptr) + : Job(move(request), output_stream) , m_override_ca_certificates(override_certs) { } diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index 237ef81a00..29840f9dc2 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -40,7 +40,7 @@ static Optional<ByteBuffer> handle_content_encoding(const ByteBuffer& buf, const dbgln(" Output size: {}", uncompressed.value().size()); } - return uncompressed.value(); + return uncompressed.release_value(); } else if (content_encoding == "deflate") { dbgln_if(JOB_DEBUG, "Job::handle_content_encoding: buf is deflate compressed!"); @@ -66,15 +66,15 @@ static Optional<ByteBuffer> handle_content_encoding(const ByteBuffer& buf, const dbgln(" Output size: {}", uncompressed.value().size()); } - return uncompressed.value(); + return uncompressed.release_value(); } return buf; } -Job::Job(const HttpRequest& request, OutputStream& output_stream) +Job::Job(HttpRequest&& request, OutputStream& output_stream) : Core::NetworkJob(output_stream) - , m_request(request) + , m_request(move(request)) { } diff --git a/Userland/Libraries/LibHTTP/Job.h b/Userland/Libraries/LibHTTP/Job.h index b3caadefeb..1540ed9587 100644 --- a/Userland/Libraries/LibHTTP/Job.h +++ b/Userland/Libraries/LibHTTP/Job.h @@ -18,7 +18,7 @@ namespace HTTP { class Job : public Core::NetworkJob { public: - explicit Job(const HttpRequest&, OutputStream&); + explicit Job(HttpRequest&&, OutputStream&); virtual ~Job() override; virtual void start(NonnullRefPtr<Core::Socket>) override = 0; diff --git a/Userland/Services/RequestServer/HttpCommon.h b/Userland/Services/RequestServer/HttpCommon.h index 5a4866a53d..f38e7dcee5 100644 --- a/Userland/Services/RequestServer/HttpCommon.h +++ b/Userland/Services/RequestServer/HttpCommon.h @@ -81,7 +81,7 @@ OwnPtr<Request> start_request(TBadgedProtocol&& protocol, ClientConnection& clie auto output_stream = make<OutputFileStream>(pipe_result.value().write_fd); output_stream->make_unbuffered(); - auto job = TJob::construct(request, *output_stream); + auto job = TJob::construct(move(request), *output_stream); auto protocol_request = TRequest::create_with_job(forward<TBadgedProtocol>(protocol), client, (TJob&)*job, move(output_stream)); protocol_request->set_request_fd(pipe_result.value().read_fd); |