summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-22 15:36:13 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-22 15:36:13 -0400
commit8e43282fa9c48b7ff8630a6039bba815f1a1f283 (patch)
treefb568a3cd3fd4093fe13a501494ca1b32f8e95fc
parent37b7e4c12e9c9fdbf1544ac5325af3c8cd7020bb (diff)
Bootstrap servers now route friend requests.
-rw-r--r--other/DHT_bootstrap.c6
-rw-r--r--other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index f795482b..9ae22caa 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -3,12 +3,13 @@
3 * A simple DHT boostrap server for tox. 3 * A simple DHT boostrap server for tox.
4 * 4 *
5 * Build commands (use one or the other): 5 * Build commands (use one or the other):
6 * 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 6 * 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
7 * 7 *
8 * 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 8 * 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
9 */ 9 */
10 10
11#include "../core/DHT.h" 11#include "../core/DHT.h"
12#include "../core/friend_requests.h"
12 13
13//Sleep function (x = milliseconds) 14//Sleep function (x = milliseconds)
14#ifdef WIN32 15#ifdef WIN32
@@ -82,6 +83,7 @@ int main(int argc, char *argv[])
82 while(receivepacket(&ip_port, data, &length) != -1) 83 while(receivepacket(&ip_port, data, &length) != -1)
83 { 84 {
84 DHT_handlepacket(data, length, ip_port); 85 DHT_handlepacket(data, length, ip_port);
86 friendreq_handlepacket(data, length, ip_port);
85 } 87 }
86 c_sleep(1); 88 c_sleep(1);
87 } 89 }
diff --git a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
index 276821e6..f060710b 100644
--- a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
+++ b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
@@ -11,6 +11,8 @@
11#include <errno.h> 11#include <errno.h>
12 12
13#include "../core/DHT.h" 13#include "../core/DHT.h"
14#include "../core/friend_requests.h"
15
14 16
15/* Sleep function (x = milliseconds) */ 17/* Sleep function (x = milliseconds) */
16#ifdef WIN32 18#ifdef WIN32
@@ -123,6 +125,7 @@ int main(int argc, char *argv[]) {
123 doDHT(); 125 doDHT();
124 while(receivepacket(&ip_port, data, &length) != -1) { 126 while(receivepacket(&ip_port, data, &length) != -1) {
125 DHT_handlepacket(data, length, ip_port); 127 DHT_handlepacket(data, length, ip_port);
128 friendreq_handlepacket(data, length, ip_port);
126 } 129 }
127 c_sleep(1); 130 c_sleep(1);
128 } 131 }