2015-02-24 14:00:19 +00:00
|
|
|
#include "vercheckerthread.h"
|
|
|
|
#include "externData.h"
|
|
|
|
#include "mainResources.h"
|
2015-03-05 14:29:05 +00:00
|
|
|
#include "Connector.h"
|
|
|
|
#include "Utils.h"
|
2015-02-24 14:00:19 +00:00
|
|
|
|
|
|
|
void _checkVer()
|
|
|
|
{
|
2015-03-05 14:29:05 +00:00
|
|
|
while(true) {
|
|
|
|
char request[64] = {"http://nesca.d3w.org/version"};
|
|
|
|
std::string buffer;
|
|
|
|
std::vector<std::string> headerVector {"X-Nescav3: True"};
|
|
|
|
Connector::nConnect(request, 80, &buffer, NULL, &headerVector);
|
2015-02-24 14:00:19 +00:00
|
|
|
|
2015-03-05 14:29:05 +00:00
|
|
|
char *ptr1 = NULL;
|
|
|
|
if(buffer.size() > 0)
|
|
|
|
{
|
|
|
|
if(Utils::ci_find_substr(buffer, std::string("\r\n\r\n")) != -1)
|
|
|
|
{
|
|
|
|
ptr1 = strstr((char*)buffer.c_str(), "\r\n\r\n");
|
|
|
|
if(strcmp(gVER, ptr1 + 4) != 0)
|
|
|
|
{
|
|
|
|
stt->doEmitionShowRedVersion();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-02-24 14:00:19 +00:00
|
|
|
|
2015-03-05 14:29:05 +00:00
|
|
|
vct->sleep(600000); //10 min
|
|
|
|
};
|
|
|
|
//vct->terminate();
|
|
|
|
}
|
2015-02-24 14:00:19 +00:00
|
|
|
|
|
|
|
void VerCheckerThread::run()
|
|
|
|
{
|
|
|
|
_checkVer();
|
2015-03-05 14:29:05 +00:00
|
|
|
}
|