summaryrefslogtreecommitdiff
path: root/other/DHT_bootstrap.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-10 14:21:06 -0700
committerirungentoo <irungentoo@gmail.com>2013-08-10 14:21:06 -0700
commit6c2b2806d10881a4c44a47e877898e9de1cc63c9 (patch)
tree2879741f06260a5390ae619954f53f141ba4ce54 /other/DHT_bootstrap.c
parent341de59bb627600c27ef29b113fa71bac120350f (diff)
parent5b6465528f88c4ed45fe57d5c2c21270f9109bb9 (diff)
Merge pull request #415 from slvr/pr
Beginning to centralise packet handling
Diffstat (limited to 'other/DHT_bootstrap.c')
-rw-r--r--other/DHT_bootstrap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index befe2225..4b0adeff 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -113,9 +113,8 @@ int main(int argc, char *argv[])
113 free(bootstrap_key); 113 free(bootstrap_key);
114 } 114 }
115 115
116 IP_Port ip_port; 116 DHT_init();
117 uint8_t data[MAX_UDP_PACKET_SIZE]; 117 friendreq_init();
118 uint32_t length;
119 118
120 int is_waiting_for_dht_connection = 1; 119 int is_waiting_for_dht_connection = 1;
121 while(1) 120 while(1)
@@ -127,11 +126,8 @@ int main(int argc, char *argv[])
127 } 126 }
128 doDHT(); 127 doDHT();
129 128
130 while(receivepacket(&ip_port, data, &length) != -1) 129 networking_poll();
131 { 130
132 DHT_handlepacket(data, length, ip_port);
133 friendreq_handlepacket(data, length, ip_port);
134 }
135 c_sleep(1); 131 c_sleep(1);
136 } 132 }
137 shutdown_networking(); 133 shutdown_networking();