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

Commit 0a1b944

Browse files
committed
Remove ptr func in CURLHandle
1 parent 7b84f4f commit 0a1b944

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

src/curl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,6 @@ namespace powerloader
230230
return m_handle;
231231
}
232232

233-
CURL* CURLHandle::ptr() const
234-
{
235-
return m_handle;
236-
}
237-
238233
CURLHandle& CURLHandle::add_header(const std::string& header)
239234
{
240235
p_headers = curl_slist_append(p_headers, header.c_str());

src/curl_internal.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ namespace powerloader
7373
template <class T>
7474
tl::expected<T, CURLcode> getinfo(CURLINFO option);
7575

76-
// TODO: why do we need to expose these methods
76+
// TODO: why do we need to expose this method
7777
CURL* handle();
78-
CURL* ptr() const;
7978

8079
CURLHandle& add_header(const std::string& header);
8180
CURLHandle& add_headers(const std::vector<std::string>& headers);

src/target.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ namespace powerloader
169169
std::size_t zckheadercb(char* buffer, std::size_t size, std::size_t nitems, Target* self)
170170
{
171171
assert(self && self->m_target);
172-
long code = -1;
173-
curl_easy_getinfo(self->m_curl_handle->ptr(), CURLINFO_RESPONSE_CODE, &code);
174-
if (code == 200)
172+
if (self->m_curl_handle->getinfo<long>(CURLINFO_RESPONSE_CODE) == 200)
175173
{
176174
spdlog::info("Too many ranges were attempted in one download");
177175
self->m_range_fail = 1;

0 commit comments

Comments
 (0)