члени, а область видимості інших звужена
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
IA_CLIENT_PROT::IA_CLIENT_PROT(const string & sn, unsigned short p, uint16_t localPort)
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
IA_CLIENT_PROT::IA_CLIENT_PROT(const string & sn, unsigned short p, uint16_t localPort)
- : stat(),
- action(IA_NONE),
- messageText(),
- infoText(),
- strError(),
isNetPrepared(false),
proxyMode(false),
isNetPrepared(false),
proxyMode(false),
serverName(sn),
port(p),
ip(0),
serverName(sn),
port(p),
ip(0),
infoCbData(NULL),
errorCbData(NULL),
dirNameCbData(NULL),
infoCbData(NULL),
errorCbData(NULL),
dirNameCbData(NULL),
connSyn8(NULL),
connSynAck8(NULL),
connAck8(NULL),
connSyn8(NULL),
connSynAck8(NULL),
connAck8(NULL),
disconnSyn8(NULL),
disconnSynAck8(NULL),
disconnAck8(NULL),
disconnSyn8(NULL),
disconnSynAck8(NULL),
disconnAck8(NULL),
info(NULL)
{
memset(&stat, 0, sizeof(stat));
info(NULL)
{
memset(&stat, 0, sizeof(stat));
packetTypes["INFO_8"] = INFO_8_N;
unsigned char key[IA_PASSWD_LEN];
packetTypes["INFO_8"] = INFO_8_N;
unsigned char key[IA_PASSWD_LEN];
-memset(key, 0, IA_LOGIN_LEN);
+memset(key, 0, IA_PASSWD_LEN);
strncpy((char *)key, "pr7Hhen", 8);
Blowfish_Init(&ctxHdr, key, IA_PASSWD_LEN);
strncpy((char *)key, "pr7Hhen", 8);
Blowfish_Init(&ctxHdr, key, IA_PASSWD_LEN);
+
+memset(key, 0, IA_PASSWD_LEN);
+Blowfish_Init(&ctxPass, key, IA_PASSWD_LEN);
+
+for (size_t i = 0; i < DIR_NUM; ++i)
+ {
+ selectedDirs[i] = false;
+ }
+
+servAddr.sin_family = AF_INET;
+servAddr.sin_port = htons(port);
+servAddr.sin_addr.s_addr = ip;
}
//---------------------------------------------------------------------------
void IA_CLIENT_PROT::PrepareNet()
}
//---------------------------------------------------------------------------
void IA_CLIENT_PROT::PrepareNet()
strError = string("Unknown host ") + "\'" + serverName + "\'";
codeError = IA_GETHOSTBYNAME_ERROR;
if (pErrorCb != NULL)
strError = string("Unknown host ") + "\'" + serverName + "\'";
codeError = IA_GETHOSTBYNAME_ERROR;
if (pErrorCb != NULL)
- pErrorCb(messageText, IA_GETHOSTBYNAME_ERROR, errorCbData);
+ pErrorCb(strError, IA_GETHOSTBYNAME_ERROR, errorCbData);
sockr = socket(AF_INET, SOCK_DGRAM, 0); // Cîêåò ÷åðåç êîòîðûé øëåì è ïðèíèìàåì
sockr = socket(AF_INET, SOCK_DGRAM, 0); // Cîêåò ÷åðåç êîòîðûé øëåì è ïðèíèìàåì
-localAddrS.sin_family = AF_INET;
-localAddrS.sin_port = htons(port);
-localAddrS.sin_addr.s_addr = inet_addr("0.0.0.0");
-
+struct sockaddr_in localAddrR; // Íàø àäðåñ
localAddrR.sin_family = AF_INET;
if (localPort)
localAddrR.sin_family = AF_INET;
if (localPort)
strError = "bind error";
codeError = IA_BIND_ERROR;
if (pErrorCb != NULL)
strError = "bind error";
codeError = IA_BIND_ERROR;
if (pErrorCb != NULL)
- pErrorCb(messageText, IA_BIND_ERROR, errorCbData);
+ pErrorCb(strError, IA_BIND_ERROR, errorCbData);
strError = "fcntl error";
codeError = IA_FCNTL_ERROR;
if (pErrorCb != NULL)
strError = "fcntl error";
codeError = IA_FCNTL_ERROR;
if (pErrorCb != NULL)
- pErrorCb(messageText, IA_FCNTL_ERROR, errorCbData);
+ pErrorCb(strError, IA_FCNTL_ERROR, errorCbData);
uint32_t ip; // Proxy IP
uint32_t localPort;
uint32_t ip; // Proxy IP
uint32_t localPort;
- struct sockaddr_in localAddrS; // Íàø àäðåñ
- struct sockaddr_in localAddrR; // Íàø àäðåñ
struct sockaddr_in servAddr; // àäðåñ ñåðâåðà
bool firstConnect;
struct sockaddr_in servAddr; // àäðåñ ñåðâåðà
bool firstConnect;