From 5ab0876a5f3729313d1afedd33858f755baf8fd9 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 3 May 2019 14:57:41 +0300 Subject: [PATCH] MXS-2468 Allow an http::Async object to be reset --- maxutils/maxbase/include/maxbase/http.hh | 7 ++++++- maxutils/maxbase/src/http.cc | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/maxutils/maxbase/include/maxbase/http.hh b/maxutils/maxbase/include/maxbase/http.hh index 4136edc71..dba9797f3 100644 --- a/maxutils/maxbase/include/maxbase/http.hh +++ b/maxutils/maxbase/include/maxbase/http.hh @@ -175,7 +175,7 @@ public: }; /** - * Defalt constructor creates an asynchronous operation whose status is ERROR. + * Defalt constructor creates an asynchronous operation whose status is READY. */ Async(); @@ -204,6 +204,11 @@ public: return *this; } + /** + * Resets the instance so that it becomes as if it would have been default constructed. + */ + void reset(); + /** * Return the status of the operation. * diff --git a/maxutils/maxbase/src/http.cc b/maxutils/maxbase/src/http.cc index a6be94184..26ddbc7bf 100644 --- a/maxutils/maxbase/src/http.cc +++ b/maxutils/maxbase/src/http.cc @@ -491,6 +491,11 @@ Async::Async() { } +void Async::reset() +{ + m_sImp = std::make_shared(); +} + Async get_async(const std::vector& urls, const Config& config) {