aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-get-peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-dht-get-peer.c')
-rw-r--r--src/dht/gnunet-dht-get-peer.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/dht/gnunet-dht-get-peer.c b/src/dht/gnunet-dht-get-peer.c
index f6974cddb..8d318efc2 100644
--- a/src/dht/gnunet-dht-get-peer.c
+++ b/src/dht/gnunet-dht-get-peer.c
@@ -52,10 +52,6 @@ static int verbose;
52 */ 52 */
53static struct GNUNET_DHT_Handle *dht_handle; 53static struct GNUNET_DHT_Handle *dht_handle;
54 54
55/**
56 * Global handle of the scheduler
57 */
58static struct GNUNET_SCHEDULER_Handle *sched;
59 55
60/** 56/**
61 * Global handle of the configuration 57 * Global handle of the configuration
@@ -101,7 +97,7 @@ cleanup_task (void *cls,
101 GNUNET_DHT_find_peer_stop (find_peer_handle); 97 GNUNET_DHT_find_peer_stop (find_peer_handle);
102 find_peer_handle = NULL; 98 find_peer_handle = NULL;
103 } 99 }
104 GNUNET_SCHEDULER_add_now (sched, &shutdown_task, NULL); 100 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
105} 101}
106 102
107/** 103/**
@@ -132,20 +128,17 @@ find_peer_processor (void *cls,
132 * Main function that will be run by the scheduler. 128 * Main function that will be run by the scheduler.
133 * 129 *
134 * @param cls closure 130 * @param cls closure
135 * @param s the scheduler to use
136 * @param args remaining command-line arguments 131 * @param args remaining command-line arguments
137 * @param cfgfile name of the configuration file used (for saving, can be NULL!) 132 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
138 * @param c configuration 133 * @param c configuration
139 */ 134 */
140static void 135static void
141run (void *cls, 136run (void *cls,
142 struct GNUNET_SCHEDULER_Handle *s,
143 char *const *args, 137 char *const *args,
144 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) 138 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
145{ 139{
146 struct GNUNET_TIME_Relative timeout; 140 struct GNUNET_TIME_Relative timeout;
147 GNUNET_HashCode key; 141 GNUNET_HashCode key;
148 sched = s;
149 cfg = c; 142 cfg = c;
150 143
151 if (query_key == NULL) 144 if (query_key == NULL)
@@ -156,7 +149,7 @@ run (void *cls,
156 return; 149 return;
157 } 150 }
158 151
159 dht_handle = GNUNET_DHT_connect (sched, cfg, 1); 152 dht_handle = GNUNET_DHT_connect (cfg, 1);
160 153
161 if (dht_handle == NULL) 154 if (dht_handle == NULL)
162 { 155 {
@@ -185,11 +178,10 @@ run (void *cls,
185 NULL); 178 NULL);
186 if (NULL == find_peer_handle) 179 if (NULL == find_peer_handle)
187 { 180 {
188 GNUNET_SCHEDULER_add_now (sched, &shutdown_task, NULL); 181 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
189 return; 182 return;
190 } 183 }
191 GNUNET_SCHEDULER_add_delayed (sched, 184 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
192 GNUNET_TIME_absolute_get_remaining
193 (absolute_timeout), 185 (absolute_timeout),
194 &cleanup_task, NULL); 186 &cleanup_task, NULL);
195} 187}