diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-06-25 14:27:31 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-06-25 14:27:31 +0000 |
commit | 52d396bb08d5621f7c0af2920a373d87d321cb63 (patch) | |
tree | c48ba847ec348613789b1376d5971f2baf7315fa /src/dht/gnunet-service-xdht_clients.c | |
parent | b9b0323eefcc0a595f56635be5b66de687650ae0 (diff) | |
download | gnunet-52d396bb08d5621f7c0af2920a373d87d321cb63.tar.gz gnunet-52d396bb08d5621f7c0af2920a373d87d321cb63.zip |
Handling 'put', 'get' and 'get result' correctly
Diffstat (limited to 'src/dht/gnunet-service-xdht_clients.c')
-rw-r--r-- | src/dht/gnunet-service-xdht_clients.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c index b9cfd6dda..96c3bb7d3 100644 --- a/src/dht/gnunet-service-xdht_clients.c +++ b/src/dht/gnunet-service-xdht_clients.c | |||
@@ -491,10 +491,11 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
491 | int do_free; | 491 | int do_free; |
492 | struct GNUNET_HashCode ch; | 492 | struct GNUNET_HashCode ch; |
493 | unsigned int i; | 493 | unsigned int i; |
494 | 494 | ||
495 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, | 495 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, |
496 | "R5N CLIENT-RESULT %s\n", | 496 | "XVINE CLIENT-RESULT %s\n", |
497 | GNUNET_h2s_full (key)); | 497 | GNUNET_h2s_full (key)); |
498 | #if 0 | ||
498 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) | 499 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) |
499 | { | 500 | { |
500 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 501 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -506,6 +507,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
506 | 1, GNUNET_NO); | 507 | 1, GNUNET_NO); |
507 | return GNUNET_YES; /* type mismatch */ | 508 | return GNUNET_YES; /* type mismatch */ |
508 | } | 509 | } |
510 | #endif | ||
509 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); | 511 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); |
510 | for (i = 0; i < record->seen_replies_count; i++) | 512 | for (i = 0; i < record->seen_replies_count; i++) |
511 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (struct GNUNET_HashCode))) | 513 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (struct GNUNET_HashCode))) |
@@ -666,7 +668,6 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
666 | frc.type = type; | 668 | frc.type = type; |
667 | GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, key, &forward_reply, | 669 | GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, key, &forward_reply, |
668 | &frc); | 670 | &frc); |
669 | |||
670 | if (GNUNET_NO == frc.do_copy) | 671 | if (GNUNET_NO == frc.do_copy) |
671 | { | 672 | { |
672 | /* did not match any of the requests, free! */ | 673 | /* did not match any of the requests, free! */ |
@@ -850,6 +851,7 @@ transmit_request (struct ClientQueryRecord *cqr) | |||
850 | GNUNET_h2s (&cqr->key), | 851 | GNUNET_h2s (&cqr->key), |
851 | cqr->replication, | 852 | cqr->replication, |
852 | cqr->seen_replies_count); | 853 | cqr->seen_replies_count); |
854 | |||
853 | GDS_NEIGHBOURS_send_get (&cqr->key, cqr->type, cqr->msg_options, | 855 | GDS_NEIGHBOURS_send_get (&cqr->key, cqr->type, cqr->msg_options, |
854 | cqr->replication, NULL, NULL , NULL, | 856 | cqr->replication, NULL, NULL , NULL, |
855 | 0, 0, NULL); | 857 | 0, 0, NULL); |
@@ -1034,6 +1036,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
1034 | cqr->replication = ntohl (get->desired_replication_level); | 1036 | cqr->replication = ntohl (get->desired_replication_level); |
1035 | cqr->msg_options = ntohl (get->options); | 1037 | cqr->msg_options = ntohl (get->options); |
1036 | cqr->type = ntohl (get->type); | 1038 | cqr->type = ntohl (get->type); |
1039 | |||
1037 | // FIXME use cqr->key, set multihashmap create to GNUNET_YES | 1040 | // FIXME use cqr->key, set multihashmap create to GNUNET_YES |
1038 | GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr, | 1041 | GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr, |
1039 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 1042 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |