diff options
Diffstat (limited to 'toxcore/net_crypto.h')
-rw-r--r-- | toxcore/net_crypto.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index b9fb1747..7e59475e 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -86,7 +86,7 @@ | |||
86 | 86 | ||
87 | /* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken | 87 | /* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken |
88 | at the dT defined in net_crypto.c */ | 88 | at the dT defined in net_crypto.c */ |
89 | #define CONGESTION_QUEUE_ARRAY_SIZE 8 | 89 | #define CONGESTION_QUEUE_ARRAY_SIZE 24 |
90 | 90 | ||
91 | typedef struct { | 91 | typedef struct { |
92 | uint64_t time; | 92 | uint64_t time; |
@@ -364,12 +364,19 @@ int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key); | |||
364 | void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, | 364 | void 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 | */ | ||
372 | int 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 | */ |
372 | int send_tcp_onion_request(Net_Crypto *c, const uint8_t *data, uint16_t length); | 379 | int 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. |