mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
init_cryptopacket is now called by new_DHT.
This commit is contained in:
parent
f249084772
commit
7719a9ed58
|
@ -1169,6 +1169,7 @@ DHT *new_DHT(Net_Crypto *c)
|
||||||
networking_registerhandler(c->lossless_udp->net, NET_PACKET_PING_RESPONSE, &handle_ping_response, temp);
|
networking_registerhandler(c->lossless_udp->net, NET_PACKET_PING_RESPONSE, &handle_ping_response, temp);
|
||||||
networking_registerhandler(c->lossless_udp->net, NET_PACKET_GET_NODES, &handle_getnodes, temp);
|
networking_registerhandler(c->lossless_udp->net, NET_PACKET_GET_NODES, &handle_getnodes, temp);
|
||||||
networking_registerhandler(c->lossless_udp->net, NET_PACKET_SEND_NODES, &handle_sendnodes, temp);
|
networking_registerhandler(c->lossless_udp->net, NET_PACKET_SEND_NODES, &handle_sendnodes, temp);
|
||||||
|
init_cryptopackets(temp);
|
||||||
cryptopacket_registerhandler(c, CRYPTO_PACKET_NAT_PING, &handle_NATping, temp);
|
cryptopacket_registerhandler(c, CRYPTO_PACKET_NAT_PING, &handle_NATping, temp);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -660,7 +660,6 @@ Messenger *initMessenger(void)
|
||||||
friendreq_init(&(m->fr), m->net_crypto);
|
friendreq_init(&(m->fr), m->net_crypto);
|
||||||
LANdiscovery_init(m->dht);
|
LANdiscovery_init(m->dht);
|
||||||
set_nospam(&(m->fr), random_int());
|
set_nospam(&(m->fr), random_int());
|
||||||
init_cryptopackets(m->dht);
|
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ int main(int argc, char *argv[])
|
||||||
IP ip;
|
IP ip;
|
||||||
ip.i = 0;
|
ip.i = 0;
|
||||||
DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT)));
|
DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT)));
|
||||||
init_cryptopackets(dht);
|
|
||||||
manage_keys(dht);
|
manage_keys(dht);
|
||||||
printf("Public key: ");
|
printf("Public key: ");
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
|
@ -321,7 +321,6 @@ int main(int argc, char *argv[])
|
||||||
manage_keys(dht, server_conf.keys_file);
|
manage_keys(dht, server_conf.keys_file);
|
||||||
errno = tmperr;
|
errno = tmperr;
|
||||||
|
|
||||||
init_cryptopackets(dht);
|
|
||||||
/* Public key */
|
/* Public key */
|
||||||
int i;
|
int i;
|
||||||
printf("\nPublic Key: ");
|
printf("\nPublic Key: ");
|
||||||
|
|
|
@ -136,7 +136,6 @@ int main(int argc, char *argv[])
|
||||||
ip.i = 0;
|
ip.i = 0;
|
||||||
|
|
||||||
DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT)));
|
DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT)));
|
||||||
init_cryptopackets(dht);
|
|
||||||
|
|
||||||
if (argc < 4) {
|
if (argc < 4) {
|
||||||
printf("usage %s ip port public_key\n", argv[0]);
|
printf("usage %s ip port public_key\n", argv[0]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user