mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 09:41:29 -05:00
fixed proxy init
This commit is contained in:
parent
2456dbb2a0
commit
e7eb606a4a
@ -20,6 +20,8 @@ int pqiproxyconnection::proxy_negotiate_connection(int sockfd)
|
||||
|
||||
case PROXY_STATE_WAITING_SOCKS_RESPONSE:
|
||||
ret = Proxy_Connection_Complete(sockfd); // wait for ACK.
|
||||
|
||||
if(ret < 1)
|
||||
break;
|
||||
|
||||
case PROXY_STATE_CONNECTION_COMPLETE:
|
||||
@ -41,6 +43,8 @@ int pqiproxyconnection::proxy_negotiate_connection(int sockfd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(ret < 0)
|
||||
return -1;
|
||||
|
||||
#ifdef PROXY_DEBUG
|
||||
std::cerr << "pqisslproxy::Basic_Connection_Complete() IN PROGRESS";
|
||||
@ -225,8 +229,8 @@ int pqiproxyconnection::Proxy_Send_Address(int sockfd)
|
||||
return ret; // Method Response not complete.
|
||||
}
|
||||
|
||||
char socks_request[MAX_SOCKS_REQUEST_LEN] =
|
||||
{ 0x05, // SOCKS VERSION.
|
||||
char socks_request[MAX_SOCKS_REQUEST_LEN] = {
|
||||
0x05, // SOCKS VERSION.
|
||||
0x01, // CONNECT (Tor doesn't support BIND or UDP).
|
||||
0x00, // RESERVED.
|
||||
0x03, // ADDRESS TYPE (Domain Name)
|
||||
@ -237,9 +241,7 @@ int pqiproxyconnection::Proxy_Send_Address(int sockfd)
|
||||
uint8_t len = mDomainAddress.length();
|
||||
socks_request[4] = len;
|
||||
for(int i = 0; i < len; i++)
|
||||
{
|
||||
socks_request[5 + i] = mDomainAddress[i];
|
||||
}
|
||||
|
||||
/* now add the port, being careful with packing */
|
||||
uint16_t net_port = htons(mRemotePort);
|
||||
|
Loading…
x
Reference in New Issue
Block a user