summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-08-13 10:19:09 -0400
committerirungentoo <irungentoo@gmail.com>2014-08-13 10:19:09 -0400
commit6311bf8747914a25dfd323c75578fca3e264619f (patch)
tree1cf8fe70f3530fd0f67f58bcf23ab05c16f12747
parentbc4fe2c80d72926f588044fb7e7b18524dcd2bca (diff)
If the path is a TCP one, the onion packet is sent with TCP.
-rw-r--r--toxcore/onion_client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index cffcb961..3036df8c 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -188,9 +188,16 @@ static int send_onion_packet_tcp_udp(const Onion_Client *onion_c, const Onion_Pa
188 return -1; 188 return -1;
189 189
190 return 0; 190 return 0;
191 } else { 191 } else if (path->ip_port1.ip.family == TCP_FAMILY) {
192 uint8_t packet[ONION_MAX_PACKET_SIZE];
193 int len = create_onion_packet_tcp(packet, sizeof(packet), path, dest, data, length);
192 194
193 return -1; //TODO: TCP 195 if (len == -1)
196 return -1;
197
198 return send_tcp_onion_request(onion_c->c, packet, len);
199 } else {
200 return -1;
194 } 201 }
195} 202}
196 203