diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 12 | ||||
-rw-r--r-- | src/include/gnunet_db_lib.h | 1 | ||||
-rw-r--r-- | src/include/gnunet_json_lib.h | 43 | ||||
-rw-r--r-- | src/json/json_pack.c | 18 | ||||
-rw-r--r-- | src/pq/pq_event.c | 8 | ||||
-rw-r--r-- | src/setu/gnunet-service-setu.c | 62 | ||||
-rw-r--r-- | src/setu/gnunet-service-setu_protocol.h | 5 | ||||
-rw-r--r-- | src/setu/perf_setu_api.c | 2 |
8 files changed, 87 insertions, 64 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 2c30f0b68..ca255310c 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -894,7 +894,7 @@ get_distance (const struct GNUNET_HashCode *target, | |||
894 | unsigned int bucket) | 894 | unsigned int bucket) |
895 | { | 895 | { |
896 | uint64_t lsb = 0; | 896 | uint64_t lsb = 0; |
897 | 897 | ||
898 | for (unsigned int i = bucket + 1; | 898 | for (unsigned int i = bucket + 1; |
899 | (i < sizeof(struct GNUNET_HashCode) * 8) && | 899 | (i < sizeof(struct GNUNET_HashCode) * 8) && |
900 | (i < bucket + 1 + 64); | 900 | (i < bucket + 1 + 64); |
@@ -997,14 +997,15 @@ select_peer (const struct GNUNET_HashCode *key, | |||
997 | chosen = NULL; | 997 | chosen = NULL; |
998 | for (bc = 0; bc <= closest_bucket; bc++) | 998 | for (bc = 0; bc <= closest_bucket; bc++) |
999 | { | 999 | { |
1000 | pos = k_buckets[bc].head; | ||
1001 | count = 0; | 1000 | count = 0; |
1002 | while ( (pos != NULL) && | 1001 | for (pos = k_buckets[bc].head; |
1003 | (count < bucket_size) ) | 1002 | (pos != NULL) && |
1003 | (count < bucket_size); | ||
1004 | pos = pos->next) | ||
1004 | { | 1005 | { |
1005 | unsigned int bucket; | 1006 | unsigned int bucket; |
1006 | uint64_t dist; | 1007 | uint64_t dist; |
1007 | 1008 | ||
1008 | bucket = GNUNET_CRYPTO_hash_matching_bits (key, | 1009 | bucket = GNUNET_CRYPTO_hash_matching_bits (key, |
1009 | &pos->phash); | 1010 | &pos->phash); |
1010 | dist = get_distance (key, | 1011 | dist = get_distance (key, |
@@ -1037,7 +1038,6 @@ select_peer (const struct GNUNET_HashCode *key, | |||
1037 | chosen = NULL; | 1038 | chosen = NULL; |
1038 | } | 1039 | } |
1039 | count++; | 1040 | count++; |
1040 | pos = pos->next; | ||
1041 | } | 1041 | } |
1042 | } | 1042 | } |
1043 | if (NULL == chosen) | 1043 | if (NULL == chosen) |
diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h index 63c45112d..e88e836f6 100644 --- a/src/include/gnunet_db_lib.h +++ b/src/include/gnunet_db_lib.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifndef GNUNET_DB_LIB_H | 25 | #ifndef GNUNET_DB_LIB_H |
26 | #define GNUNET_DB_LIB_H | 26 | #define GNUNET_DB_LIB_H |
27 | 27 | ||
28 | #include "gnunet_common.h" | ||
28 | 29 | ||
29 | /** | 30 | /** |
30 | * Status code returned from functions running database commands. | 31 | * Status code returned from functions running database commands. |
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index 144ddb64a..92f696e08 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h | |||
@@ -556,7 +556,7 @@ struct GNUNET_JSON_PackSpec | |||
556 | * Object to pack. | 556 | * Object to pack. |
557 | */ | 557 | */ |
558 | json_t *object; | 558 | json_t *object; |
559 | 559 | ||
560 | /** | 560 | /** |
561 | * True if a NULL (or 0) argument is allowed. In this | 561 | * True if a NULL (or 0) argument is allowed. In this |
562 | * case, if the argument is NULL the @e packer should | 562 | * case, if the argument is NULL the @e packer should |
@@ -586,7 +586,8 @@ GNUNET_JSON_pack_ (struct GNUNET_JSON_PackSpec spec[]); | |||
586 | * @return JSON object | 586 | * @return JSON object |
587 | */ | 587 | */ |
588 | #define GNUNET_JSON_PACK(...) \ | 588 | #define GNUNET_JSON_PACK(...) \ |
589 | GNUNET_JSON_pack_ ((struct GNUNET_JSON_PackSpec[]) {__VA_ARGS__, GNUNET_JSON_pack_end_ ()}) | 589 | GNUNET_JSON_pack_ ((struct GNUNET_JSON_PackSpec[]) {__VA_ARGS__, \ |
590 | GNUNET_JSON_pack_end_ ()}) | ||
590 | 591 | ||
591 | 592 | ||
592 | /** | 593 | /** |
@@ -595,12 +596,12 @@ GNUNET_JSON_pack_ (struct GNUNET_JSON_PackSpec spec[]); | |||
595 | * @return array terminator | 596 | * @return array terminator |
596 | */ | 597 | */ |
597 | struct GNUNET_JSON_PackSpec | 598 | struct GNUNET_JSON_PackSpec |
598 | GNUNET_JSON_pack_end_(void); | 599 | GNUNET_JSON_pack_end_ (void); |
599 | 600 | ||
600 | 601 | ||
601 | /** | 602 | /** |
602 | * Modify packer instruction to allow NULL as a value. | 603 | * Modify packer instruction to allow NULL as a value. |
603 | * | 604 | * |
604 | * @param in json pack specification to modify | 605 | * @param in json pack specification to modify |
605 | * @return json pack specification | 606 | * @return json pack specification |
606 | */ | 607 | */ |
@@ -611,7 +612,7 @@ GNUNET_JSON_pack_allow_null (struct GNUNET_JSON_PackSpec in); | |||
611 | /** | 612 | /** |
612 | * Generate packer instruction for a JSON field of type | 613 | * Generate packer instruction for a JSON field of type |
613 | * bool. | 614 | * bool. |
614 | * | 615 | * |
615 | * @param name name of the field to add to the object | 616 | * @param name name of the field to add to the object |
616 | * @param b boolean value | 617 | * @param b boolean value |
617 | * @return json pack specification | 618 | * @return json pack specification |
@@ -624,7 +625,7 @@ GNUNET_JSON_pack_bool (const char *name, | |||
624 | /** | 625 | /** |
625 | * Generate packer instruction for a JSON field of type | 626 | * Generate packer instruction for a JSON field of type |
626 | * string. | 627 | * string. |
627 | * | 628 | * |
628 | * @param name name of the field to add to the object | 629 | * @param name name of the field to add to the object |
629 | * @param s string value | 630 | * @param s string value |
630 | * @return json pack specification | 631 | * @return json pack specification |
@@ -636,9 +637,9 @@ GNUNET_JSON_pack_string (const char *name, | |||
636 | 637 | ||
637 | /** | 638 | /** |
638 | * Generate packer instruction for a JSON field of type | 639 | * Generate packer instruction for a JSON field of type |
639 | * unsigned integer. Note that the maximum allowed | 640 | * unsigned integer. Note that the maximum allowed |
640 | * value is still limited by JSON and not UINT64_MAX. | 641 | * value is still limited by JSON and not UINT64_MAX. |
641 | * | 642 | * |
642 | * @param name name of the field to add to the object | 643 | * @param name name of the field to add to the object |
643 | * @param num numeric value | 644 | * @param num numeric value |
644 | * @return json pack specification | 645 | * @return json pack specification |
@@ -651,21 +652,21 @@ GNUNET_JSON_pack_uint64 (const char *name, | |||
651 | /** | 652 | /** |
652 | * Generate packer instruction for a JSON field of type | 653 | * Generate packer instruction for a JSON field of type |
653 | * signed integer. | 654 | * signed integer. |
654 | * | 655 | * |
655 | * @param name name of the field to add to the object | 656 | * @param name name of the field to add to the object |
656 | * @param num numeric value | 657 | * @param num numeric value |
657 | * @return json pack specification | 658 | * @return json pack specification |
658 | */ | 659 | */ |
659 | struct GNUNET_JSON_PackSpec | 660 | struct GNUNET_JSON_PackSpec |
660 | GNUNET_JSON_pack_int64 (const char *name, | 661 | GNUNET_JSON_pack_int64 (const char *name, |
661 | int64_t num); | 662 | int64_t num); |
662 | 663 | ||
663 | 664 | ||
664 | /** | 665 | /** |
665 | * Generate packer instruction for a JSON field of type | 666 | * Generate packer instruction for a JSON field of type |
666 | * JSON object where the reference is taken over by | 667 | * JSON object where the reference is taken over by |
667 | * the packer. | 668 | * the packer. |
668 | * | 669 | * |
669 | * @param name name of the field to add to the object | 670 | * @param name name of the field to add to the object |
670 | * @param o object to steal | 671 | * @param o object to steal |
671 | * @return json pack specification | 672 | * @return json pack specification |
@@ -679,7 +680,7 @@ GNUNET_JSON_pack_object_steal (const char *name, | |||
679 | * Generate packer instruction for a JSON field of type JSON object where the | 680 | * Generate packer instruction for a JSON field of type JSON object where the |
680 | * reference counter is incremented by the packer. Note that a deep copy is | 681 | * reference counter is incremented by the packer. Note that a deep copy is |
681 | * not performed. | 682 | * not performed. |
682 | * | 683 | * |
683 | * @param name name of the field to add to the object | 684 | * @param name name of the field to add to the object |
684 | * @param o object to increment reference counter of | 685 | * @param o object to increment reference counter of |
685 | * @return json pack specification | 686 | * @return json pack specification |
@@ -693,7 +694,7 @@ GNUNET_JSON_pack_object_incref (const char *name, | |||
693 | * Generate packer instruction for a JSON field of type | 694 | * Generate packer instruction for a JSON field of type |
694 | * JSON array where the reference is taken over by | 695 | * JSON array where the reference is taken over by |
695 | * the packer. | 696 | * the packer. |
696 | * | 697 | * |
697 | * @param name name of the field to add to the object | 698 | * @param name name of the field to add to the object |
698 | * @param a array to steal | 699 | * @param a array to steal |
699 | * @return json pack specification | 700 | * @return json pack specification |
@@ -707,7 +708,7 @@ GNUNET_JSON_pack_array_steal (const char *name, | |||
707 | * Generate packer instruction for a JSON field of type JSON array where the | 708 | * Generate packer instruction for a JSON field of type JSON array where the |
708 | * reference counter is incremented by the packer. Note that a deep copy is | 709 | * reference counter is incremented by the packer. Note that a deep copy is |
709 | * not performed. | 710 | * not performed. |
710 | * | 711 | * |
711 | * @param name name of the field to add to the object | 712 | * @param name name of the field to add to the object |
712 | * @param a array to increment reference counter of | 713 | * @param a array to increment reference counter of |
713 | * @return json pack specification | 714 | * @return json pack specification |
@@ -720,7 +721,7 @@ GNUNET_JSON_pack_array_incref (const char *name, | |||
720 | /** | 721 | /** |
721 | * Generate packer instruction for a JSON field of type | 722 | * Generate packer instruction for a JSON field of type |
722 | * variable size binary blob. | 723 | * variable size binary blob. |
723 | * | 724 | * |
724 | * @param name name of the field to add to the object | 725 | * @param name name of the field to add to the object |
725 | * @param blob binary data to pack | 726 | * @param blob binary data to pack |
726 | * @param blob_size number of bytes in @a blob | 727 | * @param blob_size number of bytes in @a blob |
@@ -735,7 +736,7 @@ GNUNET_JSON_pack_data_varsize (const char *name, | |||
735 | /** | 736 | /** |
736 | * Generate packer instruction for a JSON field where the | 737 | * Generate packer instruction for a JSON field where the |
737 | * size is automatically determined from the argument. | 738 | * size is automatically determined from the argument. |
738 | * | 739 | * |
739 | * @param name name of the field to add to the object | 740 | * @param name name of the field to add to the object |
740 | * @param blob data to pack, must not be an array | 741 | * @param blob data to pack, must not be an array |
741 | * @return json pack specification | 742 | * @return json pack specification |
@@ -749,7 +750,8 @@ GNUNET_JSON_pack_data_varsize (const char *name, | |||
749 | * absolute time. | 750 | * absolute time. |
750 | * | 751 | * |
751 | * @param name name of the field to add to the object | 752 | * @param name name of the field to add to the object |
752 | * @param at absolute time to pack | 753 | * @param at absolute time to pack, a value of 0 is only |
754 | * allowed with #GNUNET_JSON_pack_allow_null()! | ||
753 | * @return json pack specification | 755 | * @return json pack specification |
754 | */ | 756 | */ |
755 | struct GNUNET_JSON_PackSpec | 757 | struct GNUNET_JSON_PackSpec |
@@ -762,7 +764,8 @@ GNUNET_JSON_pack_time_abs (const char *name, | |||
762 | * absolute time in network byte order. | 764 | * absolute time in network byte order. |
763 | * | 765 | * |
764 | * @param name name of the field to add to the object | 766 | * @param name name of the field to add to the object |
765 | * @param at absolute time to pack | 767 | * @param at absolute time to pack, a value of 0 is only |
768 | * allowed with #GNUNET_JSON_pack_allow_null()! | ||
766 | * @return json pack specification | 769 | * @return json pack specification |
767 | */ | 770 | */ |
768 | struct GNUNET_JSON_PackSpec | 771 | struct GNUNET_JSON_PackSpec |
@@ -799,7 +802,7 @@ GNUNET_JSON_pack_time_rel_nbo (const char *name, | |||
799 | /** | 802 | /** |
800 | * Generate packer instruction for a JSON field of type | 803 | * Generate packer instruction for a JSON field of type |
801 | * RSA public key. | 804 | * RSA public key. |
802 | * | 805 | * |
803 | * @param name name of the field to add to the object | 806 | * @param name name of the field to add to the object |
804 | * @param pk RSA public key | 807 | * @param pk RSA public key |
805 | * @return json pack specification | 808 | * @return json pack specification |
@@ -812,7 +815,7 @@ GNUNET_JSON_pack_rsa_public_key (const char *name, | |||
812 | /** | 815 | /** |
813 | * Generate packer instruction for a JSON field of type | 816 | * Generate packer instruction for a JSON field of type |
814 | * RSA signature. | 817 | * RSA signature. |
815 | * | 818 | * |
816 | * @param name name of the field to add to the object | 819 | * @param name name of the field to add to the object |
817 | * @param sig RSA signature | 820 | * @param sig RSA signature |
818 | * @return json pack specification | 821 | * @return json pack specification |
diff --git a/src/json/json_pack.c b/src/json/json_pack.c index c61d3331f..92f8b4535 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c | |||
@@ -248,12 +248,20 @@ struct GNUNET_JSON_PackSpec | |||
248 | GNUNET_JSON_pack_time_abs (const char *name, | 248 | GNUNET_JSON_pack_time_abs (const char *name, |
249 | struct GNUNET_TIME_Absolute at) | 249 | struct GNUNET_TIME_Absolute at) |
250 | { | 250 | { |
251 | json_t *json; | 251 | struct GNUNET_JSON_PackSpec ps = { |
252 | .field_name = name | ||
253 | }; | ||
252 | 254 | ||
253 | json = GNUNET_JSON_from_time_abs (at); | 255 | if (0 != at.abs_value_us) |
254 | GNUNET_assert (NULL != json); | 256 | { |
255 | return GNUNET_JSON_pack_object_steal (name, | 257 | ps.object = GNUNET_JSON_from_time_abs (at); |
256 | json); | 258 | GNUNET_assert (NULL != ps.object); |
259 | } | ||
260 | else | ||
261 | { | ||
262 | ps.object = NULL; | ||
263 | } | ||
264 | return ps; | ||
257 | } | 265 | } |
258 | 266 | ||
259 | 267 | ||
diff --git a/src/pq/pq_event.c b/src/pq/pq_event.c index bf845db18..e6c2d07fd 100644 --- a/src/pq/pq_event.c +++ b/src/pq/pq_event.c | |||
@@ -192,7 +192,11 @@ GNUNET_PQ_event_do_poll (struct GNUNET_PQ_Context *db) | |||
192 | 192 | ||
193 | GNUNET_assert (0 == | 193 | GNUNET_assert (0 == |
194 | pthread_mutex_lock (&db->notify_lock)); | 194 | pthread_mutex_lock (&db->notify_lock)); |
195 | PQconsumeInput (db->conn); | 195 | if (1 != |
196 | PQconsumeInput (db->conn)) | ||
197 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
198 | "Failed to read from Postgres: %s\n", | ||
199 | PQerrorMessage (db->conn)); | ||
196 | while (NULL != (n = PQnotifies (db->conn))) | 200 | while (NULL != (n = PQnotifies (db->conn))) |
197 | { | 201 | { |
198 | struct GNUNET_ShortHashCode sh; | 202 | struct GNUNET_ShortHashCode sh; |
@@ -264,7 +268,7 @@ do_scheduler_notify (void *cls) | |||
264 | GNUNET_assert (NULL != db->rfd); | 268 | GNUNET_assert (NULL != db->rfd); |
265 | GNUNET_PQ_event_do_poll (db); | 269 | GNUNET_PQ_event_do_poll (db); |
266 | db->event_task | 270 | db->event_task |
267 | = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_ZERO, | 271 | = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
268 | db->rfd, | 272 | db->rfd, |
269 | &do_scheduler_notify, | 273 | &do_scheduler_notify, |
270 | db); | 274 | db); |
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index a51e92b71..2d258bfc5 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c | |||
@@ -95,7 +95,7 @@ | |||
95 | #define SECURITY_LEVEL 80 | 95 | #define SECURITY_LEVEL 80 |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Is the estimated probabily for a new round this values | 98 | * Is the estimated probability for a new round this values |
99 | * is based on the bsc thesis of Elias Summermatter (2021) | 99 | * is based on the bsc thesis of Elias Summermatter (2021) |
100 | */ | 100 | */ |
101 | 101 | ||
@@ -467,7 +467,7 @@ struct Operation | |||
467 | 467 | ||
468 | /** | 468 | /** |
469 | * Set difference is multiplied with this factor | 469 | * Set difference is multiplied with this factor |
470 | * to gennerate large enought IBF | 470 | * to gennerate large enough IBF |
471 | */ | 471 | */ |
472 | uint8_t ibf_bucket_number_factor; | 472 | uint8_t ibf_bucket_number_factor; |
473 | 473 | ||
@@ -780,7 +780,7 @@ struct perf_num_send_received_msg | |||
780 | }; | 780 | }; |
781 | 781 | ||
782 | /** | 782 | /** |
783 | * Main struct to messure perfomance (data/rtts) | 783 | * Main struct to measure performance (data/rtts) |
784 | */ | 784 | */ |
785 | struct per_store_struct | 785 | struct per_store_struct |
786 | { | 786 | { |
@@ -828,7 +828,7 @@ enum MESSAGE_CONTROL_FLOW_STATE | |||
828 | MSG_CFS_EXPECTED, | 828 | MSG_CFS_EXPECTED, |
829 | 829 | ||
830 | /** | 830 | /** |
831 | * Track that message has been recieved | 831 | * Track that message has been received |
832 | */ | 832 | */ |
833 | MSG_CFS_RECEIVED, | 833 | MSG_CFS_RECEIVED, |
834 | }; | 834 | }; |
@@ -843,20 +843,22 @@ enum MESSAGE_TYPE | |||
843 | * Offer message type | 843 | * Offer message type |
844 | */ | 844 | */ |
845 | OFFER_MESSAGE, | 845 | OFFER_MESSAGE, |
846 | |||
846 | /** | 847 | /** |
847 | * Demand message type | 848 | * Demand message type |
848 | */ | 849 | */ |
849 | DEMAND_MESSAGE, | 850 | DEMAND_MESSAGE, |
851 | |||
850 | /** | 852 | /** |
851 | * Elemente message type | 853 | * Element message type |
852 | */ | 854 | */ |
853 | ELEMENT_MESSAGE, | 855 | ELEMENT_MESSAGE, |
854 | }; | 856 | }; |
855 | 857 | ||
858 | |||
856 | /** | 859 | /** |
857 | * Struct to tracked messages in message controll flow | 860 | * Struct to tracked messages in message control flow |
858 | */ | 861 | */ |
859 | |||
860 | struct messageControlFlowElement | 862 | struct messageControlFlowElement |
861 | { | 863 | { |
862 | /** | 864 | /** |
@@ -875,50 +877,54 @@ struct messageControlFlowElement | |||
875 | 877 | ||
876 | 878 | ||
877 | #if MEASURE_PERFORMANCE | 879 | #if MEASURE_PERFORMANCE |
880 | |||
878 | /** | 881 | /** |
879 | * Loads different configuration to do perform perfomance tests | 882 | * Loads different configuration to perform performance tests |
880 | * @param op | 883 | * |
884 | * @param op operation handle | ||
881 | */ | 885 | */ |
882 | static void | 886 | static void |
883 | load_config (struct Operation *op) | 887 | load_config (struct Operation *op) |
884 | { | 888 | { |
885 | |||
886 | setu_cfg = GNUNET_CONFIGURATION_create (); | ||
887 | GNUNET_CONFIGURATION_load (setu_cfg,"perf_setu.conf"); | ||
888 | |||
889 | |||
890 | long long number; | 889 | long long number; |
891 | float fl; | 890 | float fl; |
892 | GNUNET_CONFIGURATION_get_value_float (setu_cfg,"IBF", "BUCKET_NUMBER_FACTOR", | 891 | |
892 | setu_cfg = GNUNET_CONFIGURATION_create (); | ||
893 | GNUNET_CONFIGURATION_load (setu_cfg, | ||
894 | "perf_setu.conf"); | ||
895 | GNUNET_CONFIGURATION_get_value_float (setu_cfg, | ||
896 | "IBF", | ||
897 | "BUCKET_NUMBER_FACTOR", | ||
893 | &fl); | 898 | &fl); |
894 | op->ibf_bucket_number_factor = fl; | 899 | op->ibf_bucket_number_factor = fl; |
895 | 900 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
896 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"IBF", "NUMBER_PER_BUCKET", | 901 | "IBF", |
902 | "NUMBER_PER_BUCKET", | ||
897 | &number); | 903 | &number); |
898 | op->ibf_number_buckets_per_element = number; | 904 | op->ibf_number_buckets_per_element = number; |
899 | 905 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
900 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"PERFORMANCE", "TRADEOFF", | 906 | "PERFORMANCE", |
907 | "TRADEOFF", | ||
901 | &number); | 908 | &number); |
902 | op->rtt_bandwidth_tradeoff = number; | 909 | op->rtt_bandwidth_tradeoff = number; |
903 | 910 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
904 | 911 | "BOUNDARIES", | |
905 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"BOUNDARIES", "UPPER_ELEMENT", | 912 | "UPPER_ELEMENT", |
906 | &number); | 913 | &number); |
907 | op->byzantine_upper_bound = number; | 914 | op->byzantine_upper_bound = number; |
908 | |||
909 | |||
910 | op->peer_site = 0; | 915 | op->peer_site = 0; |
911 | } | 916 | } |
912 | 917 | ||
913 | 918 | ||
914 | /** | 919 | /** |
915 | * Function to calculate total bytes used for performance messurement | 920 | * Function to calculate total bytes used for performance measurement |
916 | * @param size | 921 | * @param size |
917 | * @param perf_num_send_received_msg | 922 | * @param perf_num_send_received_msg |
918 | * @return bytes used | 923 | * @return bytes used |
919 | */ | 924 | */ |
920 | static int | 925 | static int |
921 | sum_sent_received_bytes (uint64_t size, struct perf_num_send_received_msg | 926 | sum_sent_received_bytes (uint64_t size, |
927 | struct perf_num_send_received_msg | ||
922 | perf_num_send_received_msg) | 928 | perf_num_send_received_msg) |
923 | { | 929 | { |
924 | return (size * perf_num_send_received_msg.sent) | 930 | return (size * perf_num_send_received_msg.sent) |
@@ -942,7 +948,7 @@ calculate_perf_store () | |||
942 | int bytes_transmitted = 0; | 948 | int bytes_transmitted = 0; |
943 | 949 | ||
944 | /** | 950 | /** |
945 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending | 951 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normally 1 or 1.5 depending |
946 | */ | 952 | */ |
947 | if ((perf_store.element_full.received != 0) || | 953 | if ((perf_store.element_full.received != 0) || |
948 | (perf_store.element_full.sent != 0) | 954 | (perf_store.element_full.sent != 0) |
@@ -1840,7 +1846,7 @@ struct GetElementContext | |||
1840 | struct GNUNET_HashCode hash; | 1846 | struct GNUNET_HashCode hash; |
1841 | 1847 | ||
1842 | /** | 1848 | /** |
1843 | * Pointer to the key enty | 1849 | * Pointer to the key entry |
1844 | */ | 1850 | */ |
1845 | struct KeyEntry *k; | 1851 | struct KeyEntry *k; |
1846 | }; | 1852 | }; |
diff --git a/src/setu/gnunet-service-setu_protocol.h b/src/setu/gnunet-service-setu_protocol.h index d8f34f69c..c2a166e60 100644 --- a/src/setu/gnunet-service-setu_protocol.h +++ b/src/setu/gnunet-service-setu_protocol.h | |||
@@ -82,11 +82,13 @@ struct IBFMessage | |||
82 | uint16_t salt GNUNET_PACKED; | 82 | uint16_t salt GNUNET_PACKED; |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * The bit lenght of the counter | 85 | * The bit length of the counter |
86 | */ | 86 | */ |
87 | uint16_t ibf_counter_bit_length; | 87 | uint16_t ibf_counter_bit_length; |
88 | /* rest: buckets */ | 88 | /* rest: buckets */ |
89 | }; | 89 | }; |
90 | |||
91 | |||
90 | /** | 92 | /** |
91 | estimate_best_mode_of_operation (uint64_t avg_element_size, | 93 | estimate_best_mode_of_operation (uint64_t avg_element_size, |
92 | uint64_t local_set_size, | 94 | uint64_t local_set_size, |
@@ -96,7 +98,6 @@ uint64_t est_set_diff_remote, | |||
96 | **/ | 98 | **/ |
97 | 99 | ||
98 | 100 | ||
99 | |||
100 | struct InquiryMessage | 101 | struct InquiryMessage |
101 | { | 102 | { |
102 | /** | 103 | /** |
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c index af84994f8..7f4d64f74 100644 --- a/src/setu/perf_setu_api.c +++ b/src/setu/perf_setu_api.c | |||
@@ -355,7 +355,7 @@ run (void *cls, | |||
355 | set2); | 355 | set2); |
356 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &app_id); | 356 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &app_id); |
357 | 357 | ||
358 | /* test if canceling an uncommited request works! */ | 358 | /* test if canceling an uncommitted request works! */ |
359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
360 | "Launching and instantly stopping set operation\n"); | 360 | "Launching and instantly stopping set operation\n"); |
361 | my_oh = GNUNET_SETU_prepare (&local_id, | 361 | my_oh = GNUNET_SETU_prepare (&local_id, |