diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-11-14 10:50:52 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-11-14 10:50:52 +0000 |
commit | 6884e874ab4d23f8a0d9b2cc1f3a1794e606cdeb (patch) | |
tree | f97f541046d5aca3008e52600c2cf9d0b72745c4 | |
parent | cb515930b242a7e33b012a22b227102325a33e0c (diff) | |
download | gnunet-6884e874ab4d23f8a0d9b2cc1f3a1794e606cdeb.tar.gz gnunet-6884e874ab4d23f8a0d9b2cc1f3a1794e606cdeb.zip |
Added GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_datacache.c | 6 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_routing.c | 6 | ||||
-rw-r--r-- | src/include/gnunet_block_lib.h | 11 | ||||
-rw-r--r-- | src/mesh/plugin_block_mesh.c | 4 |
5 files changed, 24 insertions, 5 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 593674569..f3539dab9 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -1058,6 +1058,8 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
1058 | case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID: | 1058 | case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID: |
1059 | GNUNET_break (0); | 1059 | GNUNET_break (0); |
1060 | return GNUNET_NO; | 1060 | return GNUNET_NO; |
1061 | case GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT: | ||
1062 | return GNUNET_YES; | ||
1061 | case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED: | 1063 | case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED: |
1062 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1064 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1063 | _("Unsupported block type (%u) in request!\n"), record->type); | 1065 | _("Unsupported block type (%u) in request!\n"), record->type); |
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 4768c14fd..87c93f559 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c | |||
@@ -176,6 +176,12 @@ datacache_get_iterator (void *cls, | |||
176 | ("# Invalid RESULTS found in datacache"), 1, | 176 | ("# Invalid RESULTS found in datacache"), 1, |
177 | GNUNET_NO); | 177 | GNUNET_NO); |
178 | break; | 178 | break; |
179 | case GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT: | ||
180 | GNUNET_STATISTICS_update (GDS_stats, | ||
181 | gettext_noop | ||
182 | ("# Irrelevant RESULTS found in datacache"), 1, | ||
183 | GNUNET_NO); | ||
184 | break; | ||
179 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: | 185 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: |
180 | GNUNET_break (0); | 186 | GNUNET_break (0); |
181 | break; | 187 | break; |
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index 4c2e69b36..1f2b2a516 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c | |||
@@ -226,6 +226,12 @@ process (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
226 | ("# Invalid REPLIES matched against routing table"), | 226 | ("# Invalid REPLIES matched against routing table"), |
227 | 1, GNUNET_NO); | 227 | 1, GNUNET_NO); |
228 | return GNUNET_SYSERR; | 228 | return GNUNET_SYSERR; |
229 | case GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT: | ||
230 | GNUNET_STATISTICS_update (GDS_stats, | ||
231 | gettext_noop | ||
232 | ("# Irrelevant REPLIES matched against routing table"), | ||
233 | 1, GNUNET_NO); | ||
234 | return GNUNET_OK; | ||
229 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: | 235 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: |
230 | GNUNET_break (0); | 236 | GNUNET_break (0); |
231 | return GNUNET_OK; | 237 | return GNUNET_OK; |
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 90a3549b1..cd4b2a0ac 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -148,21 +148,26 @@ enum GNUNET_BLOCK_EvaluationResult | |||
148 | GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3, | 148 | GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3, |
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Block does not match xquery (valid result, not relevant for the request) | ||
152 | */ | ||
153 | GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT = 4, | ||
154 | |||
155 | /** | ||
151 | * Query is valid, no reply given. | 156 | * Query is valid, no reply given. |
152 | */ | 157 | */ |
153 | GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 4, | 158 | GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 10, |
154 | 159 | ||
155 | /** | 160 | /** |
156 | * Query format does not match block type (invalid query). For | 161 | * Query format does not match block type (invalid query). For |
157 | * example, xquery not given or xquery_size not appropriate for | 162 | * example, xquery not given or xquery_size not appropriate for |
158 | * type. | 163 | * type. |
159 | */ | 164 | */ |
160 | GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 5, | 165 | GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 11, |
161 | 166 | ||
162 | /** | 167 | /** |
163 | * Specified block type not supported by this plugin. | 168 | * Specified block type not supported by this plugin. |
164 | */ | 169 | */ |
165 | GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 6 | 170 | GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 20 |
166 | }; | 171 | }; |
167 | 172 | ||
168 | 173 | ||
diff --git a/src/mesh/plugin_block_mesh.c b/src/mesh/plugin_block_mesh.c index 2b5067fac..a8ac085a0 100644 --- a/src/mesh/plugin_block_mesh.c +++ b/src/mesh/plugin_block_mesh.c | |||
@@ -138,11 +138,11 @@ block_plugin_mesh_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
138 | { | 138 | { |
139 | case GNUNET_SYSERR: | 139 | case GNUNET_SYSERR: |
140 | GNUNET_break_op(0); | 140 | GNUNET_break_op(0); |
141 | /* fall thru */ | 141 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
142 | case GNUNET_NO: | 142 | case GNUNET_NO: |
143 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 143 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
144 | "BLOCK XQUERY %s not accepted\n", xquery); | 144 | "BLOCK XQUERY %s not accepted\n", xquery); |
145 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 145 | return GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT; |
146 | default: | 146 | default: |
147 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 147 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
148 | "BLOCK XQUERY %s accepted\n", xquery); | 148 | "BLOCK XQUERY %s accepted\n", xquery); |