Skip to content

Commit

Permalink
prepopulate dns-cache, ref. #8
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Oct 20, 2020
1 parent 9bc690f commit 64901e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ShareCodeUpload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ ShareCodeUpload::ShareCodeUpload(bool verboseMode)
{
verbose = verboseMode;
curl = initCurlConnection();

struct curl_slist *host = NULL;
host = curl_slist_append(NULL, "csgostats.gg:80:104.18.76.107");
host = curl_slist_append(host, "csgostats.gg:443:104.18.76.107");
}

ShareCodeUpload::~ShareCodeUpload()
{
curl_slist_free_all(host);

curl_easy_cleanup(curl);
}

Expand Down Expand Up @@ -53,6 +59,8 @@ CURL* ShareCodeUpload::initCurlConnection()
// provide a buffer for storing errors
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);

curl_easy_setopt(curl, CURLOPT_RESOLVE, host);

// 1. URL that is about to receive our GET request
curl_easy_setopt(curl, CURLOPT_URL, "https://csgostats.gg/");

Expand Down Expand Up @@ -145,6 +153,8 @@ int ShareCodeUpload::uploadShareCode(std::string shareCode, std::string& respons
// set the error buffer as empty before performing a request
errorBuffer[0] = 0;

curl_easy_setopt(curl, CURLOPT_RESOLVE, host);

// 1. URL that is about to receive our POST data
curl_easy_setopt(curl, CURLOPT_URL, "https://csgostats.gg/match/upload/ajax");

Expand Down

0 comments on commit 64901e5

Please sign in to comment.