CFtpClientReqSocket::CFtpClientReqSocket(CUpDownClient* client) : CClientReqSocket(client)
{
	SetConnectionEncryption(false, NULL, false); 
	m_FtpState = ftpNone;
	m_bPassive = TRUE;

	m_bDecLaunchTimes = FALSE;
	m_bServerErr = FALSE; 
}
示例#2
0
void CServerSocket::ConnectTo(CServer* server, bool bNoCrypt)
{
	if (cur_server){
		ASSERT(0);
		delete cur_server;
		cur_server = NULL;
	}

	uint16 nPort = 0;
	cur_server = new CServer(server);
	if ( !bNoCrypt && thePrefs.IsServerCryptLayerTCPRequested() && server->GetObfuscationPortTCP() != 0 && server->SupportsObfuscationTCP()){
		Log(GetResString(IDS_CONNECTINGTOOBFUSCATED), cur_server->GetListName(), cur_server->GetAddress(), cur_server->GetObfuscationPortTCP());
		nPort = cur_server->GetObfuscationPortTCP();
		SetConnectionEncryption(true, NULL, true);
	}
	else{
		Log(GetResString(IDS_CONNECTINGTO), cur_server->GetListName(), cur_server->GetAddress(), cur_server->GetPort());
		nPort = cur_server->GetPort();
		SetConnectionEncryption(false, NULL, true);
	}

	// IP-filter: We do not need to IP-filter any servers here, even dynIP-servers are not
	// needed to get filtered here.
	//	1.) Non dynIP-servers were already IP-filtered when they were added to the server
	//		list.
	//	2.) Whenever the IP-filter is updated all servers for which an IP is known (this
	//		includes also dynIP-servers for which we received already an IP) get filtered.
	//	3.)	dynIP-servers get filtered after their DN was resolved. For TCP-connections this
	//		is done in OnConnect. For outgoing UDP packets this is done when explicitly
	//		resolving the DN right before sending the UDP packet.
	//
	SetConnectionState(CS_CONNECTING);
	if (!Connect(CStringA(server->GetAddress()), nPort)){
		DWORD dwError = GetLastError();
		if (dwError != WSAEWOULDBLOCK){
			LogError(GetResString(IDS_ERR_CONNECTIONERROR), cur_server->GetListName(), cur_server->GetAddress(), nPort, GetFullErrorMessage(dwError));
			SetConnectionState(CS_FATALERROR);
			return;
		}
	}
}
CHttpClientReqSocket::CHttpClientReqSocket(CUpDownClient* client)
	: CClientReqSocket(client)
{
	SetHttpState(HttpStateUnknown);
	SetConnectionEncryption(false, NULL, false); // just to make sure - disable protocol encryption explicit
}
CFtpClientDataSocket::CFtpClientDataSocket(CUpDownClient* in_client) : CClientReqSocket(NULL)
{	
	client = in_client; //can not call SetClient here!!
	SetConnectionEncryption(false, NULL, false); // just to make sure - disable protocol encryption explicit
}