If the path is a TCP one, the onion packet is sent with TCP.

This commit is contained in:
irungentoo 2014-08-13 10:19:09 -04:00
parent bc4fe2c80d
commit 6311bf8747
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -188,9 +188,16 @@ static int send_onion_packet_tcp_udp(const Onion_Client *onion_c, const Onion_Pa
return -1;
return 0;
} else {
} else if (path->ip_port1.ip.family == TCP_FAMILY) {
uint8_t packet[ONION_MAX_PACKET_SIZE];
int len = create_onion_packet_tcp(packet, sizeof(packet), path, dest, data, length);
return -1; //TODO: TCP
if (len == -1)
return -1;
return send_tcp_onion_request(onion_c->c, packet, len);
} else {
return -1;
}
}