More verbose output from key-checker thread

This commit is contained in:
cora32 2014-11-15 04:29:37 +03:00
parent e60cb3a02e
commit 9a60c9261d
2 changed files with 19 additions and 2 deletions

View File

@ -5,6 +5,15 @@
#include "externData.h" #include "externData.h"
#include "externFunctions.h" #include "externFunctions.h"
char *getHeader(char *buff)
{
char result[64] = {0};
char *ptr1 = strstri(buff, "http");
char *ptr2 = strstri(ptr1, "\r\n");
int sz = ptr2 - ptr1 - 8;
strncpy(result, ptr1 + 8, sz < 64 ? sz : 64);
return result;
}
int emitIfOK = -1; int emitIfOK = -1;
int KeyCheckerMain() int KeyCheckerMain()
{ {
@ -214,10 +223,18 @@ int KeyCheckerMain()
closesocket(sock); closesocket(sock);
return -1; return -1;
} }
else if(strstr(msg, "502 Bad Gateway") != NULL)
{
stt->doEmitionYellowFoundData("[NS-Track] 502 Backend not responding!");
closesocket(sock);
return -1;
}
else else
{ {
#pragma region QTGUI_Area #pragma region QTGUI_Area
stt->doEmitionYellowFoundData("[Key check] -FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ")"); char header[64] = {0};
strcpy(header, getHeader(msg));
stt->doEmitionYellowFoundData("[Key check] -FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: <u>" + QString::fromLocal8Bit(header) + "</u>");
if(gDebugMode) stt->doEmitionDebugFoundData(QString(msg)); if(gDebugMode) stt->doEmitionDebugFoundData(QString(msg));
#pragma endregion #pragma endregion
closesocket(sock); closesocket(sock);

View File

@ -28,7 +28,6 @@ int MaxPass = 0, MaxLogin = 0, MaxTags = 0, MaxWFLogin = 0, MaxWFPass = 0, MaxSS
int ipsstart[4], ipsend[4], int ipsstart[4], ipsend[4],
overallPorts, flCounter, octet[4]; overallPorts, flCounter, octet[4];
unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL; unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL;
unsigned int importFileSize = 0;
int gPingTimeout = 2000; int gPingTimeout = 2000;
double ips = 0; double ips = 0;
char top_level_domain[128] = {0}; char top_level_domain[128] = {0};
@ -1603,6 +1602,7 @@ void FileLoader(char *str)
char res[256] = {0}; char res[256] = {0};
char curIP[256] = {0}, curIPCopy[256] = {0}; char curIP[256] = {0}, curIPCopy[256] = {0};
char tempBuff[4] = {0}; char tempBuff[4] = {0};
unsigned int importFileSize = 0;
FILE *fl = fopen(str, "r"); FILE *fl = fopen(str, "r");
if(fl != NULL) if(fl != NULL)