mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 09:24:24 +02:00
Added some threading for URL calls for new masterserver game play
This commit is contained in:
@@ -115,6 +115,7 @@ public:
|
||||
static SystemFlagsType & getSystemSettingType(DebugType type) { return debugLogFileList[type]; }
|
||||
static size_t httpWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
|
||||
static std::string getHTTP(std::string URL);
|
||||
static std::string escapeURL(std::string URL);
|
||||
|
||||
// Let the macro call into this when require.. NEVER call it automatically.
|
||||
static void handleDebug(DebugType type, const char *fmt, ...);
|
||||
|
@@ -68,6 +68,18 @@ size_t SystemFlags::httpWriteMemoryCallback(void *ptr, size_t size, size_t nmemb
|
||||
return realsize;
|
||||
}
|
||||
|
||||
std::string SystemFlags::escapeURL(std::string URL)
|
||||
{
|
||||
string result = URL;
|
||||
|
||||
char *escaped=curl_easy_escape(SystemFlags::curl_handle,URL.c_str(),0);
|
||||
if(escaped != NULL) {
|
||||
result = escaped;
|
||||
curl_free(escaped);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SystemFlags::getHTTP(std::string URL) {
|
||||
curl_easy_setopt(SystemFlags::curl_handle, CURLOPT_URL, URL.c_str());
|
||||
|
||||
|
Reference in New Issue
Block a user