mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Bootstrap servers now route friend requests.
This commit is contained in:
parent
37b7e4c12e
commit
8e43282fa9
@ -3,12 +3,13 @@
|
|||||||
* A simple DHT boostrap server for tox.
|
* A simple DHT boostrap server for tox.
|
||||||
*
|
*
|
||||||
* Build commands (use one or the other):
|
* Build commands (use one or the other):
|
||||||
* gcc -O2 -Wall -D VANILLA_NACL -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/{cpucycles.o,libnacl.a,randombytes.o} DHT_bootstrap.c
|
* gcc -O2 -Wall -D VANILLA_NACL -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../core/friend_requests.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/{cpucycles.o,libnacl.a,randombytes.o} DHT_bootstrap.c
|
||||||
*
|
*
|
||||||
* gcc -O2 -Wall -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c -lsodium DHT_bootstrap.c
|
* gcc -O2 -Wall -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../core/friend_requests.c -lsodium DHT_bootstrap.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../core/DHT.h"
|
#include "../core/DHT.h"
|
||||||
|
#include "../core/friend_requests.h"
|
||||||
|
|
||||||
//Sleep function (x = milliseconds)
|
//Sleep function (x = milliseconds)
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -82,6 +83,7 @@ int main(int argc, char *argv[])
|
|||||||
while(receivepacket(&ip_port, data, &length) != -1)
|
while(receivepacket(&ip_port, data, &length) != -1)
|
||||||
{
|
{
|
||||||
DHT_handlepacket(data, length, ip_port);
|
DHT_handlepacket(data, length, ip_port);
|
||||||
|
friendreq_handlepacket(data, length, ip_port);
|
||||||
}
|
}
|
||||||
c_sleep(1);
|
c_sleep(1);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "../core/DHT.h"
|
#include "../core/DHT.h"
|
||||||
|
#include "../core/friend_requests.h"
|
||||||
|
|
||||||
|
|
||||||
/* Sleep function (x = milliseconds) */
|
/* Sleep function (x = milliseconds) */
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -123,6 +125,7 @@ int main(int argc, char *argv[]) {
|
|||||||
doDHT();
|
doDHT();
|
||||||
while(receivepacket(&ip_port, data, &length) != -1) {
|
while(receivepacket(&ip_port, data, &length) != -1) {
|
||||||
DHT_handlepacket(data, length, ip_port);
|
DHT_handlepacket(data, length, ip_port);
|
||||||
|
friendreq_handlepacket(data, length, ip_port);
|
||||||
}
|
}
|
||||||
c_sleep(1);
|
c_sleep(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user