diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-18 13:40:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-18 13:40:40 +0000 |
commit | 151053e6aea2c91059843885748bbd10ff183e9b (patch) | |
tree | ad9b4af8febf63ec94fc7fd8208d092281f577a7 /src/dht/gnunet-service-dht_routing.c | |
parent | 8dc9e1a5048dd74b1ded7551c9e6120e4c0476a5 (diff) | |
download | gnunet-151053e6aea2c91059843885748bbd10ff183e9b.tar.gz gnunet-151053e6aea2c91059843885748bbd10ff183e9b.zip |
-fixing 2253
Diffstat (limited to 'src/dht/gnunet-service-dht_routing.c')
-rw-r--r-- | src/dht/gnunet-service-dht_routing.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index a880bf7cd..2600b4460 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c | |||
@@ -227,6 +227,8 @@ process (void *cls, const GNUNET_HashCode * key, void *value) | |||
227 | 1, GNUNET_NO); | 227 | 1, GNUNET_NO); |
228 | return GNUNET_SYSERR; | 228 | return GNUNET_SYSERR; |
229 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: | 229 | case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: |
230 | GNUNET_break (0); | ||
231 | return GNUNET_OK; | ||
230 | case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID: | 232 | case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID: |
231 | GNUNET_break (0); | 233 | GNUNET_break (0); |
232 | return GNUNET_OK; | 234 | return GNUNET_OK; |
@@ -280,6 +282,16 @@ GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, | |||
280 | pc.get_path = get_path; | 282 | pc.get_path = get_path; |
281 | pc.data = data; | 283 | pc.data = data; |
282 | pc.data_size = data_size; | 284 | pc.data_size = data_size; |
285 | if (NULL == data) | ||
286 | { | ||
287 | /* Some apps might have an 'empty' reply as a valid reply; however, | ||
288 | 'process' will call GNUNET_BLOCK_evaluate' which treats a 'NULL' | ||
289 | reply as request-validation (but we need response-validation). | ||
290 | So we set 'data' to a 0-byte non-NULL value just to be sure */ | ||
291 | GNUNET_break (0 == data_size); | ||
292 | data_size = 0; | ||
293 | pc.data = ""; /* something not null */ | ||
294 | } | ||
283 | GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key, &process, &pc); | 295 | GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key, &process, &pc); |
284 | } | 296 | } |
285 | 297 | ||