Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Remove ptr func in CURLHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Feb 16, 2023
1 parent 5d2875e commit 34773ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
5 changes: 0 additions & 5 deletions src/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,6 @@ namespace powerloader
return m_handle;
}

CURL* CURLHandle::ptr() const
{
return m_handle;
}

CURLHandle& CURLHandle::add_header(const std::string& header)
{
p_headers = curl_slist_append(p_headers, header.c_str());
Expand Down
3 changes: 1 addition & 2 deletions src/curl_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ namespace powerloader
template <class T>
tl::expected<T, CURLcode> getinfo(CURLINFO option);

// TODO: why do we need to expose these methods
// TODO: why do we need to expose this method
CURL* handle();
CURL* ptr() const;

CURLHandle& add_header(const std::string& header);
CURLHandle& add_headers(const std::vector<std::string>& headers);
Expand Down
4 changes: 1 addition & 3 deletions src/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ namespace powerloader
std::size_t zckheadercb(char* buffer, std::size_t size, std::size_t nitems, Target* self)
{
assert(self && self->m_target);
long code = -1;
curl_easy_getinfo(self->m_curl_handle->ptr(), CURLINFO_RESPONSE_CODE, &code);
if (code == 200)
if (self->m_curl_handle->getinfo<long>(CURLINFO_RESPONSE_CODE) == 200)
{
spdlog::info("Too many ranges were attempted in one download");
self->m_range_fail = 1;
Expand Down

0 comments on commit 34773ae

Please sign in to comment.