summaryrefslogtreecommitdiff
path: root/testing/Messenger_test.c
diff options
context:
space:
mode:
authorCoren[m] <Break@Ocean>2013-09-09 20:14:24 +0200
committerCoren[m] <Break@Ocean>2013-09-09 21:03:31 +0200
commit05d7b157c6560d4545f815b60b8c43aca6981227 (patch)
tree06d110716cd2c1605b3bee97894092f8472fb134 /testing/Messenger_test.c
parenta77253c79b9c2acaa73164dcbd0694cb7b19db91 (diff)
tox.*, Messenger.*:
- initialisation: argument added to enable/disable ipv6 as socket Messenger_test.c: - initialisation: ipv4 hardcoded for now - delegating IP resolution to DHT_bootstrap_ex()
Diffstat (limited to 'testing/Messenger_test.c')
-rw-r--r--testing/Messenger_test.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index e85a85a2..04d3bc14 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -100,7 +100,8 @@ int main(int argc, char *argv[])
100 exit(0); 100 exit(0);
101 } 101 }
102 102
103 m = initMessenger(); 103 /* IPv6: maybe allow from cmdline --ipv6? sticking to IPv4 for now */
104 m = initMessenger(0);
104 105
105 if ( !m ) { 106 if ( !m ) {
106 fputs("Failed to allocate messenger datastructure\n", stderr); 107 fputs("Failed to allocate messenger datastructure\n", stderr);
@@ -108,10 +109,8 @@ int main(int argc, char *argv[])
108 } 109 }
109 110
110 if (argc > 3) { 111 if (argc > 3) {
111 IP_Port bootstrap_ip_port; 112 uint16_t port = htons(atoi(argv[2]));
112 bootstrap_ip_port.port = htons(atoi(argv[2])); 113 DHT_bootstrap_ex(m->dht, argv[1], port, hex_string_to_bin(argv[3]));
113 bootstrap_ip_port.ip.uint32 = inet_addr(argv[1]);
114 DHT_bootstrap(m->dht, bootstrap_ip_port, hex_string_to_bin(argv[3]));
115 } else { 114 } else {
116 FILE *file = fopen(argv[1], "rb"); 115 FILE *file = fopen(argv[1], "rb");
117 116