mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-24 03:02:19 +00:00
35 lines
667 B
C++
35 lines
667 B
C++
|
#include "vercheckerthread.h"
|
||
|
#include "externData.h"
|
||
|
#include "mainResources.h"
|
||
|
|
||
|
void _checkVer()
|
||
|
{
|
||
|
Connector con;
|
||
|
conSTR CSTR;
|
||
|
CSTR.lowerBuff = NULL;
|
||
|
CSTR.size = 0;
|
||
|
con._EstablishConnection("nesca.d3w.org", 80, "GET /version HTTP/1.1\r\nHost: nesca.d3w.org\r\nX-Nescav3: True\r\n\r\n", &CSTR, 1);
|
||
|
|
||
|
char *ptr1 = NULL;
|
||
|
if(CSTR.lowerBuff != NULL)
|
||
|
{
|
||
|
if(strstr(CSTR.lowerBuff, "\r\n\r\n") != 0)
|
||
|
{
|
||
|
ptr1 = strstr(CSTR.lowerBuff, "\r\n\r\n");
|
||
|
if(strcmp(gVER, ptr1 + 4) != 0)
|
||
|
{
|
||
|
stt->doEmitionShowRedVersion();
|
||
|
};
|
||
|
};
|
||
|
delete []CSTR.lowerBuff;
|
||
|
CSTR.lowerBuff = NULL;
|
||
|
};
|
||
|
|
||
|
vct->terminate();
|
||
|
};
|
||
|
|
||
|
void VerCheckerThread::run()
|
||
|
{
|
||
|
_checkVer();
|
||
|
};
|