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) {