diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-04-03 14:27:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-04-03 14:27:50 +0000 |
commit | 1687b7a632f45a63fce5bf635a6286a1dad1c1d6 (patch) | |
tree | 1e249fda57bb2a912c1ce2656036ad3ce5ca6d97 /src/dv/plugin_transport_dv.c | |
parent | 1d5caebcb5ec2617f92550cf1789037313d5c9e0 (diff) | |
download | gnunet-1687b7a632f45a63fce5bf635a6286a1dad1c1d6.tar.gz gnunet-1687b7a632f45a63fce5bf635a6286a1dad1c1d6.zip |
lots of fixes, on its way to actually working...
Diffstat (limited to 'src/dv/plugin_transport_dv.c')
-rw-r--r-- | src/dv/plugin_transport_dv.c | 48 |
1 files changed, 6 insertions, 42 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index c29b17e8c..f31801813 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c | |||
@@ -183,7 +183,7 @@ void handle_dv_message_received (void *cls, | |||
183 | "plugin_transport_dv", | 183 | "plugin_transport_dv", |
184 | _("Received message from %s of type %d!\n"), | 184 | _("Received message from %s of type %d!\n"), |
185 | "DV SERVICE", ntohs(((struct GNUNET_MessageHeader *)msg)->type)); | 185 | "DV SERVICE", ntohs(((struct GNUNET_MessageHeader *)msg)->type)); |
186 | plugin->env->receive(plugin, | 186 | plugin->env->receive(plugin->env->cls, |
187 | sender, | 187 | sender, |
188 | (struct GNUNET_MessageHeader *)msg, | 188 | (struct GNUNET_MessageHeader *)msg, |
189 | distance, | 189 | distance, |
@@ -242,6 +242,9 @@ dv_plugin_send (void *cls, | |||
242 | /* FIXME: do we want the dv plugin to remember sent messages to call continuation once message actually goes out? | 242 | /* FIXME: do we want the dv plugin to remember sent messages to call continuation once message actually goes out? |
243 | * Or do we just call the continuation once we've notified the plugin? | 243 | * Or do we just call the continuation once we've notified the plugin? |
244 | */ | 244 | */ |
245 | #if DEBUG_DV | ||
246 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: Received send request from transport, calling GNUNET_DV_send\n"); | ||
247 | #endif | ||
245 | ret = GNUNET_DV_send(plugin->dv_handle, | 248 | ret = GNUNET_DV_send(plugin->dv_handle, |
246 | target, | 249 | target, |
247 | msgbuf, | 250 | msgbuf, |
@@ -250,12 +253,11 @@ dv_plugin_send (void *cls, | |||
250 | timeout, | 253 | timeout, |
251 | addr, | 254 | addr, |
252 | addrlen); | 255 | addrlen); |
253 | /*, cont, cont_cls);*/ | ||
254 | 256 | ||
255 | if (ret == 0) | 257 | if (ret == 0) |
256 | cont(cls, target, GNUNET_OK); | 258 | cont(cont_cls, target, GNUNET_OK); |
257 | else | 259 | else |
258 | cont(cls, target, GNUNET_SYSERR); | 260 | cont(cont_cls, target, GNUNET_SYSERR); |
259 | 261 | ||
260 | return ret; | 262 | return ret; |
261 | } | 263 | } |
@@ -343,44 +345,6 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
343 | struct GNUNET_TRANSPORT_PluginEnvironment *env = cls; | 345 | struct GNUNET_TRANSPORT_PluginEnvironment *env = cls; |
344 | struct GNUNET_TRANSPORT_PluginFunctions *api; | 346 | struct GNUNET_TRANSPORT_PluginFunctions *api; |
345 | struct Plugin *plugin; | 347 | struct Plugin *plugin; |
346 | /*struct GNUNET_SERVICE_Context *service;*/ | ||
347 | |||
348 | /** | ||
349 | * Do we not even need a service for this thing? That's peculiar. | ||
350 | */ | ||
351 | /* | ||
352 | service = GNUNET_SERVICE_start ("transport-dv", env->sched, env->cfg); | ||
353 | if (service == NULL) | ||
354 | { | ||
355 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, | ||
356 | "dv", | ||
357 | _ | ||
358 | ("Failed to start service for `%s' transport plugin.\n"), | ||
359 | "dv"); | ||
360 | return NULL; | ||
361 | } | ||
362 | */ | ||
363 | /** | ||
364 | * I don't think we need a port, the only way we get stuff is being directly | ||
365 | * called by service transport or by responses from the dv-service via our | ||
366 | * client handle | ||
367 | */ | ||
368 | /* | ||
369 | if ((GNUNET_OK != | ||
370 | GNUNET_CONFIGURATION_get_value_number (env->cfg, | ||
371 | "transport-dv", | ||
372 | "PORT", | ||
373 | &port))) | ||
374 | { | ||
375 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | ||
376 | "dv", | ||
377 | _ | ||
378 | ("Require valid port number for service `%s' in configuration!\n"), | ||
379 | "transport-dv"); | ||
380 | GNUNET_SERVICE_stop (service); | ||
381 | return NULL; | ||
382 | } | ||
383 | */ | ||
384 | 348 | ||
385 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 349 | plugin = GNUNET_malloc (sizeof (struct Plugin)); |
386 | plugin->env = env; | 350 | plugin->env = env; |