aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_credential.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/reclaim_credential.c')
-rw-r--r--src/reclaim/reclaim_credential.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c
index 5c8974400..05601c3d3 100644
--- a/src/reclaim/reclaim_credential.c
+++ b/src/reclaim/reclaim_credential.c
@@ -104,6 +104,38 @@ init ()
104 104
105 105
106/** 106/**
107 * Dual function to #init().
108 */
109void __attribute__ ((destructor))
110RECLAIM_CREDENTIAL_fini ()
111{
112 struct Plugin *plugin;
113 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
114 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
115
116 if (pd != dpd)
117 GNUNET_OS_init (dpd);
118
119 for (unsigned int i = 0; i < num_plugins; i++)
120 {
121 plugin = credential_plugins[i];
122 GNUNET_break (NULL ==
123 GNUNET_PLUGIN_unload (plugin->library_name,
124 plugin->api));
125 GNUNET_free (plugin->library_name);
126 GNUNET_free (plugin);
127 }
128 GNUNET_free (credential_plugins);
129
130 if (pd != dpd)
131 GNUNET_OS_init (pd);
132
133 credential_plugins = NULL;
134}
135
136
137
138/**
107 * Convert an credential type name to the corresponding number 139 * Convert an credential type name to the corresponding number
108 * 140 *
109 * @param typename name to convert 141 * @param typename name to convert
@@ -721,7 +753,6 @@ GNUNET_RECLAIM_presentation_list_serialize_get_size (
721 { 753 {
722 GNUNET_assert (NULL != le->presentation); 754 GNUNET_assert (NULL != le->presentation);
723 len += GNUNET_RECLAIM_presentation_serialize_get_size (le->presentation); 755 len += GNUNET_RECLAIM_presentation_serialize_get_size (le->presentation);
724 len += sizeof(struct GNUNET_RECLAIM_PresentationListEntry);
725 } 756 }
726 return len; 757 return len;
727} 758}
@@ -774,8 +805,7 @@ GNUNET_RECLAIM_presentation_list_deserialize (const char *data, size_t
774 805
775 al = GNUNET_new (struct GNUNET_RECLAIM_PresentationList); 806 al = GNUNET_new (struct GNUNET_RECLAIM_PresentationList);
776 807
777 if ((data_size < sizeof(struct Presentation) 808 if (data_size < sizeof(struct Presentation))
778 + sizeof(struct GNUNET_RECLAIM_PresentationListEntry)))
779 return al; 809 return al;
780 810
781 read_ptr = data; 811 read_ptr = data;