mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 07:52:51 +02:00
- better handling of mod menu threading when user has no internet connection
This commit is contained in:
@@ -128,7 +128,7 @@ public:
|
||||
static void init(bool haveSpecialOutputCommandLineOption);
|
||||
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,CURL *handle=NULL, int timeOut=-1);
|
||||
static std::string getHTTP(std::string URL,CURL *handle=NULL, int timeOut=-1, CURLcode *savedResult=NULL);
|
||||
static std::string escapeURL(std::string URL, CURL *handle=NULL);
|
||||
|
||||
static CURL *initHTTP();
|
||||
|
@@ -103,7 +103,7 @@ std::string SystemFlags::escapeURL(std::string URL, CURL *handle) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SystemFlags::getHTTP(std::string URL,CURL *handle,int timeOut) {
|
||||
std::string SystemFlags::getHTTP(std::string URL,CURL *handle,int timeOut,CURLcode *savedResult) {
|
||||
if(handle == NULL) {
|
||||
handle = SystemFlags::curl_handle;
|
||||
}
|
||||
@@ -155,10 +155,15 @@ std::string SystemFlags::getHTTP(std::string URL,CURL *handle,int timeOut) {
|
||||
if(chunk.memory) {
|
||||
free(chunk.memory);
|
||||
}
|
||||
|
||||
if(savedResult != NULL) {
|
||||
*savedResult = result;
|
||||
}
|
||||
if(result != CURLE_OK) {
|
||||
serverResponse = errbuf;
|
||||
}
|
||||
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] serverResponse [%s]\n",__FILE__,__FUNCTION__,__LINE__,serverResponse.c_str());
|
||||
|
||||
return serverResponse;
|
||||
|
Reference in New Issue
Block a user