| 1603 | } |
| 1604 | |
| 1605 | bool CUpDownClient::Connect() |
| 1606 | { |
| 1607 | m_hasbeenobfuscatinglately = false; |
| 1608 | |
| 1609 | if (!m_socket->IsOk()) { |
| 1610 | // Enable or disable crypting based on our and the remote clients preference |
| 1611 | if (HasValidHash() && SupportsCryptLayer() && thePrefs::IsClientCryptLayerSupported() && (RequestsCryptLayer() || thePrefs::IsClientCryptLayerRequested())){ |
| 1612 | m_socket->SetConnectionEncryption(true, GetUserHash().GetHash(), false); |
| 1613 | } else { |
| 1614 | m_socket->SetConnectionEncryption(false, NULL, false); |
| 1615 | } |
| 1616 | amuleIPV4Address tmp; |
| 1617 | tmp.Hostname(GetConnectIP()); |
| 1618 | tmp.Service(GetUserPort()); |
| 1619 | AddDebugLogLineN(logClient, "Trying to connect to " + Uint32_16toStringIP_Port(GetConnectIP(),GetUserPort())); |
| 1620 | m_socket->Connect(tmp, false); |
| 1621 | // We should send hello packets AFTER connecting! |
| 1622 | // so I moved it to OnConnect |
| 1623 | return true; |
| 1624 | } else { |
| 1625 | return false; |
| 1626 | } |
| 1627 | } |
| 1628 | |
| 1629 | void CUpDownClient::ConnectionEstablished() |
| 1630 | { |
nothing calls this directly
no test coverage detected