diff options
author | irungentoo <irungentoo@gmail.com> | 2014-07-14 16:37:43 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-07-14 16:37:43 -0400 |
commit | 2ea634ece28b11ef204b3669a42dde30c5e24ffe (patch) | |
tree | 9072e9082aae372d5fbd6bc167a9e278fe4b40b9 /toxcore | |
parent | 4da8664a1521f2feeafbe8c036380c670cbc6d32 (diff) |
Set packets_left to default non zero values when creating connection.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/net_crypto.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 10921abb..3751d0e2 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -1485,6 +1485,7 @@ int accept_crypto_connection(Net_Crypto *c, New_Connection *n_c) | |||
1485 | /* Status needs to be CRYPTO_CONN_NOT_CONFIRMED for this to work. */ | 1485 | /* Status needs to be CRYPTO_CONN_NOT_CONFIRMED for this to work. */ |
1486 | set_connection_dht_public_key(c, crypt_connection_id, n_c->dht_public_key, current_time_monotonic()); | 1486 | set_connection_dht_public_key(c, crypt_connection_id, n_c->dht_public_key, current_time_monotonic()); |
1487 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; | 1487 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; |
1488 | conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH; | ||
1488 | crypto_connection_add_source(c, crypt_connection_id, n_c->source); | 1489 | crypto_connection_add_source(c, crypt_connection_id, n_c->source); |
1489 | return crypt_connection_id; | 1490 | return crypt_connection_id; |
1490 | } | 1491 | } |
@@ -1517,6 +1518,7 @@ int new_crypto_connection(Net_Crypto *c, const uint8_t *real_public_key) | |||
1517 | crypto_box_keypair(conn->sessionpublic_key, conn->sessionsecret_key); | 1518 | crypto_box_keypair(conn->sessionpublic_key, conn->sessionsecret_key); |
1518 | conn->status = CRYPTO_CONN_COOKIE_REQUESTING; | 1519 | conn->status = CRYPTO_CONN_COOKIE_REQUESTING; |
1519 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; | 1520 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; |
1521 | conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH; | ||
1520 | return crypt_connection_id; | 1522 | return crypt_connection_id; |
1521 | } | 1523 | } |
1522 | 1524 | ||