diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.cpp | 2 | ||||
-rw-r--r-- | src/curl_wrapper.cpp | 14 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index f2cd053..0b00ad5 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -70,7 +70,7 @@ string Connection::get_new_stream_contents() { _buffer_mutex.lock(); auto &buffer{get_buffer()}; - const string buffer_copy{buffer}; + string buffer_copy{buffer}; buffer.clear(); _buffer_mutex.unlock(); return buffer_copy; diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp index 954006d..4ecbe7a 100644 --- a/src/curl_wrapper.cpp +++ b/src/curl_wrapper.cpp @@ -56,17 +56,11 @@ void CURLWrapper::init() } CURLWrapper::CURLWrapper() - : _connection{} - , _curl_buffer_error{} - , _stream_cancelled{false} { init(); } CURLWrapper::CURLWrapper(const CURLWrapper &) - : _connection{} - , _curl_buffer_error{} - , _stream_cancelled{false} { init(); } @@ -90,7 +84,7 @@ answer_type CURLWrapper::make_request(const http_method &method, string uri, _curl_buffer_headers.clear(); _curl_buffer_body.clear(); - CURLcode code; + CURLcode code{CURLE_OK}; switch (method) { case http_method::GET: @@ -186,7 +180,7 @@ answer_type CURLWrapper::make_request(const http_method &method, string uri, if (code == CURLE_OK || (code == CURLE_ABORTED_BY_CALLBACK && _stream_cancelled)) { - long http_status; // NOLINT(google-runtime-int) + long http_status{0}; // NOLINT(google-runtime-int) // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) curl_easy_getinfo(_connection, CURLINFO_RESPONSE_CODE, &http_status); answer.http_status = static_cast<uint16_t>(http_status); @@ -281,8 +275,8 @@ void CURLWrapper::set_cainfo(const string_view path) void CURLWrapper::set_useragent(const string_view useragent) { - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) CURLcode code{ + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) curl_easy_setopt(_connection, CURLOPT_USERAGENT, useragent.data())}; if (code != CURLE_OK) { @@ -319,7 +313,7 @@ size_t CURLWrapper::writer_header(char *data, size_t size, size_t nmemb) } int CURLWrapper::progress(void *, curl_off_t, curl_off_t, curl_off_t, - curl_off_t) + curl_off_t) const { if (_stream_cancelled) { |