diff options
author | Coren[m] <Break@Ocean> | 2013-09-09 20:14:24 +0200 |
---|---|---|
committer | Coren[m] <Break@Ocean> | 2013-09-09 20:14:24 +0200 |
commit | f932fd400c12271edeec6abf06fd00a554848419 (patch) | |
tree | 6d1d7fe1b67204df16dce1e6c371f341cac22589 /testing/Messenger_test.c | |
parent | a77253c79b9c2acaa73164dcbd0694cb7b19db91 (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.c | 9 |
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 | ||