diff --git a/netbase.cpp b/netbase.cpp index dc0490c..e64fc54 100644 --- a/netbase.cpp +++ b/netbase.cpp @@ -183,12 +183,8 @@ bool CIPPort::ConnectSocket(SOCKET& hSocketRet, int nTimeout) const setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif - bool fProxy = (fUseProxy && IsRoutable()); struct sockaddr_in sockaddr; - if (fProxy) - addrProxy.GetSockAddr(&sockaddr); - else - GetSockAddr(&sockaddr); + GetSockAddr(&sockaddr); #ifdef WIN32 u_long fNonblock = 1; @@ -273,39 +269,6 @@ bool CIPPort::ConnectSocket(SOCKET& hSocketRet, int nTimeout) const return false; } - if (fProxy) - { - printf("proxy connecting %s\n", ToString().c_str()); - char pszSocks4IP[] = "\4\1\0\0\0\0\0\0user"; - struct sockaddr_in addr; - GetSockAddr(&addr); - memcpy(pszSocks4IP + 2, &addr.sin_port, 2); - memcpy(pszSocks4IP + 4, &addr.sin_addr, 4); - char* pszSocks4 = pszSocks4IP; - int nSize = sizeof(pszSocks4IP); - - int ret = send(hSocket, pszSocks4, nSize, MSG_NOSIGNAL); - if (ret != nSize) - { - closesocket(hSocket); - return false; - } - char pchRet[8]; - if (recv(hSocket, pchRet, 8, 0) != 8) - { - closesocket(hSocket); - return false; - } - if (pchRet[1] != 0x5a) - { - closesocket(hSocket); - if (pchRet[1] != 0x5b) - printf("ERROR: Proxy returned error %d\n", pchRet[1]); - return false; - } - printf("proxy connected %s\n", ToString().c_str()); - } - hSocketRet = hSocket; return true; } diff --git a/protocol.cpp b/protocol.cpp index dc3761e..e5e4e56 100644 --- a/protocol.cpp +++ b/protocol.cpp @@ -22,6 +22,8 @@ static const char* ppszTypeName[] = "block", }; +unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 }; + CMessageHeader::CMessageHeader() { memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));