mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Congestion control tweaks.
This commit is contained in:
parent
240561b557
commit
b072c692e7
|
@ -2006,7 +2006,7 @@ static int udp_handle_packet(void *object, IP_Port source, const uint8_t *packet
|
||||||
#define PACKET_RESEND_MULTIPLIER 2
|
#define PACKET_RESEND_MULTIPLIER 2
|
||||||
|
|
||||||
/* Timeout for increasing speed after congestion event (in ms). */
|
/* Timeout for increasing speed after congestion event (in ms). */
|
||||||
#define CONGESTION_EVENT_TIMEOUT 4000
|
#define CONGESTION_EVENT_TIMEOUT 2000
|
||||||
|
|
||||||
static void send_crypto_packets(Net_Crypto *c)
|
static void send_crypto_packets(Net_Crypto *c)
|
||||||
{
|
{
|
||||||
|
@ -2086,7 +2086,7 @@ static void send_crypto_packets(Net_Crypto *c)
|
||||||
PACKET_COUNTER_AVERAGE_INTERVAL));
|
PACKET_COUNTER_AVERAGE_INTERVAL));
|
||||||
|
|
||||||
if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) {
|
if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) {
|
||||||
conn->packet_send_rate = min_speed * 1.2;
|
conn->packet_send_rate = min_speed * 1.25;
|
||||||
} else {
|
} else {
|
||||||
conn->packet_send_rate = min_speed;
|
conn->packet_send_rate = min_speed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user