diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-11 15:50:40 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-11 15:50:40 +0000 |
commit | 366546f576315e0de97a700546d108a974161734 (patch) | |
tree | 87232a31739b479c7cde5b49b005923bc487fd42 /src/gns/gns_api.c | |
parent | 16cf819a0feb38c36b046c59febae5bc511a3d1b (diff) | |
download | gnunet-366546f576315e0de97a700546d108a974161734.tar.gz gnunet-366546f576315e0de97a700546d108a974161734.zip |
-add cached flag for performance
Diffstat (limited to 'src/gns/gns_api.c')
-rw-r--r-- | src/gns/gns_api.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 2cdb58a31..2e1e9712c 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -642,6 +642,7 @@ get_request_id (struct GNUNET_GNS_Handle *h) | |||
642 | * @param zone the zone to start the resolution in | 642 | * @param zone the zone to start the resolution in |
643 | * @param shorten_zone the zone where to shorten names into | 643 | * @param shorten_zone the zone where to shorten names into |
644 | * @param type the record type to look up | 644 | * @param type the record type to look up |
645 | * @param only_cached GNUNET_NO to only check locally not DHT for performance | ||
645 | * @param proc processor to call on result | 646 | * @param proc processor to call on result |
646 | * @param proc_cls closure for processor | 647 | * @param proc_cls closure for processor |
647 | * @return handle to the get | 648 | * @return handle to the get |
@@ -652,6 +653,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
652 | struct GNUNET_CRYPTO_ShortHashCode *zone, | 653 | struct GNUNET_CRYPTO_ShortHashCode *zone, |
653 | struct GNUNET_CRYPTO_ShortHashCode *shorten_zone, | 654 | struct GNUNET_CRYPTO_ShortHashCode *shorten_zone, |
654 | enum GNUNET_GNS_RecordType type, | 655 | enum GNUNET_GNS_RecordType type, |
656 | int only_cached, | ||
655 | GNUNET_GNS_LookupResultProcessor proc, | 657 | GNUNET_GNS_LookupResultProcessor proc, |
656 | void *proc_cls) | 658 | void *proc_cls) |
657 | { | 659 | { |
@@ -686,6 +688,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
686 | lookup_msg->header.type = htons (GNUNET_MESSAGE_TYPE_GNS_LOOKUP); | 688 | lookup_msg->header.type = htons (GNUNET_MESSAGE_TYPE_GNS_LOOKUP); |
687 | lookup_msg->header.size = htons (msize); | 689 | lookup_msg->header.size = htons (msize); |
688 | lookup_msg->id = htonl(qe->r_id); | 690 | lookup_msg->id = htonl(qe->r_id); |
691 | lookup_msg->only_cached = htonl(only_cached); | ||
689 | 692 | ||
690 | if (NULL != zone) | 693 | if (NULL != zone) |
691 | { | 694 | { |
@@ -728,6 +731,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
728 | * @param handle handle to the GNS service | 731 | * @param handle handle to the GNS service |
729 | * @param name the name to look up | 732 | * @param name the name to look up |
730 | * @param type the record type to look up | 733 | * @param type the record type to look up |
734 | * @param only_cached GNUNET_NO to only check locally not DHT for performance | ||
731 | * @param proc processor to call on result | 735 | * @param proc processor to call on result |
732 | * @param proc_cls closure for processor | 736 | * @param proc_cls closure for processor |
733 | * @return handle to the get | 737 | * @return handle to the get |
@@ -736,12 +740,13 @@ struct GNUNET_GNS_QueueEntry * | |||
736 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 740 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
737 | const char * name, | 741 | const char * name, |
738 | enum GNUNET_GNS_RecordType type, | 742 | enum GNUNET_GNS_RecordType type, |
743 | int only_cached, | ||
739 | GNUNET_GNS_LookupResultProcessor proc, | 744 | GNUNET_GNS_LookupResultProcessor proc, |
740 | void *proc_cls) | 745 | void *proc_cls) |
741 | { | 746 | { |
742 | return GNUNET_GNS_lookup_zone (handle, name, | 747 | return GNUNET_GNS_lookup_zone (handle, name, |
743 | NULL, NULL, | 748 | NULL, NULL, |
744 | type, proc, proc_cls); | 749 | type, only_cached, proc, proc_cls); |
745 | } | 750 | } |
746 | 751 | ||
747 | /** | 752 | /** |