From cdcef49eef15c5acdaacc3dedf0f481c553f6917 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 7 Dec 2021 12:00:45 +0100 Subject: [PATCH] lib/curl/Request: add constructor with CurlEasy parameter --- src/lib/curl/Request.cxx | 7 +++++++ src/lib/curl/Request.hxx | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lib/curl/Request.cxx b/src/lib/curl/Request.cxx index 9a287503f..6f041af7e 100644 --- a/src/lib/curl/Request.cxx +++ b/src/lib/curl/Request.cxx @@ -45,6 +45,13 @@ #include +CurlRequest::CurlRequest(CurlGlobal &_global, CurlEasy _easy, + CurlResponseHandler &_handler) + :global(_global), handler(_handler), easy(std::move(_easy)) +{ + SetupEasy(); +} + CurlRequest::CurlRequest(CurlGlobal &_global, CurlResponseHandler &_handler) :global(_global), handler(_handler) diff --git a/src/lib/curl/Request.hxx b/src/lib/curl/Request.hxx index 67785b1df..fae401a4e 100644 --- a/src/lib/curl/Request.hxx +++ b/src/lib/curl/Request.hxx @@ -67,9 +67,9 @@ class CurlRequest final { bool registered = false; public: - /** - * To start sending the request, call Start(). - */ + CurlRequest(CurlGlobal &_global, CurlEasy easy, + CurlResponseHandler &_handler); + CurlRequest(CurlGlobal &_global, CurlResponseHandler &_handler);