mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-16 06:55:04 -04:00
how did i not notice-
This commit is contained in:
parent
00e191accb
commit
1f2aa2ced7
2 changed files with 7 additions and 6 deletions
|
@ -112,9 +112,7 @@ namespace geode::utils::web {
|
|||
private:
|
||||
class Impl;
|
||||
|
||||
static std::atomic_size_t s_idCounter;
|
||||
std::shared_ptr<Impl> m_impl;
|
||||
const size_t m_id;
|
||||
public:
|
||||
WebRequest();
|
||||
~WebRequest();
|
||||
|
|
|
@ -188,6 +188,8 @@ std::optional<float> WebProgress::uploadProgress() const {
|
|||
|
||||
class WebRequest::Impl {
|
||||
public:
|
||||
static std::atomic_size_t s_counter;
|
||||
|
||||
std::string m_method;
|
||||
std::string m_url;
|
||||
std::unordered_map<std::string, std::string> m_headers;
|
||||
|
@ -203,6 +205,9 @@ public:
|
|||
std::string m_CABundleContent;
|
||||
ProxyOpts m_proxyOpts = {};
|
||||
HttpVersion m_httpVersion = HttpVersion::DEFAULT;
|
||||
size_t m_id;
|
||||
|
||||
Impl() : m_id(s_counter++) {}
|
||||
|
||||
WebResponse makeError(int code, std::string const& msg) {
|
||||
auto res = WebResponse();
|
||||
|
@ -212,9 +217,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
std::atomic_size_t WebRequest::s_idCounter = 0;
|
||||
|
||||
WebRequest::WebRequest() : m_impl(std::make_shared<Impl>()), m_id(WebRequest::s_idCounter++) {}
|
||||
WebRequest::WebRequest() : m_impl(std::make_shared<Impl>()) {}
|
||||
WebRequest::~WebRequest() {}
|
||||
|
||||
// Encodes a url param
|
||||
|
@ -587,7 +590,7 @@ WebRequest& WebRequest::bodyJSON(matjson::Value const& json) {
|
|||
}
|
||||
|
||||
size_t WebRequest::getID() const {
|
||||
return m_id;
|
||||
return m_impl->m_id;
|
||||
}
|
||||
|
||||
std::string WebRequest::getMethod() const {
|
||||
|
|
Loading…
Add table
Reference in a new issue