Bootstrap servers now route friend requests.

This commit is contained in:
irungentoo 2013-07-22 15:36:13 -04:00
parent 37b7e4c12e
commit 8e43282fa9
2 changed files with 7 additions and 2 deletions

View File

@ -3,12 +3,13 @@
* A simple DHT boostrap server for tox.
*
* 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/friend_requests.h"
//Sleep function (x = milliseconds)
#ifdef WIN32
@ -82,6 +83,7 @@ int main(int argc, char *argv[])
while(receivepacket(&ip_port, data, &length) != -1)
{
DHT_handlepacket(data, length, ip_port);
friendreq_handlepacket(data, length, ip_port);
}
c_sleep(1);
}

View File

@ -11,6 +11,8 @@
#include <errno.h>
#include "../core/DHT.h"
#include "../core/friend_requests.h"
/* Sleep function (x = milliseconds) */
#ifdef WIN32
@ -123,6 +125,7 @@ int main(int argc, char *argv[]) {
doDHT();
while(receivepacket(&ip_port, data, &length) != -1) {
DHT_handlepacket(data, length, ip_port);
friendreq_handlepacket(data, length, ip_port);
}
c_sleep(1);
}