diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-08-19 13:07:45 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-27 01:16:14 +0100 |
commit | 13ae9e9a93a1c02fad9475002c0391b86b7ad7bb (patch) | |
tree | a9575d3582c4f40e051c93ae18dded03fdddc432 /auto_tests/onion_test.c | |
parent | 1f25fc0ae417bfc47dea4966cb5e43689aa88d5c (diff) |
Move logging to a callback.
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
Diffstat (limited to 'auto_tests/onion_test.c')
-rw-r--r-- | auto_tests/onion_test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c index 279467dc..08904218 100644 --- a/auto_tests/onion_test.c +++ b/auto_tests/onion_test.c | |||
@@ -131,8 +131,8 @@ START_TEST(test_basic) | |||
131 | IP ip; | 131 | IP ip; |
132 | ip_init(&ip, 1); | 132 | ip_init(&ip, 1); |
133 | ip.ip6.uint8[15] = 1; | 133 | ip.ip6.uint8[15] = 1; |
134 | Onion *onion1 = new_onion(new_DHT(new_networking(ip, 34567))); | 134 | Onion *onion1 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34567))); |
135 | Onion *onion2 = new_onion(new_DHT(new_networking(ip, 34568))); | 135 | Onion *onion2 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34568))); |
136 | ck_assert_msg((onion1 != NULL) && (onion2 != NULL), "Onion failed initializing."); | 136 | ck_assert_msg((onion1 != NULL) && (onion2 != NULL), "Onion failed initializing."); |
137 | networking_registerhandler(onion2->net, 'I', &handle_test_1, onion2); | 137 | networking_registerhandler(onion2->net, 'I', &handle_test_1, onion2); |
138 | 138 | ||
@@ -209,7 +209,7 @@ START_TEST(test_basic) | |||
209 | } | 209 | } |
210 | 210 | ||
211 | c_sleep(1000); | 211 | c_sleep(1000); |
212 | Onion *onion3 = new_onion(new_DHT(new_networking(ip, 34569))); | 212 | Onion *onion3 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34569))); |
213 | ck_assert_msg((onion3 != NULL), "Onion failed initializing."); | 213 | ck_assert_msg((onion3 != NULL), "Onion failed initializing."); |
214 | 214 | ||
215 | new_nonce(nonce); | 215 | new_nonce(nonce); |
@@ -272,11 +272,11 @@ Onions *new_onions(uint16_t port) | |||
272 | ip_init(&ip, 1); | 272 | ip_init(&ip, 1); |
273 | ip.ip6.uint8[15] = 1; | 273 | ip.ip6.uint8[15] = 1; |
274 | Onions *on = malloc(sizeof(Onions)); | 274 | Onions *on = malloc(sizeof(Onions)); |
275 | DHT *dht = new_DHT(new_networking(ip, port)); | 275 | DHT *dht = new_DHT(NULL, new_networking(NULL, ip, port)); |
276 | on->onion = new_onion(dht); | 276 | on->onion = new_onion(dht); |
277 | on->onion_a = new_onion_announce(dht); | 277 | on->onion_a = new_onion_announce(dht); |
278 | TCP_Proxy_Info inf = {{{0}}}; | 278 | TCP_Proxy_Info inf = {{{0}}}; |
279 | on->onion_c = new_onion_client(new_net_crypto(dht, &inf)); | 279 | on->onion_c = new_onion_client(new_net_crypto(NULL, dht, &inf)); |
280 | 280 | ||
281 | if (on->onion && on->onion_a && on->onion_c) | 281 | if (on->onion && on->onion_a && on->onion_c) |
282 | return on; | 282 | return on; |