summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-01-16 21:33:11 -0500
committerirungentoo <irungentoo@gmail.com>2015-01-16 21:33:11 -0500
commit0fff7d999404ec6e68dad2b4cbc283e34c198087 (patch)
tree81076a0215fc7fec7c206f2f943d2bbacb3608f2 /toxcore/net_crypto.h
parent553a8dd7bdab4bfed36352bb3fdf2ce2f514d0fb (diff)
Tox should work better on TCP only when some people have broken TCP
nodes and don't update them. Paths now try to use the same TCP node for their entire lifetime.
Diffstat (limited to 'toxcore/net_crypto.h')
-rw-r--r--toxcore/net_crypto.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h
index b9fb1747..9d699340 100644
--- a/toxcore/net_crypto.h
+++ b/toxcore/net_crypto.h
@@ -364,12 +364,19 @@ int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key);
364void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, 364void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data,
365 uint16_t length), void *object); 365 uint16_t length), void *object);
366 366
367/* Send an onion packet via a random connected TCP relay. 367/* Return a random TCP connection number for use in send_tcp_onion_request.
368 *
369 * return TCP connection number on success.
370 * return -1 on failure.
371 */
372int get_random_tcp_con_number(Net_Crypto *c);
373
374/* Send an onion packet via the TCP relay corresponding to TCP_conn_number.
368 * 375 *
369 * return 0 on success. 376 * return 0 on success.
370 * return -1 on failure. 377 * return -1 on failure.
371 */ 378 */
372int send_tcp_onion_request(Net_Crypto *c, const uint8_t *data, uint16_t length); 379int send_tcp_onion_request(Net_Crypto *c, unsigned int TCP_conn_number, const uint8_t *data, uint16_t length);
373 380
374/* Copy a maximum of num TCP relays we are connected to to tcp_relays. 381/* Copy a maximum of num TCP relays we are connected to to tcp_relays.
375 * NOTE that the family of the copied ip ports will be set to TCP_INET or TCP_INET6. 382 * NOTE that the family of the copied ip ports will be set to TCP_INET or TCP_INET6.