mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 13:31:06 +00:00
Fixed explicit initialization and constructor for HttpContext
This commit is contained in:
parent
5b12f23365
commit
b550a4e4dc
@ -24,6 +24,16 @@ static int BufWriter(u8 *data, size_t size, size_t nmemb, std::vector<u8>* out_b
|
|||||||
return static_cast<int>(size * nmemb);
|
return static_cast<int>(size * nmemb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HttpContext::HttpContext() {
|
||||||
|
state = REQUEST_STATE_NONE;
|
||||||
|
cancel_request = false;
|
||||||
|
req_type = REQUEST_TYPE_NONE;
|
||||||
|
request_hdrs = nullptr;
|
||||||
|
response_code = 0;
|
||||||
|
content_length = 0.0;
|
||||||
|
downloaded_size = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
HttpContext::~HttpContext() {
|
HttpContext::~HttpContext() {
|
||||||
curl_slist_free_all(request_hdrs);
|
curl_slist_free_all(request_hdrs);
|
||||||
}
|
}
|
||||||
@ -68,8 +78,8 @@ void MakeRequest(HttpContext* context) {
|
|||||||
|
|
||||||
mres = curl_multi_add_handle(manager, connection);
|
mres = curl_multi_add_handle(manager, connection);
|
||||||
|
|
||||||
int still_running;
|
int still_running = 0;
|
||||||
int repeats;
|
int repeats = 0;
|
||||||
mres = curl_multi_perform(manager, &still_running);
|
mres = curl_multi_perform(manager, &still_running);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -34,6 +34,7 @@ enum RequestType : u32 {
|
|||||||
|
|
||||||
/// Current state of the HTTP request (API-exposed).
|
/// Current state of the HTTP request (API-exposed).
|
||||||
enum RequestState : u32 {
|
enum RequestState : u32 {
|
||||||
|
REQUEST_STATE_NONE = 0, // TODO: Verify
|
||||||
REQUEST_STATE_IN_PROGRESS = 5,
|
REQUEST_STATE_IN_PROGRESS = 5,
|
||||||
REQUEST_STATE_READY = 8,
|
REQUEST_STATE_READY = 8,
|
||||||
};
|
};
|
||||||
@ -63,6 +64,7 @@ struct HttpContext {
|
|||||||
double content_length; //< The total size in bytes that will be downloaded this request.
|
double content_length; //< The total size in bytes that will be downloaded this request.
|
||||||
double downloaded_size; //< The amount in bytes that has been downloaded so far.
|
double downloaded_size; //< The amount in bytes that has been downloaded so far.
|
||||||
|
|
||||||
|
HttpContext();
|
||||||
~HttpContext();
|
~HttpContext();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user