diff options
-rw-r--r-- | src/fs/gnunet-service-fs.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 10 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.h | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 2a90b538c..cdf8f4325 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -348,6 +348,7 @@ handle_p2p_get (void *cls, const struct GNUNET_PeerIdentity *other, | |||
348 | pr = GSF_handle_p2p_query_ (other, message); | 348 | pr = GSF_handle_p2p_query_ (other, message); |
349 | if (NULL == pr) | 349 | if (NULL == pr) |
350 | return GNUNET_SYSERR; | 350 | return GNUNET_SYSERR; |
351 | GSF_pending_request_get_data_ (pr)->has_started = GNUNET_YES; | ||
351 | GSF_local_lookup_ (pr, &consider_forwarding, NULL); | 352 | GSF_local_lookup_ (pr, &consider_forwarding, NULL); |
352 | update_latencies (atsi, atsi_count); | 353 | update_latencies (atsi, atsi_count); |
353 | return GNUNET_OK; | 354 | return GNUNET_OK; |
@@ -415,6 +416,7 @@ handle_start_search (void *cls, struct GNUNET_SERVER_Client *client, | |||
415 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 416 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
416 | break; | 417 | break; |
417 | case GNUNET_YES: | 418 | case GNUNET_YES: |
419 | GSF_pending_request_get_data_ (pr)->has_started = GNUNET_YES; | ||
418 | GSF_local_lookup_ (pr, &start_p2p_processing, client); | 420 | GSF_local_lookup_ (pr, &start_p2p_processing, client); |
419 | break; | 421 | break; |
420 | default: | 422 | default: |
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 502cef941..d8f7d5cb3 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -332,15 +332,15 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
332 | if ((type == GNUNET_BLOCK_TYPE_FS_KBLOCK) || | 332 | if ((type == GNUNET_BLOCK_TYPE_FS_KBLOCK) || |
333 | (type == GNUNET_BLOCK_TYPE_FS_NBLOCK) || (type == GNUNET_BLOCK_TYPE_ANY)) | 333 | (type == GNUNET_BLOCK_TYPE_FS_NBLOCK) || (type == GNUNET_BLOCK_TYPE_ANY)) |
334 | { | 334 | { |
335 | /* FIXME: this does currently not work to filter duplicate | ||
336 | * results from *local* datastore since the local store is | ||
337 | * queried before we continue to process additional | ||
338 | * messages from the client! -- fix protocol? */ | ||
339 | cr = lc->cr_head; | 335 | cr = lc->cr_head; |
340 | while (cr != NULL) | 336 | while (cr != NULL) |
341 | { | 337 | { |
342 | prd = GSF_pending_request_get_data_ (cr->pr); | 338 | prd = GSF_pending_request_get_data_ (cr->pr); |
343 | if ((0 != memcmp (&prd->query, &sm->query, sizeof (GNUNET_HashCode))) && | 339 | /* only unify with queries that hae not yet started local processing |
340 | (SEARCH_MESSAGE_OPTION_CONTINUED was always set) and that have a | ||
341 | matching query and type */ | ||
342 | if ((GNUNET_YES != prd->has_started) && | ||
343 | (0 != memcmp (&prd->query, &sm->query, sizeof (GNUNET_HashCode))) && | ||
344 | (prd->type == type)) | 344 | (prd->type == type)) |
345 | break; | 345 | break; |
346 | cr = cr->next; | 346 | cr = cr->next; |
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index 00249afcf..e15ea0b54 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -146,6 +146,12 @@ struct GSF_PendingRequestData | |||
146 | */ | 146 | */ |
147 | int has_target; | 147 | int has_target; |
148 | 148 | ||
149 | /** | ||
150 | * Has this request been started yet (local/p2p operations)? Or are | ||
151 | * we still constructing it? | ||
152 | */ | ||
153 | int has_started; | ||
154 | |||
149 | }; | 155 | }; |
150 | 156 | ||
151 | 157 | ||