Skip to content

Commit

Permalink
Added timeout for GPSS cloud pages
Browse files Browse the repository at this point in the history
  • Loading branch information
FM1337 committed Feb 15, 2025
1 parent 666846f commit 0af0e79
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions 3ds/source/gui/screen/CloudScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ void CloudScreen::shareSend()
curl_mime_data(field, (char*)infoMon->rawData().data(), infoMon->getLength());
curl_mime_filename(field, "pkmn");
fetch->setopt(CURLOPT_MIMEPOST, mimeThing.get());
fetch->setopt(CURLOPT_TIMEOUT, 10L);

auto res = Fetch::perform(fetch);
if (res.index() == 0)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export PKSM_AUTHOR := FlagBrew

export VERSION_MAJOR := 10
export VERSION_MINOR := 1
export VERSION_MICRO := 2
export VERSION_MICRO := 3
GIT_REV := $(shell git rev-parse --short HEAD)
OLD_INFO := $(shell if [ -e appinfo.hash ]; then cat appinfo.hash; fi)
NOW_INFO := $(PKSM_TITLE) $(PKSM_DESCRIPTION) $(PKSM_AUTHOR) $(VERSION_MAJOR) $(VERSION_MINOR) $(VERSION_MICRO) $(GIT_REV)
Expand Down
2 changes: 2 additions & 0 deletions common/source/CloudAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void CloudAccess::downloadCloudPage(std::shared_ptr<Page> page, int number, Sort
headers = curl_slist_append(headers, "pksm-mode: yes");

auto fetch = Fetch::init(url, true, retData, headers, postData);
fetch->setopt(CURLOPT_TIMEOUT, 10L);
Fetch::performAsync(fetch,
[page, retData, headers](CURLcode code, std::shared_ptr<Fetch> fetch)
{
Expand Down Expand Up @@ -381,6 +382,7 @@ long CloudAccess::pkm(std::unique_ptr<pksm::PKX> mon)
curl_mime_data(field, (char*)mon->rawData().data(), mon->getLength());
curl_mime_filename(field, "pkmn");
fetch->setopt(CURLOPT_MIMEPOST, mimeThing.get());
fetch->setopt(CURLOPT_TIMEOUT, 10L);

auto res = Fetch::perform(fetch);
if (res.index() == 1 && std::get<1>(res) == CURLE_OK)
Expand Down
2 changes: 2 additions & 0 deletions common/source/GroupCloudAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void GroupCloudAccess::downloadGroupPage(std::shared_ptr<Page> page, int number,

const auto [url, postData] = GroupCloudAccess::makeURL(number, legal, low, high, LGPE);
auto fetch = Fetch::init(url, true, retData, headers, postData);
fetch->setopt(CURLOPT_TIMEOUT, 10L);
Fetch::performAsync(fetch,
[page, retData, headers](CURLcode code, std::shared_ptr<Fetch> fetch)
{
Expand Down Expand Up @@ -435,6 +436,7 @@ long GroupCloudAccess::group(std::vector<std::unique_ptr<pksm::PKX>> sendMe)
curl_mime_filename(field, fieldName.c_str());
}
fetch->setopt(CURLOPT_MIMEPOST, mimeThing.get());
fetch->setopt(CURLOPT_TIMEOUT, 10L);

auto res = Fetch::perform(fetch);
if (res.index() == 1 && std::get<1>(res) == CURLE_OK)
Expand Down

0 comments on commit 0af0e79

Please sign in to comment.