Fixed possible bug.

This commit is contained in:
irungentoo 2015-12-17 16:15:20 -05:00
parent 07b4b041fb
commit dedf86311b
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -1704,6 +1704,7 @@ int accept_crypto_connection(Net_Crypto *c, New_Connection *n_c)
memcpy(conn->dht_public_key, n_c->dht_public_key, crypto_box_PUBLICKEYBYTES);
conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE;
conn->packet_send_rate_requested = CRYPTO_PACKET_MIN_RATE;
conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH;
conn->rtt_time = DEFAULT_PING_CONNECTION;
crypto_connection_add_source(c, crypt_connection_id, n_c->source);
@ -1746,6 +1747,7 @@ int new_crypto_connection(Net_Crypto *c, const uint8_t *real_public_key, const u
crypto_box_keypair(conn->sessionpublic_key, conn->sessionsecret_key);
conn->status = CRYPTO_CONN_COOKIE_REQUESTING;
conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE;
conn->packet_send_rate_requested = CRYPTO_PACKET_MIN_RATE;
conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH;
conn->rtt_time = DEFAULT_PING_CONNECTION;
memcpy(conn->dht_public_key, dht_public_key, crypto_box_PUBLICKEYBYTES);