aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_connection_timeout.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-01 16:23:25 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-01 16:23:25 +0000
commitf0aa7bc0a136b1e436018ef72e1c814f04c33379 (patch)
treed52c0ad69e3507610fb3271f1f5273bd4d05c124 /src/util/test_connection_timeout.c
parent028a762caf0c2e1cc7b23a9dc4becf9859d13c15 (diff)
downloadgnunet-f0aa7bc0a136b1e436018ef72e1c814f04c33379.tar.gz
gnunet-f0aa7bc0a136b1e436018ef72e1c814f04c33379.zip
moving resolver to util, making DNS lookups asynchronous in util
Diffstat (limited to 'src/util/test_connection_timeout.c')
-rw-r--r--src/util/test_connection_timeout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/test_connection_timeout.c b/src/util/test_connection_timeout.c
index 2a1ce58f3..73433e434 100644
--- a/src/util/test_connection_timeout.c
+++ b/src/util/test_connection_timeout.c
@@ -37,6 +37,8 @@ static struct GNUNET_CONNECTION_Handle *lsock;
37 37
38static struct GNUNET_NETWORK_Handle *ls; 38static struct GNUNET_NETWORK_Handle *ls;
39 39
40static struct GNUNET_CONFIGURATION_Handle *cfg;
41
40 42
41/** 43/**
42 * Create and initialize a listen socket for the server. 44 * Create and initialize a listen socket for the server.
@@ -105,8 +107,8 @@ task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
105 ls = open_listen_socket (); 107 ls = open_listen_socket ();
106 lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0); 108 lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0);
107 GNUNET_assert (lsock != NULL); 109 GNUNET_assert (lsock != NULL);
108 csock = GNUNET_CONNECTION_create_from_connect (tc->sched, 110 csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg,
109 "localhost", PORT, 1024); 111 "localhost", PORT, 1024);
110 GNUNET_assert (csock != NULL); 112 GNUNET_assert (csock != NULL);
111 GNUNET_assert (NULL != 113 GNUNET_assert (NULL !=
112 GNUNET_CONNECTION_notify_transmit_ready (csock, 114 GNUNET_CONNECTION_notify_transmit_ready (csock,
@@ -126,7 +128,11 @@ check_timeout ()
126 int ok; 128 int ok;
127 129
128 ok = 1; 130 ok = 1;
131 cfg = GNUNET_CONFIGURATION_create ();
132 GNUNET_CONFIGURATION_set_value_string (cfg,
133 "resolver", "HOSTNAME", "localhost");
129 GNUNET_SCHEDULER_run (&task_timeout, &ok); 134 GNUNET_SCHEDULER_run (&task_timeout, &ok);
135 GNUNET_CONFIGURATION_destroy (cfg);
130 return ok; 136 return ok;
131} 137}
132 138