aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-get.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
committerNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
commit75a33a1499cf60ea4364c9aa673816629a6c1413 (patch)
tree0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/dht/gnunet-dht-get.c
parent7217c601ad30760872823193d62307e7a335d226 (diff)
downloadgnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz
gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r--src/dht/gnunet-dht-get.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 55d606716..b7dcb6a56 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -56,10 +56,6 @@ static int verbose;
56 */ 56 */
57static struct GNUNET_DHT_Handle *dht_handle; 57static struct GNUNET_DHT_Handle *dht_handle;
58 58
59/**
60 * Global handle of the scheduler
61 */
62static struct GNUNET_SCHEDULER_Handle *sched;
63 59
64/** 60/**
65 * Global handle of the configuration 61 * Global handle of the configuration
@@ -101,7 +97,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101 GNUNET_DHT_get_stop (get_handle); 97 GNUNET_DHT_get_stop (get_handle);
102 get_handle = NULL; 98 get_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
@@ -142,20 +138,17 @@ get_result_iterator (void *cls,
142 * Main function that will be run by the scheduler. 138 * Main function that will be run by the scheduler.
143 * 139 *
144 * @param cls closure 140 * @param cls closure
145 * @param s the scheduler to use
146 * @param args remaining command-line arguments 141 * @param args remaining command-line arguments
147 * @param cfgfile name of the configuration file used (for saving, can be NULL!) 142 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
148 * @param c configuration 143 * @param c configuration
149 */ 144 */
150static void 145static void
151run (void *cls, 146run (void *cls,
152 struct GNUNET_SCHEDULER_Handle *s,
153 char *const *args, 147 char *const *args,
154 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) 148 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
155{ 149{
156 struct GNUNET_TIME_Relative timeout; 150 struct GNUNET_TIME_Relative timeout;
157 GNUNET_HashCode key; 151 GNUNET_HashCode key;
158 sched = s;
159 cfg = c; 152 cfg = c;
160 153
161 if (query_key == NULL) 154 if (query_key == NULL)
@@ -166,7 +159,7 @@ run (void *cls,
166 return; 159 return;
167 } 160 }
168 161
169 dht_handle = GNUNET_DHT_connect (sched, cfg, 1); 162 dht_handle = GNUNET_DHT_connect (cfg, 1);
170 163
171 if (dht_handle == NULL) 164 if (dht_handle == NULL)
172 { 165 {
@@ -186,8 +179,7 @@ run (void *cls,
186 179
187 if (verbose) 180 if (verbose)
188 fprintf (stderr, "Issuing GET request for %s!\n", query_key); 181 fprintf (stderr, "Issuing GET request for %s!\n", query_key);
189 GNUNET_SCHEDULER_add_delayed (sched, 182 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
190 GNUNET_TIME_absolute_get_remaining
191 (absolute_timeout), &cleanup_task, NULL); 183 (absolute_timeout), &cleanup_task, NULL);
192 get_handle = GNUNET_DHT_get_start (dht_handle, 184 get_handle = GNUNET_DHT_get_start (dht_handle,
193 timeout, 185 timeout,