aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-10-06 09:27:41 +0000
committerNathan S. Evans <evans@in.tum.de>2010-10-06 09:27:41 +0000
commitc5abd8afb8e12b6164902a16e7b5c6112b1f0f9e (patch)
tree868d091c7d37b6b1af297c18040ad337cb870025 /src/block
parent8dda1a3517c7c27d1ce48b27f234c15a0e394666 (diff)
downloadgnunet-c5abd8afb8e12b6164902a16e7b5c6112b1f0f9e.tar.gz
gnunet-c5abd8afb8e12b6164902a16e7b5c6112b1f0f9e.zip
mis-named functions (this means that SOMEONE doesn't have exhaustive testcases)
Diffstat (limited to 'src/block')
-rw-r--r--src/block/plugin_block_dht.c24
-rw-r--r--src/block/plugin_block_template.c4
-rw-r--r--src/block/plugin_block_test.c4
3 files changed, 18 insertions, 14 deletions
diff --git a/src/block/plugin_block_dht.c b/src/block/plugin_block_dht.c
index 8312a69b5..56f99a765 100644
--- a/src/block/plugin_block_dht.c
+++ b/src/block/plugin_block_dht.c
@@ -42,7 +42,7 @@
42 * @param query original query (hash) 42 * @param query original query (hash)
43 * @param bf pointer to bloom filter associated with query; possibly updated (!) 43 * @param bf pointer to bloom filter associated with query; possibly updated (!)
44 * @param bf_mutator mutation value for bf 44 * @param bf_mutator mutation value for bf
45 * @param xquery extrended query data (can be NULL, depending on type) 45 * @param xquery extended query data (can be NULL, depending on type)
46 * @param xquery_size number of bytes in xquery 46 * @param xquery_size number of bytes in xquery
47 * @param reply_block response to validate 47 * @param reply_block response to validate
48 * @param reply_block_size number of bytes in reply block 48 * @param reply_block_size number of bytes in reply block
@@ -59,14 +59,18 @@ block_plugin_dht_evaluate (void *cls,
59 const void *reply_block, 59 const void *reply_block,
60 size_t reply_block_size) 60 size_t reply_block_size)
61{ 61{
62 if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) 62 switch (type)
63 {
64 case GNUNET_BLOCK_TYPE_DHT_HELLO:
65 if (xquery_size != 0)
66 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
67 if (reply_block_size == 0)
68 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
69 GNUNET_break (NULL == *bf);
70 return GNUNET_BLOCK_EVALUATION_OK_LAST;
71 default:
63 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; 72 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
64 if (xquery_size != 0) 73 }
65 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
66 if (reply_block_size == 0)
67 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
68 GNUNET_break (NULL == *bf);
69 return GNUNET_BLOCK_EVALUATION_OK_LAST;
70} 74}
71 75
72 76
@@ -131,7 +135,7 @@ block_plugin_dht_get_key (void *cls,
131 * Entry point for the plugin. 135 * Entry point for the plugin.
132 */ 136 */
133void * 137void *
134gnunet_plugin_block_dht_init (void *cls) 138libgnunet_plugin_block_dht_init (void *cls)
135{ 139{
136 static enum GNUNET_BLOCK_Type types[] = 140 static enum GNUNET_BLOCK_Type types[] =
137 { 141 {
@@ -152,7 +156,7 @@ gnunet_plugin_block_dht_init (void *cls)
152 * Exit point from the plugin. 156 * Exit point from the plugin.
153 */ 157 */
154void * 158void *
155gnunet_plugin_block_dht_done (void *cls) 159libgnunet_plugin_block_dht_done (void *cls)
156{ 160{
157 struct GNUNET_TRANSPORT_PluginFunctions *api = cls; 161 struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
158 162
diff --git a/src/block/plugin_block_template.c b/src/block/plugin_block_template.c
index 016a3fc8f..23a25ae02 100644
--- a/src/block/plugin_block_template.c
+++ b/src/block/plugin_block_template.c
@@ -86,7 +86,7 @@ block_plugin_template_get_key (void *cls,
86 * Entry point for the plugin. 86 * Entry point for the plugin.
87 */ 87 */
88void * 88void *
89gnunet_plugin_block_template_init (void *cls) 89libgnunet_plugin_block_template_init (void *cls)
90{ 90{
91 static enum GNUNET_BLOCK_Type types[] = 91 static enum GNUNET_BLOCK_Type types[] =
92 { 92 {
@@ -107,7 +107,7 @@ gnunet_plugin_block_template_init (void *cls)
107 * Exit point from the plugin. 107 * Exit point from the plugin.
108 */ 108 */
109void * 109void *
110gnunet_plugin_block_template_done (void *cls) 110libgnunet_plugin_block_template_done (void *cls)
111{ 111{
112 struct GNUNET_TRANSPORT_PluginFunctions *api = cls; 112 struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
113 113
diff --git a/src/block/plugin_block_test.c b/src/block/plugin_block_test.c
index d353d02de..eb3e200b0 100644
--- a/src/block/plugin_block_test.c
+++ b/src/block/plugin_block_test.c
@@ -122,7 +122,7 @@ block_plugin_test_get_key (void *cls,
122 * Entry point for the plugin. 122 * Entry point for the plugin.
123 */ 123 */
124void * 124void *
125gnunet_plugin_block_test_init (void *cls) 125libgnunet_plugin_block_test_init (void *cls)
126{ 126{
127 static enum GNUNET_BLOCK_Type types[] = 127 static enum GNUNET_BLOCK_Type types[] =
128 { 128 {
@@ -143,7 +143,7 @@ gnunet_plugin_block_test_init (void *cls)
143 * Exit point from the plugin. 143 * Exit point from the plugin.
144 */ 144 */
145void * 145void *
146gnunet_plugin_block_test_done (void *cls) 146libgnunet_plugin_block_test_done (void *cls)
147{ 147{
148 struct GNUNET_TRANSPORT_PluginFunctions *api = cls; 148 struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
149 149