aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-put.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-put.c
parent7217c601ad30760872823193d62307e7a335d226 (diff)
downloadgnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz
gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/dht/gnunet-dht-put.c')
-rw-r--r--src/dht/gnunet-dht-put.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index 54c984493..469675409 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.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
@@ -98,28 +94,25 @@ message_sent_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
98 if (verbose) 94 if (verbose)
99 fprintf (stderr, 95 fprintf (stderr,
100 _("PUT request sent!\n")); 96 _("PUT request sent!\n"));
101 GNUNET_SCHEDULER_add_now (sched, &shutdown_task, NULL); 97 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
102} 98}
103 99
104/** 100/**
105 * Main function that will be run by the scheduler. 101 * Main function that will be run by the scheduler.
106 * 102 *
107 * @param cls closure 103 * @param cls closure
108 * @param s the scheduler to use
109 * @param args remaining command-line arguments 104 * @param args remaining command-line arguments
110 * @param cfgfile name of the configuration file used (for saving, can be NULL!) 105 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
111 * @param c configuration 106 * @param c configuration
112 */ 107 */
113static void 108static void
114run (void *cls, 109run (void *cls,
115 struct GNUNET_SCHEDULER_Handle *s,
116 char *const *args, 110 char *const *args,
117 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) 111 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
118{ 112{
119 struct GNUNET_TIME_Relative timeout; 113 struct GNUNET_TIME_Relative timeout;
120 struct GNUNET_TIME_Absolute expiration; 114 struct GNUNET_TIME_Absolute expiration;
121 GNUNET_HashCode key; 115 GNUNET_HashCode key;
122 sched = s;
123 cfg = c; 116 cfg = c;
124 117
125 if ( (query_key == NULL) || (data == NULL) ) 118 if ( (query_key == NULL) || (data == NULL) )
@@ -130,7 +123,7 @@ run (void *cls,
130 return; 123 return;
131 } 124 }
132 125
133 dht_handle = GNUNET_DHT_connect (sched, cfg, 1); 126 dht_handle = GNUNET_DHT_connect (cfg, 1);
134 if (dht_handle == NULL) 127 if (dht_handle == NULL)
135 { 128 {
136 fprintf (stderr, 129 fprintf (stderr,