aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-wdht_datacache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-wdht_datacache.c')
-rw-r--r--src/dht/gnunet-service-wdht_datacache.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-wdht_datacache.c b/src/dht/gnunet-service-wdht_datacache.c
index 63b946811..77591c502 100644
--- a/src/dht/gnunet-service-wdht_datacache.c
+++ b/src/dht/gnunet-service-wdht_datacache.c
@@ -155,6 +155,11 @@ struct GetRequestContext
155 */ 155 */
156 enum GNUNET_BLOCK_EvaluationResult eval; 156 enum GNUNET_BLOCK_EvaluationResult eval;
157 157
158 /**
159 * Routing options of the GET.
160 */
161 enum GNUNET_DHT_RouteOption options;
162
158}; 163};
159 164
160 165
@@ -211,6 +216,7 @@ datacache_get_iterator (void *cls,
211 ("# Good RESULTS found in datacache"), 1, 216 ("# Good RESULTS found in datacache"), 1,
212 GNUNET_NO); 217 GNUNET_NO);
213 GDS_NEIGHBOURS_send_get_result (ctx->trail_id, 218 GDS_NEIGHBOURS_send_get_result (ctx->trail_id,
219 ctx->options,
214 key, 220 key,
215 type, 221 type,
216 put_path_length, 222 put_path_length,
@@ -261,6 +267,7 @@ datacache_get_iterator (void *cls,
261 * Handle a GET request we've received from another peer. 267 * Handle a GET request we've received from another peer.
262 * 268 *
263 * @param trail_id trail identifying where to send the result to, NULL for us 269 * @param trail_id trail identifying where to send the result to, NULL for us
270 * @param options routing options (to be passed along)
264 * @param key the query 271 * @param key the query
265 * @param type requested data type 272 * @param type requested data type
266 * @param xquery extended query 273 * @param xquery extended query
@@ -271,6 +278,7 @@ datacache_get_iterator (void *cls,
271 */ 278 */
272enum GNUNET_BLOCK_EvaluationResult 279enum GNUNET_BLOCK_EvaluationResult
273GDS_DATACACHE_handle_get (const struct GNUNET_HashCode *trail_id, 280GDS_DATACACHE_handle_get (const struct GNUNET_HashCode *trail_id,
281 enum GNUNET_DHT_RouteOption options,
274 const struct GNUNET_HashCode *key, 282 const struct GNUNET_HashCode *key,
275 enum GNUNET_BLOCK_Type type, 283 enum GNUNET_BLOCK_Type type,
276 const void *xquery, 284 const void *xquery,
@@ -288,6 +296,7 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode *trail_id,
288 1, GNUNET_NO); 296 1, GNUNET_NO);
289 ctx.eval = GNUNET_BLOCK_EVALUATION_REQUEST_VALID; 297 ctx.eval = GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
290 ctx.trail_id = trail_id; 298 ctx.trail_id = trail_id;
299 ctx.options = options;
291 ctx.key = *key; 300 ctx.key = *key;
292 ctx.xquery = xquery; 301 ctx.xquery = xquery;
293 ctx.xquery_size = xquery_size; 302 ctx.xquery_size = xquery_size;
@@ -361,6 +370,7 @@ GDS_DATACACHE_get_random_key (struct GNUNET_HashCode *key)
361 return GNUNET_OK; 370 return GNUNET_OK;
362} 371}
363 372
373
364/** 374/**
365 * Iterator for local get request results, 375 * Iterator for local get request results,
366 * 376 *
@@ -387,7 +397,12 @@ datacache_get_successors_iterator (void *cls,
387{ 397{
388 const struct GNUNET_HashCode *trail_id = cls; 398 const struct GNUNET_HashCode *trail_id = cls;
389 399
400 /* NOTE: The datacache currently does not store the RO from
401 the original 'put', so we don't know the 'correct' option
402 at this point anymore. Thus, we conservatively assume
403 that recording is desired (for now). */
390 GDS_NEIGHBOURS_send_get_result (trail_id, 404 GDS_NEIGHBOURS_send_get_result (trail_id,
405 GNUNET_DHT_RO_RECORD_ROUTE,
391 key, 406 key,
392 type, 407 type,
393 put_path_length, put_path, 408 put_path_length, put_path,