diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-01 16:23:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-01 16:23:25 +0000 |
commit | f0aa7bc0a136b1e436018ef72e1c814f04c33379 (patch) | |
tree | d52c0ad69e3507610fb3271f1f5273bd4d05c124 /src/util/test_connection_transmit_cancel.c | |
parent | 028a762caf0c2e1cc7b23a9dc4becf9859d13c15 (diff) | |
download | gnunet-f0aa7bc0a136b1e436018ef72e1c814f04c33379.tar.gz gnunet-f0aa7bc0a136b1e436018ef72e1c814f04c33379.zip |
moving resolver to util, making DNS lookups asynchronous in util
Diffstat (limited to 'src/util/test_connection_transmit_cancel.c')
-rw-r--r-- | src/util/test_connection_transmit_cancel.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/test_connection_transmit_cancel.c b/src/util/test_connection_transmit_cancel.c index 642ea0d4c..5ec19bdb1 100644 --- a/src/util/test_connection_transmit_cancel.c +++ b/src/util/test_connection_transmit_cancel.c | |||
@@ -31,6 +31,8 @@ | |||
31 | 31 | ||
32 | #define PORT 12435 | 32 | #define PORT 12435 |
33 | 33 | ||
34 | static struct GNUNET_CONFIGURATION_Handle *cfg; | ||
35 | |||
34 | 36 | ||
35 | static size_t | 37 | static size_t |
36 | not_run (void *cls, size_t size, void *buf) | 38 | not_run (void *cls, size_t size, void *buf) |
@@ -48,8 +50,8 @@ task_transmit_cancel (void *cls, | |||
48 | struct GNUNET_CONNECTION_TransmitHandle *th; | 50 | struct GNUNET_CONNECTION_TransmitHandle *th; |
49 | struct GNUNET_CONNECTION_Handle *csock; | 51 | struct GNUNET_CONNECTION_Handle *csock; |
50 | 52 | ||
51 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, | 53 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg, |
52 | "localhost", PORT, 1024); | 54 | "localhost", PORT, 1024); |
53 | GNUNET_assert (csock != NULL); | 55 | GNUNET_assert (csock != NULL); |
54 | th = GNUNET_CONNECTION_notify_transmit_ready (csock, | 56 | th = GNUNET_CONNECTION_notify_transmit_ready (csock, |
55 | 12, | 57 | 12, |
@@ -72,7 +74,11 @@ check_transmit_cancel () | |||
72 | int ok; | 74 | int ok; |
73 | 75 | ||
74 | ok = 1; | 76 | ok = 1; |
77 | cfg = GNUNET_CONFIGURATION_create (); | ||
78 | GNUNET_CONFIGURATION_set_value_string (cfg, | ||
79 | "resolver", "HOSTNAME", "localhost"); | ||
75 | GNUNET_SCHEDULER_run (&task_transmit_cancel, &ok); | 80 | GNUNET_SCHEDULER_run (&task_transmit_cancel, &ok); |
81 | GNUNET_CONFIGURATION_destroy (cfg); | ||
76 | return ok; | 82 | return ok; |
77 | } | 83 | } |
78 | 84 | ||