Skip to content

Commit

Permalink
applying some changes for the server list and connection timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jun 25, 2022
1 parent 798bf66 commit add7c5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/Gui/MainScreenHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,16 @@ namespace spades {
curl_easy_setopt(cHandle.get(), CURLOPT_URL, cl_serverListUrl.CString());
curl_easy_setopt(cHandle.get(), CURLOPT_WRITEFUNCTION, curlWriteCallback);
curl_easy_setopt(cHandle.get(), CURLOPT_WRITEDATA, this);
if (0 == curl_easy_perform(cHandle.get())) {
curl_easy_setopt(cHandle.get(), CURLOPT_LOW_SPEED_TIME, 30l);
curl_easy_setopt(cHandle.get(), CURLOPT_LOW_SPEED_LIMIT, 15l);
curl_easy_setopt(cHandle.get(), CURLOPT_CONNECTTIMEOUT, 30l);
auto reqret = curl_easy_perform(cHandle.get());
if (CURLE_OK == reqret) {
ProcessResponse();
} else {
SPRaise("HTTP request error.");
char buf[256];
snprintf(buf, sizeof(buf), "HTTP request error (%s).", curl_easy_strerror(reqret));
SPRaise(buf);
}
} else {
SPRaise("Failed to create cURL object.");
Expand Down
1 change: 1 addition & 0 deletions Sources/Gui/PackageUpdateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ namespace spades {
curl_easy_setopt(curl.get(), CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl.get(), CURLOPT_LOW_SPEED_TIME, 30l);
curl_easy_setopt(curl.get(), CURLOPT_LOW_SPEED_LIMIT, 15l);
curl_easy_setopt(curl.get(), CURLOPT_CONNECTTIMEOUT, 30l);
curl_easy_setopt(
curl.get(), CURLOPT_XFERINFOFUNCTION,
static_cast<int (*)(void *, curl_off_t, curl_off_t, curl_off_t, curl_off_t)>(
Expand Down

0 comments on commit add7c5c

Please sign in to comment.