From 7ac1bc13775c457182df714bfb1d0b83100cd9e7 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 10 Jan 2020 18:57:42 +0100 Subject: [PATCH] Hide CURLWrapper::cancel_stream(). --- include/connection.hpp | 6 ++++++ include/curl_wrapper.hpp | 25 ++++++++++++++----------- src/curl_wrapper.cpp | 5 ----- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/connection.hpp b/include/connection.hpp index 91a06d7..0ed09eb 100644 --- a/include/connection.hpp +++ b/include/connection.hpp @@ -181,10 +181,16 @@ public: */ vector get_new_events(); + //! @copydoc CURLWrapper::cancel_stream + inline void cancel_stream() + { + CURLWrapper::cancel_stream(); + } private: Instance &_instance; const string_view _baseuri; + [[nodiscard]] string endpoint_to_uri(const endpoint_variant &endpoint) const; }; diff --git a/include/curl_wrapper.hpp b/include/curl_wrapper.hpp index 73c748a..967295f 100644 --- a/include/curl_wrapper.hpp +++ b/include/curl_wrapper.hpp @@ -152,17 +152,6 @@ public: */ void set_proxy(string_view proxy); - /*! - * @brief Cancel the stream. - * - * The stream will be cancelled, usually whithin a second. The @link - * answer_type::curl_error_code curl_error_code @endlink of the answer will - * be set to 42 (`CURLE_ABORTED_BY_CALLBACK`). - * - * @since 0.1.0 - */ - void cancel_stream(); - protected: /*! * @brief Mutex for #get_buffer a.k.a. _curl_buffer_body. @@ -199,6 +188,20 @@ protected: return _curl_buffer_body; } + /*! + * @brief Cancel the stream. + * + * The stream will be cancelled, usually whithin a second. The @link + * answer_type::curl_error_code curl_error_code @endlink of the answer will + * be set to 42 (`CURLE_ABORTED_BY_CALLBACK`). + * + * @since 0.1.0 + */ + inline void cancel_stream() + { + _stream_cancelled = true; + } + /*! * @brief Set OAuth 2.0 Bearer Access Token. * diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp index 5af9298..91fb39e 100644 --- a/src/curl_wrapper.cpp +++ b/src/curl_wrapper.cpp @@ -74,11 +74,6 @@ void CURLWrapper::set_proxy(const string_view proxy) } } -void CURLWrapper::cancel_stream() -{ - _stream_cancelled = true; -} - answer_type CURLWrapper::make_request(const http_method &method, string uri, const parametermap ¶meters) {