mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
http: Always use/require progress in requests.
This fixes several cases where we weren't passing cancel flags consistently.
This commit is contained in:
1 parent
f762fbc53d
commit
3379f33882
9 files changed
+69
-59
No files matched your search
+4
-3
@@ -63,6 +63,7 @@ static ServerStatus RetrieveStatus() {
|
||||
static bool RegisterServer(int port) {
|
||||
bool success = false;
|
||||
http::Client http;
|
||||
http::RequestProgress progress;
|
||||
Buffer theVoid;
|
||||
|
||||
http.SetUserAgent(StringFromFormat("PPSSPP/%s", PPSSPP_GIT_VERSION));
|
||||
@@ -73,7 +74,7 @@ static bool RegisterServer(int port) {
|
||||
std::string ip = fd_util::GetLocalIP(http.sock());
|
||||
snprintf(resource4, sizeof(resource4) - 1, "/match/update?local=%s&port=%d", ip.c_str(), port);
|
||||
|
||||
if (http.GET(resource4, &theVoid) > 0)
|
||||
if (http.GET(resource4, &theVoid, &progress) > 0)
|
||||
success = true;
|
||||
theVoid.Skip(theVoid.size());
|
||||
http.Disconnect();
|
||||
@@ -86,7 +87,7 @@ static bool RegisterServer(int port) {
|
||||
|
||||
// We register both IPv4 and IPv6 in case the other client is using a different one.
|
||||
if (resource4[0] != 0 && http.Connect(timeout)) {
|
||||
if (http.GET(resource4, &theVoid) > 0)
|
||||
if (http.GET(resource4, &theVoid, &progress) > 0)
|
||||
success = true;
|
||||
theVoid.Skip(theVoid.size());
|
||||
http.Disconnect();
|
||||
@@ -98,7 +99,7 @@ static bool RegisterServer(int port) {
|
||||
std::string ip = fd_util::GetLocalIP(http.sock());
|
||||
snprintf(resource6, sizeof(resource6) - 1, "/match/update?local=%s&port=%d", ip.c_str(), port);
|
||||
|
||||
if (http.GET(resource6, &theVoid) > 0)
|
||||
if (http.GET(resource6, &theVoid, &progress) > 0)
|
||||
success = true;
|
||||
theVoid.Skip(theVoid.size());
|
||||
http.Disconnect();
|
||||
|
||||
Reference in new issue
Block a user