From 348c1cb965cc55bee2b7b008e8a56da78b91a98f Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 21 Aug 2022 14:10:28 -0400 Subject: [PATCH] remove curl error buffer it was useless anyways --- src/http.cpp | 4 ---- src/http.hpp | 1 - 2 files changed, 5 deletions(-) diff --git a/src/http.cpp b/src/http.cpp index f0471a1..f0bb85b 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -36,7 +36,6 @@ request::request(request &&other) noexcept , m_url(std::exchange(other.m_url, "")) , m_method(std::exchange(other.m_method, nullptr)) , m_header_list(std::exchange(other.m_header_list, nullptr)) - , m_error_buf(other.m_error_buf) , m_form(std::exchange(other.m_form, nullptr)) , m_read_streams(std::move(other.m_read_streams)) , m_progress_callback(std::move(other.m_progress_callback)) { @@ -159,8 +158,6 @@ response request::execute() { curl_easy_setopt(m_curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, detail::curl_write_data_callback); curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, &str); - curl_easy_setopt(m_curl, CURLOPT_ERRORBUFFER, m_error_buf); - m_error_buf[0] = '\0'; if (m_header_list != nullptr) curl_easy_setopt(m_curl, CURLOPT_HTTPHEADER, m_header_list); if (m_form != nullptr) @@ -170,7 +167,6 @@ response request::execute() { if (result != CURLE_OK) { auto response = detail::make_response(m_url, EStatusCode::ClientErrorCURLPerform); response.error_string = curl_easy_strerror(result); - response.error_string += " " + std::string(m_error_buf.data()); return response; } diff --git a/src/http.hpp b/src/http.hpp index 5bf3c69..63b6e38 100644 --- a/src/http.hpp +++ b/src/http.hpp @@ -131,7 +131,6 @@ private: std::string m_url; const char *m_method; curl_slist *m_header_list = nullptr; - std::array m_error_buf = { 0 }; curl_mime *m_form = nullptr; std::function m_progress_callback;