diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-07-18 21:12:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-07-18 21:12:12 +0000 |
commit | 559c4a784f1197982fa76a85714902e1b1a1bc8b (patch) | |
tree | a6e14a15e34cadfe6df386178bebdbe4f104acdc /src/dv/plugin_transport_dv.c | |
parent | a3ece19a476acd8f381c94ddf7789ae335cde494 (diff) | |
download | gnunet-559c4a784f1197982fa76a85714902e1b1a1bc8b.tar.gz gnunet-559c4a784f1197982fa76a85714902e1b1a1bc8b.zip |
-minor code cleanup
Diffstat (limited to 'src/dv/plugin_transport_dv.c')
-rw-r--r-- | src/dv/plugin_transport_dv.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index 8f22246eb..9d1e06777 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c | |||
@@ -38,6 +38,9 @@ | |||
38 | #include "dv.h" | 38 | #include "dv.h" |
39 | 39 | ||
40 | 40 | ||
41 | #define LOG(kind,...) GNUNET_log_from (kind, "transport-dv",__VA_ARGS__) | ||
42 | |||
43 | |||
41 | /** | 44 | /** |
42 | * Encapsulation of all of the state of the plugin. | 45 | * Encapsulation of all of the state of the plugin. |
43 | */ | 46 | */ |
@@ -287,7 +290,7 @@ handle_dv_connect (void *cls, | |||
287 | notify_distance_change (session); | 290 | notify_distance_change (session); |
288 | return; /* nothing to do */ | 291 | return; /* nothing to do */ |
289 | } | 292 | } |
290 | session = GNUNET_malloc (sizeof (struct Session)); | 293 | session = GNUNET_new (struct Session); |
291 | session->sender = *peer; | 294 | session->sender = *peer; |
292 | session->distance = distance; | 295 | session->distance = distance; |
293 | GNUNET_assert (GNUNET_YES == | 296 | GNUNET_assert (GNUNET_YES == |
@@ -451,7 +454,7 @@ dv_plugin_send (void *cls, | |||
451 | memcpy (&box[1], msgbuf, msgbuf_size); | 454 | memcpy (&box[1], msgbuf, msgbuf_size); |
452 | msg = box; | 455 | msg = box; |
453 | } | 456 | } |
454 | pr = GNUNET_malloc (sizeof (struct PendingRequest)); | 457 | pr = GNUNET_new (struct PendingRequest); |
455 | pr->transmit_cont = cont; | 458 | pr->transmit_cont = cont; |
456 | pr->transmit_cont_cls = cont_cls; | 459 | pr->transmit_cont_cls = cont_cls; |
457 | pr->session = session; | 460 | pr->session = session; |
@@ -656,6 +659,9 @@ dv_get_network (void *cls, | |||
656 | 659 | ||
657 | /** | 660 | /** |
658 | * Entry point for the plugin. | 661 | * Entry point for the plugin. |
662 | * | ||
663 | * @param cls closure with the plugin environment | ||
664 | * @return plugin API | ||
659 | */ | 665 | */ |
660 | void * | 666 | void * |
661 | libgnunet_plugin_transport_dv_init (void *cls) | 667 | libgnunet_plugin_transport_dv_init (void *cls) |
@@ -664,7 +670,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
664 | struct GNUNET_TRANSPORT_PluginFunctions *api; | 670 | struct GNUNET_TRANSPORT_PluginFunctions *api; |
665 | struct Plugin *plugin; | 671 | struct Plugin *plugin; |
666 | 672 | ||
667 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 673 | plugin = GNUNET_new (struct Plugin); |
668 | plugin->env = env; | 674 | plugin->env = env; |
669 | plugin->sessions = GNUNET_CONTAINER_multihashmap_create (1024 * 8, GNUNET_YES); | 675 | plugin->sessions = GNUNET_CONTAINER_multihashmap_create (1024 * 8, GNUNET_YES); |
670 | plugin->mst = GNUNET_SERVER_mst_create (&unbox_cb, | 676 | plugin->mst = GNUNET_SERVER_mst_create (&unbox_cb, |
@@ -682,7 +688,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
682 | GNUNET_free (plugin); | 688 | GNUNET_free (plugin); |
683 | return NULL; | 689 | return NULL; |
684 | } | 690 | } |
685 | api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); | 691 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
686 | api->cls = plugin; | 692 | api->cls = plugin; |
687 | api->send = &dv_plugin_send; | 693 | api->send = &dv_plugin_send; |
688 | api->disconnect = &dv_plugin_disconnect; | 694 | api->disconnect = &dv_plugin_disconnect; |
@@ -718,6 +724,9 @@ free_session_iterator (void *cls, | |||
718 | 724 | ||
719 | /** | 725 | /** |
720 | * Exit point from the plugin. | 726 | * Exit point from the plugin. |
727 | * | ||
728 | * @param cls plugin API | ||
729 | * @return NULL | ||
721 | */ | 730 | */ |
722 | void * | 731 | void * |
723 | libgnunet_plugin_transport_dv_done (void *cls) | 732 | libgnunet_plugin_transport_dv_done (void *cls) |