diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/fs | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/fs')
39 files changed, 512 insertions, 488 deletions
diff --git a/src/fs/fs.c b/src/fs/fs.c index e26a01996..fc1388a04 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c | |||
@@ -72,8 +72,8 @@ stop_job (struct GNUNET_FS_QueueEntry *qe) | |||
72 | qe->h->active_blocks -= qe->blocks; | 72 | qe->h->active_blocks -= qe->blocks; |
73 | qe->run_time = | 73 | qe->run_time = |
74 | GNUNET_TIME_relative_add (qe->run_time, | 74 | GNUNET_TIME_relative_add (qe->run_time, |
75 | GNUNET_TIME_absolute_get_duration (qe-> | 75 | GNUNET_TIME_absolute_get_duration |
76 | start_time)); | 76 | (qe->start_time)); |
77 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); | 77 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); |
78 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, | 78 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, |
79 | qe->h->pending_tail, qe); | 79 | qe->h->pending_tail, qe); |
@@ -638,12 +638,8 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, | |||
638 | * the infromation | 638 | * the infromation |
639 | * @return NULL on error | 639 | * @return NULL on error |
640 | */ | 640 | */ |
641 | static struct GNUNET_FS_FileInformation *deserialize_file_information (struct | 641 | static struct GNUNET_FS_FileInformation * |
642 | GNUNET_FS_Handle | 642 | deserialize_file_information (struct GNUNET_FS_Handle *h, const char *filename); |
643 | *h, | ||
644 | const | ||
645 | char | ||
646 | *filename); | ||
647 | 643 | ||
648 | 644 | ||
649 | /** | 645 | /** |
@@ -1152,8 +1148,8 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) | |||
1152 | (GNUNET_OK != | 1148 | (GNUNET_OK != |
1153 | GNUNET_BIO_write_string (wh, | 1149 | GNUNET_BIO_write_string (wh, |
1154 | (fi->data.dir.entries == | 1150 | (fi->data.dir.entries == |
1155 | NULL) ? NULL : fi->data.dir.entries-> | 1151 | NULL) ? NULL : fi->data.dir. |
1156 | serialization))) | 1152 | entries->serialization))) |
1157 | { | 1153 | { |
1158 | GNUNET_break (0); | 1154 | GNUNET_break (0); |
1159 | goto cleanup; | 1155 | goto cleanup; |
@@ -1566,9 +1562,9 @@ read_download_request (struct GNUNET_BIO_ReadHandle *rh) | |||
1566 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || | 1562 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || |
1567 | (dr->num_children > CHK_PER_INODE) || | 1563 | (dr->num_children > CHK_PER_INODE) || |
1568 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0) | 1564 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0) |
1569 | && (dr-> | 1565 | && |
1570 | num_children | 1566 | (dr->num_children |
1571 | > 0)) || | 1567 | > 0)) || |
1572 | ((dr->depth > 0) && (dr->num_children == 0))) | 1568 | ((dr->depth > 0) && (dr->num_children == 0))) |
1573 | { | 1569 | { |
1574 | GNUNET_break (0); | 1570 | GNUNET_break (0); |
@@ -2017,11 +2013,12 @@ cleanup: | |||
2017 | * @param search associated search | 2013 | * @param search associated search |
2018 | * @param serialization name under which the search was serialized | 2014 | * @param serialization name under which the search was serialized |
2019 | */ | 2015 | */ |
2020 | static void deserialize_download (struct GNUNET_FS_Handle *h, | 2016 | static void |
2021 | struct GNUNET_BIO_ReadHandle *rh, | 2017 | deserialize_download (struct GNUNET_FS_Handle *h, |
2022 | struct GNUNET_FS_DownloadContext *parent, | 2018 | struct GNUNET_BIO_ReadHandle *rh, |
2023 | struct GNUNET_FS_SearchResult *search, | 2019 | struct GNUNET_FS_DownloadContext *parent, |
2024 | const char *serialization); | 2020 | struct GNUNET_FS_SearchResult *search, |
2021 | const char *serialization); | ||
2025 | 2022 | ||
2026 | 2023 | ||
2027 | /** | 2024 | /** |
@@ -2032,16 +2029,11 @@ static void deserialize_download (struct GNUNET_FS_Handle *h, | |||
2032 | * @param psearch_result parent search result | 2029 | * @param psearch_result parent search result |
2033 | * @param serialization name under which the search was serialized | 2030 | * @param serialization name under which the search was serialized |
2034 | */ | 2031 | */ |
2035 | static struct GNUNET_FS_SearchContext *deserialize_search (struct | 2032 | static struct GNUNET_FS_SearchContext * |
2036 | GNUNET_FS_Handle *h, | 2033 | deserialize_search (struct GNUNET_FS_Handle *h, |
2037 | struct | 2034 | struct GNUNET_BIO_ReadHandle *rh, |
2038 | GNUNET_BIO_ReadHandle | 2035 | struct GNUNET_FS_SearchResult *psearch_result, |
2039 | *rh, | 2036 | const char *serialization); |
2040 | struct | ||
2041 | GNUNET_FS_SearchResult | ||
2042 | *psearch_result, | ||
2043 | const char | ||
2044 | *serialization); | ||
2045 | 2037 | ||
2046 | 2038 | ||
2047 | /** | 2039 | /** |
@@ -2203,7 +2195,8 @@ signal_download_resume (struct GNUNET_FS_DownloadContext *dc) | |||
2203 | * | 2195 | * |
2204 | * @param sc search being resumed | 2196 | * @param sc search being resumed |
2205 | */ | 2197 | */ |
2206 | static void signal_search_resume (struct GNUNET_FS_SearchContext *sc); | 2198 | static void |
2199 | signal_search_resume (struct GNUNET_FS_SearchContext *sc); | ||
2207 | 2200 | ||
2208 | 2201 | ||
2209 | /** | 2202 | /** |
@@ -2255,7 +2248,8 @@ signal_result_resume (void *cls, const GNUNET_HashCode * key, void *value) | |||
2255 | * | 2248 | * |
2256 | * @param sc search context to free | 2249 | * @param sc search context to free |
2257 | */ | 2250 | */ |
2258 | static void free_search_context (struct GNUNET_FS_SearchContext *sc); | 2251 | static void |
2252 | free_search_context (struct GNUNET_FS_SearchContext *sc); | ||
2259 | 2253 | ||
2260 | 2254 | ||
2261 | /** | 2255 | /** |
diff --git a/src/fs/fs.h b/src/fs/fs.h index 68bab5916..11cfc755e 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -759,17 +759,17 @@ struct GNUNET_FS_SearchResult | |||
759 | * @param blocks number of blocks this download has | 759 | * @param blocks number of blocks this download has |
760 | * @return queue handle | 760 | * @return queue handle |
761 | */ | 761 | */ |
762 | struct GNUNET_FS_QueueEntry *GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, | 762 | struct GNUNET_FS_QueueEntry * |
763 | GNUNET_FS_QueueStart start, | 763 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, |
764 | GNUNET_FS_QueueStop stop, | 764 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks); |
765 | void *cls, unsigned int blocks); | ||
766 | 765 | ||
767 | 766 | ||
768 | /** | 767 | /** |
769 | * Dequeue a job from the queue. | 768 | * Dequeue a job from the queue. |
770 | * @param qh handle for the job | 769 | * @param qh handle for the job |
771 | */ | 770 | */ |
772 | void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | 771 | void |
772 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | ||
773 | 773 | ||
774 | 774 | ||
775 | /** | 775 | /** |
@@ -788,9 +788,9 @@ void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | |||
788 | * @param emsg location for the reader to store an error message | 788 | * @param emsg location for the reader to store an error message |
789 | * @return number of bytes written, usually "max", 0 on error | 789 | * @return number of bytes written, usually "max", 0 on error |
790 | */ | 790 | */ |
791 | size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | 791 | size_t |
792 | size_t max, void *buf, | 792 | GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf, |
793 | char **emsg); | 793 | char **emsg); |
794 | 794 | ||
795 | 795 | ||
796 | /** | 796 | /** |
@@ -799,7 +799,8 @@ size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | |||
799 | * @param filename file to read | 799 | * @param filename file to read |
800 | * @return closure to use | 800 | * @return closure to use |
801 | */ | 801 | */ |
802 | void *GNUNET_FS_make_file_reader_context_ (const char *filename); | 802 | void * |
803 | GNUNET_FS_make_file_reader_context_ (const char *filename); | ||
803 | 804 | ||
804 | 805 | ||
805 | 806 | ||
@@ -819,8 +820,9 @@ void *GNUNET_FS_make_file_reader_context_ (const char *filename); | |||
819 | * @param emsg location for the reader to store an error message | 820 | * @param emsg location for the reader to store an error message |
820 | * @return number of bytes written, usually "max", 0 on error | 821 | * @return number of bytes written, usually "max", 0 on error |
821 | */ | 822 | */ |
822 | size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | 823 | size_t |
823 | void *buf, char **emsg); | 824 | GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf, |
825 | char **emsg); | ||
824 | 826 | ||
825 | /** | 827 | /** |
826 | * Notification of FS that a search probe has made progress. | 828 | * Notification of FS that a search probe has made progress. |
@@ -837,9 +839,9 @@ size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | |||
837 | * will be passed to future callbacks in the respective | 839 | * will be passed to future callbacks in the respective |
838 | * field in the GNUNET_FS_ProgressInfo struct. | 840 | * field in the GNUNET_FS_ProgressInfo struct. |
839 | */ | 841 | */ |
840 | void *GNUNET_FS_search_probe_progress_ (void *cls, | 842 | void * |
841 | const struct GNUNET_FS_ProgressInfo | 843 | GNUNET_FS_search_probe_progress_ (void *cls, |
842 | *info); | 844 | const struct GNUNET_FS_ProgressInfo *info); |
843 | 845 | ||
844 | 846 | ||
845 | /** | 847 | /** |
@@ -848,8 +850,9 @@ void *GNUNET_FS_search_probe_progress_ (void *cls, | |||
848 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload | 850 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload |
849 | * @param tc task context | 851 | * @param tc task context |
850 | */ | 852 | */ |
851 | void GNUNET_FS_publish_main_ (void *cls, | 853 | void |
852 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 854 | GNUNET_FS_publish_main_ (void *cls, |
855 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
853 | 856 | ||
854 | 857 | ||
855 | /** | 858 | /** |
@@ -859,8 +862,8 @@ void GNUNET_FS_publish_main_ (void *cls, | |||
859 | * @param cls closure, unindex context | 862 | * @param cls closure, unindex context |
860 | * @param file_id computed hash, NULL on error | 863 | * @param file_id computed hash, NULL on error |
861 | */ | 864 | */ |
862 | void GNUNET_FS_unindex_process_hash_ (void *cls, | 865 | void |
863 | const GNUNET_HashCode * file_id); | 866 | GNUNET_FS_unindex_process_hash_ (void *cls, const GNUNET_HashCode * file_id); |
864 | 867 | ||
865 | 868 | ||
866 | /** | 869 | /** |
@@ -873,10 +876,11 @@ void GNUNET_FS_unindex_process_hash_ (void *cls, | |||
873 | * @param offset where in the file are we so far | 876 | * @param offset where in the file are we so far |
874 | * @return value returned from callback | 877 | * @return value returned from callback |
875 | */ | 878 | */ |
876 | void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 879 | void * |
877 | struct GNUNET_FS_PublishContext *sc, | 880 | GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
878 | const struct GNUNET_FS_FileInformation *p, | 881 | struct GNUNET_FS_PublishContext *sc, |
879 | uint64_t offset); | 882 | const struct GNUNET_FS_FileInformation *p, |
883 | uint64_t offset); | ||
880 | 884 | ||
881 | 885 | ||
882 | /** | 886 | /** |
@@ -886,8 +890,9 @@ void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
886 | * @param pi structure to fill in | 890 | * @param pi structure to fill in |
887 | * @param dc overall download context | 891 | * @param dc overall download context |
888 | */ | 892 | */ |
889 | void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 893 | void |
890 | struct GNUNET_FS_DownloadContext *dc); | 894 | GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
895 | struct GNUNET_FS_DownloadContext *dc); | ||
891 | 896 | ||
892 | 897 | ||
893 | /** | 898 | /** |
@@ -897,9 +902,9 @@ void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
897 | * @param cls the 'struct GNUNET_FS_DownloadContext' | 902 | * @param cls the 'struct GNUNET_FS_DownloadContext' |
898 | * @param tc scheduler context | 903 | * @param tc scheduler context |
899 | */ | 904 | */ |
900 | void GNUNET_FS_download_start_task_ (void *cls, | 905 | void |
901 | const struct GNUNET_SCHEDULER_TaskContext | 906 | GNUNET_FS_download_start_task_ (void *cls, |
902 | *tc); | 907 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
903 | 908 | ||
904 | 909 | ||
905 | 910 | ||
@@ -911,9 +916,10 @@ void GNUNET_FS_download_start_task_ (void *cls, | |||
911 | * @param uc overall unindex context | 916 | * @param uc overall unindex context |
912 | * @param offset where we are in the file (for progress) | 917 | * @param offset where we are in the file (for progress) |
913 | */ | 918 | */ |
914 | void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 919 | void |
915 | struct GNUNET_FS_UnindexContext *uc, | 920 | GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
916 | uint64_t offset); | 921 | struct GNUNET_FS_UnindexContext *uc, |
922 | uint64_t offset); | ||
917 | 923 | ||
918 | /** | 924 | /** |
919 | * Fill in all of the generic fields for a search event and | 925 | * Fill in all of the generic fields for a search event and |
@@ -923,8 +929,9 @@ void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
923 | * @param sc overall search context | 929 | * @param sc overall search context |
924 | * @return value returned by the callback | 930 | * @return value returned by the callback |
925 | */ | 931 | */ |
926 | void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 932 | void * |
927 | struct GNUNET_FS_SearchContext *sc); | 933 | GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
934 | struct GNUNET_FS_SearchContext *sc); | ||
928 | 935 | ||
929 | 936 | ||
930 | /** | 937 | /** |
@@ -932,7 +939,8 @@ void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
932 | * | 939 | * |
933 | * @param uc context for the unindex operation. | 940 | * @param uc context for the unindex operation. |
934 | */ | 941 | */ |
935 | void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | 942 | void |
943 | GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | ||
936 | 944 | ||
937 | /** | 945 | /** |
938 | * Build the request and actually initiate the search using the | 946 | * Build the request and actually initiate the search using the |
@@ -941,15 +949,16 @@ void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | |||
941 | * @param sc search context | 949 | * @param sc search context |
942 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 950 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
943 | */ | 951 | */ |
944 | int GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | 952 | int |
953 | GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | ||
945 | 954 | ||
946 | /** | 955 | /** |
947 | * Start the downloading process (by entering the queue). | 956 | * Start the downloading process (by entering the queue). |
948 | * | 957 | * |
949 | * @param dc our download context | 958 | * @param dc our download context |
950 | */ | 959 | */ |
951 | void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | 960 | void |
952 | *dc); | 961 | GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc); |
953 | 962 | ||
954 | 963 | ||
955 | /** | 964 | /** |
@@ -957,7 +966,8 @@ void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | |||
957 | * | 966 | * |
958 | * @param sr the search result | 967 | * @param sr the search result |
959 | */ | 968 | */ |
960 | void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | 969 | void |
970 | GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | ||
961 | 971 | ||
962 | /** | 972 | /** |
963 | * Remove serialization/deserialization file from disk. | 973 | * Remove serialization/deserialization file from disk. |
@@ -966,8 +976,9 @@ void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | |||
966 | * @param ext component of the path | 976 | * @param ext component of the path |
967 | * @param ent entity identifier | 977 | * @param ent entity identifier |
968 | */ | 978 | */ |
969 | void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | 979 | void |
970 | const char *ent); | 980 | GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, |
981 | const char *ent); | ||
971 | 982 | ||
972 | 983 | ||
973 | /** | 984 | /** |
@@ -977,8 +988,9 @@ void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
977 | * @param ext component of the path | 988 | * @param ext component of the path |
978 | * @param uni unique name of parent | 989 | * @param uni unique name of parent |
979 | */ | 990 | */ |
980 | void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | 991 | void |
981 | const char *uni); | 992 | GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, |
993 | const char *uni); | ||
982 | 994 | ||
983 | 995 | ||
984 | /** | 996 | /** |
@@ -989,7 +1001,8 @@ void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
989 | * | 1001 | * |
990 | * @param fi the struct to sync | 1002 | * @param fi the struct to sync |
991 | */ | 1003 | */ |
992 | void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | 1004 | void |
1005 | GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | ||
993 | 1006 | ||
994 | /** | 1007 | /** |
995 | * Synchronize this publishing struct with its mirror | 1008 | * Synchronize this publishing struct with its mirror |
@@ -999,7 +1012,8 @@ void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | |||
999 | * | 1012 | * |
1000 | * @param pc the struct to sync | 1013 | * @param pc the struct to sync |
1001 | */ | 1014 | */ |
1002 | void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | 1015 | void |
1016 | GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | ||
1003 | 1017 | ||
1004 | /** | 1018 | /** |
1005 | * Synchronize this unindex struct with its mirror | 1019 | * Synchronize this unindex struct with its mirror |
@@ -1009,7 +1023,8 @@ void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | |||
1009 | * | 1023 | * |
1010 | * @param uc the struct to sync | 1024 | * @param uc the struct to sync |
1011 | */ | 1025 | */ |
1012 | void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | 1026 | void |
1027 | GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | ||
1013 | 1028 | ||
1014 | /** | 1029 | /** |
1015 | * Synchronize this search struct with its mirror | 1030 | * Synchronize this search struct with its mirror |
@@ -1019,7 +1034,8 @@ void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | |||
1019 | * | 1034 | * |
1020 | * @param sc the struct to sync | 1035 | * @param sc the struct to sync |
1021 | */ | 1036 | */ |
1022 | void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | 1037 | void |
1038 | GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | ||
1023 | 1039 | ||
1024 | /** | 1040 | /** |
1025 | * Synchronize this search result with its mirror | 1041 | * Synchronize this search result with its mirror |
@@ -1029,7 +1045,8 @@ void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | |||
1029 | * | 1045 | * |
1030 | * @param sr the struct to sync | 1046 | * @param sr the struct to sync |
1031 | */ | 1047 | */ |
1032 | void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | 1048 | void |
1049 | GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | ||
1033 | 1050 | ||
1034 | /** | 1051 | /** |
1035 | * Synchronize this download struct with its mirror | 1052 | * Synchronize this download struct with its mirror |
@@ -1039,7 +1056,8 @@ void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | |||
1039 | * | 1056 | * |
1040 | * @param dc the struct to sync | 1057 | * @param dc the struct to sync |
1041 | */ | 1058 | */ |
1042 | void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | 1059 | void |
1060 | GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | ||
1043 | 1061 | ||
1044 | /** | 1062 | /** |
1045 | * Create SUSPEND event for the given publish operation | 1063 | * Create SUSPEND event for the given publish operation |
@@ -1047,7 +1065,8 @@ void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | |||
1047 | * | 1065 | * |
1048 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for | 1066 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for |
1049 | */ | 1067 | */ |
1050 | void GNUNET_FS_publish_signal_suspend_ (void *cls); | 1068 | void |
1069 | GNUNET_FS_publish_signal_suspend_ (void *cls); | ||
1051 | 1070 | ||
1052 | /** | 1071 | /** |
1053 | * Create SUSPEND event for the given search operation | 1072 | * Create SUSPEND event for the given search operation |
@@ -1055,7 +1074,8 @@ void GNUNET_FS_publish_signal_suspend_ (void *cls); | |||
1055 | * | 1074 | * |
1056 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for | 1075 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for |
1057 | */ | 1076 | */ |
1058 | void GNUNET_FS_search_signal_suspend_ (void *cls); | 1077 | void |
1078 | GNUNET_FS_search_signal_suspend_ (void *cls); | ||
1059 | 1079 | ||
1060 | /** | 1080 | /** |
1061 | * Create SUSPEND event for the given download operation | 1081 | * Create SUSPEND event for the given download operation |
@@ -1063,7 +1083,8 @@ void GNUNET_FS_search_signal_suspend_ (void *cls); | |||
1063 | * | 1083 | * |
1064 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for | 1084 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for |
1065 | */ | 1085 | */ |
1066 | void GNUNET_FS_download_signal_suspend_ (void *cls); | 1086 | void |
1087 | GNUNET_FS_download_signal_suspend_ (void *cls); | ||
1067 | 1088 | ||
1068 | /** | 1089 | /** |
1069 | * Create SUSPEND event for the given unindex operation | 1090 | * Create SUSPEND event for the given unindex operation |
@@ -1071,7 +1092,8 @@ void GNUNET_FS_download_signal_suspend_ (void *cls); | |||
1071 | * | 1092 | * |
1072 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for | 1093 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for |
1073 | */ | 1094 | */ |
1074 | void GNUNET_FS_unindex_signal_suspend_ (void *cls); | 1095 | void |
1096 | GNUNET_FS_unindex_signal_suspend_ (void *cls); | ||
1075 | 1097 | ||
1076 | /** | 1098 | /** |
1077 | * Function signature of the functions that can be called | 1099 | * Function signature of the functions that can be called |
@@ -1118,9 +1140,9 @@ struct TopLevelActivity | |||
1118 | * @param ssf_cls closure for ssf | 1140 | * @param ssf_cls closure for ssf |
1119 | * @return fresh top-level activity handle | 1141 | * @return fresh top-level activity handle |
1120 | */ | 1142 | */ |
1121 | struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | 1143 | struct TopLevelActivity * |
1122 | SuspendSignalFunction ssf, | 1144 | GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, |
1123 | void *ssf_cls); | 1145 | void *ssf_cls); |
1124 | 1146 | ||
1125 | 1147 | ||
1126 | /** | 1148 | /** |
@@ -1129,8 +1151,8 @@ struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | |||
1129 | * @param h global fs handle | 1151 | * @param h global fs handle |
1130 | * @param top top level activity entry | 1152 | * @param top top level activity entry |
1131 | */ | 1153 | */ |
1132 | void GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, | 1154 | void |
1133 | struct TopLevelActivity *top); | 1155 | GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top); |
1134 | 1156 | ||
1135 | 1157 | ||
1136 | 1158 | ||
@@ -1736,7 +1758,8 @@ struct DownloadRequest | |||
1736 | * | 1758 | * |
1737 | * @param dr request to free | 1759 | * @param dr request to free |
1738 | */ | 1760 | */ |
1739 | void GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | 1761 | void |
1762 | GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | ||
1740 | 1763 | ||
1741 | 1764 | ||
1742 | /** | 1765 | /** |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index a3c5b9b62..89de277da 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -143,7 +143,8 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
143 | * @param buf where the callee should write the message | 143 | * @param buf where the callee should write the message |
144 | * @return number of bytes written to buf | 144 | * @return number of bytes written to buf |
145 | */ | 145 | */ |
146 | static size_t transmit_download_request (void *cls, size_t size, void *buf); | 146 | static size_t |
147 | transmit_download_request (void *cls, size_t size, void *buf); | ||
147 | 148 | ||
148 | 149 | ||
149 | /** | 150 | /** |
@@ -194,8 +195,9 @@ struct ProcessResultClosure | |||
194 | * @param value value in the hash map (a 'struct DownloadRequest') | 195 | * @param value value in the hash map (a 'struct DownloadRequest') |
195 | * @return GNUNET_YES (we should continue to iterate); unless serious error | 196 | * @return GNUNET_YES (we should continue to iterate); unless serious error |
196 | */ | 197 | */ |
197 | static int process_result_with_request (void *cls, const GNUNET_HashCode * key, | 198 | static int |
198 | void *value); | 199 | process_result_with_request (void *cls, const GNUNET_HashCode * key, |
200 | void *value); | ||
199 | 201 | ||
200 | 202 | ||
201 | /** | 203 | /** |
@@ -261,7 +263,8 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, | |||
261 | * | 263 | * |
262 | * @param dc download context that is having trouble | 264 | * @param dc download context that is having trouble |
263 | */ | 265 | */ |
264 | static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | 266 | static void |
267 | try_reconnect (struct GNUNET_FS_DownloadContext *dc); | ||
265 | 268 | ||
266 | 269 | ||
267 | /** | 270 | /** |
@@ -275,10 +278,11 @@ static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | |||
275 | * @param length number of bytes in data | 278 | * @param length number of bytes in data |
276 | * @param data contents of the file (or NULL if they were not inlined) | 279 | * @param data contents of the file (or NULL if they were not inlined) |
277 | */ | 280 | */ |
278 | static void trigger_recursive_download (void *cls, const char *filename, | 281 | static void |
279 | const struct GNUNET_FS_Uri *uri, | 282 | trigger_recursive_download (void *cls, const char *filename, |
280 | const struct GNUNET_CONTAINER_MetaData | 283 | const struct GNUNET_FS_Uri *uri, |
281 | *meta, size_t length, const void *data); | 284 | const struct GNUNET_CONTAINER_MetaData *meta, |
285 | size_t length, const void *data); | ||
282 | 286 | ||
283 | 287 | ||
284 | /** | 288 | /** |
@@ -940,8 +944,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
940 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
941 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", | 945 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", |
942 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, | 946 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, |
943 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 947 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
944 | file_length)); | 948 | chk.file_length)); |
945 | 949 | ||
946 | #endif | 950 | #endif |
947 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll | 951 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll |
@@ -953,8 +957,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
953 | _ | 957 | _ |
954 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), | 958 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), |
955 | bs, dr->depth, (unsigned long long) dr->offset, | 959 | bs, dr->depth, (unsigned long long) dr->offset, |
956 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 960 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
957 | file_length), | 961 | chk.file_length), |
958 | prc->size); | 962 | prc->size); |
959 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); | 963 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); |
960 | while (dr->parent != NULL) | 964 | while (dr->parent != NULL) |
@@ -1077,8 +1081,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
1077 | #if DEBUG_DOWNLOAD | 1081 | #if DEBUG_DOWNLOAD |
1078 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1082 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1079 | "Download completed, truncating file to desired length %llu\n", | 1083 | "Download completed, truncating file to desired length %llu\n", |
1080 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 1084 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
1081 | file_length)); | 1085 | chk.file_length)); |
1082 | #endif | 1086 | #endif |
1083 | /* truncate file to size (since we store IBlocks at the end) */ | 1087 | /* truncate file to size (since we store IBlocks at the end) */ |
1084 | if (dc->filename != NULL) | 1088 | if (dc->filename != NULL) |
@@ -1757,8 +1761,7 @@ GNUNET_FS_download_start_task_ (void *cls, | |||
1757 | GNUNET_DISK_OPEN_READWRITE | | 1761 | GNUNET_DISK_OPEN_READWRITE | |
1758 | GNUNET_DISK_OPEN_CREATE | | 1762 | GNUNET_DISK_OPEN_CREATE | |
1759 | ((0 == | 1763 | ((0 == |
1760 | GNUNET_FS_uri_chk_get_file_size (dc-> | 1764 | GNUNET_FS_uri_chk_get_file_size (dc->uri)) ? |
1761 | uri)) ? | ||
1762 | GNUNET_DISK_OPEN_TRUNCATE : 0), | 1765 | GNUNET_DISK_OPEN_TRUNCATE : 0), |
1763 | GNUNET_DISK_PERM_USER_READ | | 1766 | GNUNET_DISK_PERM_USER_READ | |
1764 | GNUNET_DISK_PERM_USER_WRITE | | 1767 | GNUNET_DISK_PERM_USER_WRITE | |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 6809e3055..a67b22036 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -638,8 +638,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
638 | no = GNUNET_NO; | 638 | no = GNUNET_NO; |
639 | if (GNUNET_OK != | 639 | if (GNUNET_OK != |
640 | proc (proc_cls, dir, | 640 | proc (proc_cls, dir, |
641 | (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file. | 641 | (dir->is_directory) ? dir->data.dir.dir_size : dir->data. |
642 | file_size, dir->meta, &dir->keywords, &dir->bo, | 642 | file.file_size, dir->meta, &dir->keywords, &dir->bo, |
643 | (dir->is_directory) ? &no : &dir->data.file.do_index, | 643 | (dir->is_directory) ? &no : &dir->data.file.do_index, |
644 | &dir->client_info)) | 644 | &dir->client_info)) |
645 | return; | 645 | return; |
@@ -651,8 +651,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
651 | no = GNUNET_NO; | 651 | no = GNUNET_NO; |
652 | if (GNUNET_OK != | 652 | if (GNUNET_OK != |
653 | proc (proc_cls, pos, | 653 | proc (proc_cls, pos, |
654 | (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file. | 654 | (pos->is_directory) ? pos->data.dir.dir_size : pos->data. |
655 | file_size, pos->meta, &pos->keywords, &pos->bo, | 655 | file.file_size, pos->meta, &pos->keywords, &pos->bo, |
656 | (dir->is_directory) ? &no : &dir->data.file.do_index, | 656 | (dir->is_directory) ? &no : &dir->data.file.do_index, |
657 | &pos->client_info)) | 657 | &pos->client_info)) |
658 | break; | 658 | break; |
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 746f4f099..94641e934 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -179,8 +179,8 @@ signal_publish_completion (struct GNUNET_FS_FileInformation *p, | |||
179 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; | 179 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; |
180 | p->client_info = | 180 | p->client_info = |
181 | GNUNET_FS_publish_make_status_ (&pi, pc, p, | 181 | GNUNET_FS_publish_make_status_ (&pi, pc, p, |
182 | GNUNET_ntohll (p->chk_uri->data.chk. | 182 | GNUNET_ntohll (p->chk_uri->data. |
183 | file_length)); | 183 | chk.file_length)); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
@@ -1333,8 +1333,8 @@ struct PublishKskContext | |||
1333 | * @param cls closure of type "struct PublishKskContext*" | 1333 | * @param cls closure of type "struct PublishKskContext*" |
1334 | * @param tc unused | 1334 | * @param tc unused |
1335 | */ | 1335 | */ |
1336 | static void publish_ksk_cont (void *cls, | 1336 | static void |
1337 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 1337 | publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
1338 | 1338 | ||
1339 | 1339 | ||
1340 | /** | 1340 | /** |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 89a8c5582..0c47eb173 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -440,15 +440,10 @@ process_ksk_result (struct GNUNET_FS_SearchContext *sc, | |||
440 | * @param psearch parent search result (for namespace update searches) | 440 | * @param psearch parent search result (for namespace update searches) |
441 | * @return context that can be used to control the search | 441 | * @return context that can be used to control the search |
442 | */ | 442 | */ |
443 | static struct GNUNET_FS_SearchContext *search_start (struct GNUNET_FS_Handle *h, | 443 | static struct GNUNET_FS_SearchContext * |
444 | const struct GNUNET_FS_Uri | 444 | search_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, |
445 | *uri, uint32_t anonymity, | 445 | uint32_t anonymity, enum GNUNET_FS_SearchOptions options, |
446 | enum | 446 | void *cctx, struct GNUNET_FS_SearchResult *psearch); |
447 | GNUNET_FS_SearchOptions | ||
448 | options, void *cctx, | ||
449 | struct | ||
450 | GNUNET_FS_SearchResult | ||
451 | *psearch); | ||
452 | 447 | ||
453 | 448 | ||
454 | /** | 449 | /** |
@@ -813,7 +808,8 @@ process_result (struct GNUNET_FS_SearchContext *sc, enum GNUNET_BLOCK_Type type, | |||
813 | * | 808 | * |
814 | * @param sc the search to reconnec | 809 | * @param sc the search to reconnec |
815 | */ | 810 | */ |
816 | static void try_reconnect (struct GNUNET_FS_SearchContext *sc); | 811 | static void |
812 | try_reconnect (struct GNUNET_FS_SearchContext *sc); | ||
817 | 813 | ||
818 | 814 | ||
819 | /** | 815 | /** |
@@ -855,8 +851,8 @@ receive_results (void *cls, const struct GNUNET_MessageHeader *msg) | |||
855 | * | 851 | * |
856 | * @param sc context for the search | 852 | * @param sc context for the search |
857 | */ | 853 | */ |
858 | static void schedule_transmit_search_request (struct GNUNET_FS_SearchContext | 854 | static void |
859 | *sc); | 855 | schedule_transmit_search_request (struct GNUNET_FS_SearchContext *sc); |
860 | 856 | ||
861 | 857 | ||
862 | /** | 858 | /** |
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h index fa822e265..ad1d96bf0 100644 --- a/src/fs/fs_test_lib.h +++ b/src/fs/fs_test_lib.h | |||
@@ -53,11 +53,12 @@ struct GNUNET_FS_TestDaemon; | |||
53 | * 'GNUNET_FS_TEST_daemons_stop'! | 53 | * 'GNUNET_FS_TEST_daemons_stop'! |
54 | * @param cont_cls closure for cont | 54 | * @param cont_cls closure for cont |
55 | */ | 55 | */ |
56 | void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, | 56 | void |
57 | struct GNUNET_TIME_Relative timeout, | 57 | GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, |
58 | unsigned int total, | 58 | struct GNUNET_TIME_Relative timeout, |
59 | struct GNUNET_FS_TestDaemon **daemons, | 59 | unsigned int total, |
60 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 60 | struct GNUNET_FS_TestDaemon **daemons, |
61 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
61 | 62 | ||
62 | 63 | ||
63 | /** | 64 | /** |
@@ -70,11 +71,11 @@ void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, | |||
70 | * @param cont function to call when done | 71 | * @param cont function to call when done |
71 | * @param cont_cls closure for cont | 72 | * @param cont_cls closure for cont |
72 | */ | 73 | */ |
73 | void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, | 74 | void |
74 | struct GNUNET_FS_TestDaemon *daemon2, | 75 | GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, |
75 | struct GNUNET_TIME_Relative timeout, | 76 | struct GNUNET_FS_TestDaemon *daemon2, |
76 | GNUNET_SCHEDULER_Task cont, | 77 | struct GNUNET_TIME_Relative timeout, |
77 | void *cont_cls); | 78 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
78 | 79 | ||
79 | 80 | ||
80 | /** | 81 | /** |
@@ -83,9 +84,8 @@ void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, | |||
83 | * @param daemons array with the daemons (must contain at least one) | 84 | * @param daemons array with the daemons (must contain at least one) |
84 | * @return peer group | 85 | * @return peer group |
85 | */ | 86 | */ |
86 | struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct | 87 | struct GNUNET_TESTING_PeerGroup * |
87 | GNUNET_FS_TestDaemon | 88 | GNUNET_FS_TEST_get_group (struct GNUNET_FS_TestDaemon **daemons); |
88 | **daemons); | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
@@ -96,9 +96,9 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct | |||
96 | * @param off which configuration to get | 96 | * @param off which configuration to get |
97 | * @return peer configuration | 97 | * @return peer configuration |
98 | */ | 98 | */ |
99 | const struct GNUNET_CONFIGURATION_Handle | 99 | const struct GNUNET_CONFIGURATION_Handle * |
100 | *GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, | 100 | GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, |
101 | unsigned int off); | 101 | unsigned int off); |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Stop daemons used for testing. | 104 | * Stop daemons used for testing. |
@@ -106,8 +106,9 @@ const struct GNUNET_CONFIGURATION_Handle | |||
106 | * @param total number of daemons to stop | 106 | * @param total number of daemons to stop |
107 | * @param daemons array with the daemons (values will be clobbered) | 107 | * @param daemons array with the daemons (values will be clobbered) |
108 | */ | 108 | */ |
109 | void GNUNET_FS_TEST_daemons_stop (unsigned int total, | 109 | void |
110 | struct GNUNET_FS_TestDaemon **daemons); | 110 | GNUNET_FS_TEST_daemons_stop (unsigned int total, |
111 | struct GNUNET_FS_TestDaemon **daemons); | ||
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
@@ -136,12 +137,12 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | |||
136 | * @param cont function to call when done | 137 | * @param cont function to call when done |
137 | * @param cont_cls closure for cont | 138 | * @param cont_cls closure for cont |
138 | */ | 139 | */ |
139 | void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | 140 | void |
140 | struct GNUNET_TIME_Relative timeout, | 141 | GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, |
141 | uint32_t anonymity, int do_index, uint64_t size, | 142 | struct GNUNET_TIME_Relative timeout, uint32_t anonymity, |
142 | uint32_t seed, unsigned int verbose, | 143 | int do_index, uint64_t size, uint32_t seed, |
143 | GNUNET_FS_TEST_UriContinuation cont, | 144 | unsigned int verbose, |
144 | void *cont_cls); | 145 | GNUNET_FS_TEST_UriContinuation cont, void *cont_cls); |
145 | 146 | ||
146 | 147 | ||
147 | /** | 148 | /** |
@@ -157,12 +158,12 @@ void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | |||
157 | * @param cont function to call when done | 158 | * @param cont function to call when done |
158 | * @param cont_cls closure for cont | 159 | * @param cont_cls closure for cont |
159 | */ | 160 | */ |
160 | void GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, | 161 | void |
161 | struct GNUNET_TIME_Relative timeout, | 162 | GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, |
162 | uint32_t anonymity, uint32_t seed, | 163 | struct GNUNET_TIME_Relative timeout, |
163 | const struct GNUNET_FS_Uri *uri, | 164 | uint32_t anonymity, uint32_t seed, |
164 | unsigned int verbose, GNUNET_SCHEDULER_Task cont, | 165 | const struct GNUNET_FS_Uri *uri, unsigned int verbose, |
165 | void *cont_cls); | 166 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
166 | 167 | ||
167 | 168 | ||
168 | 169 | ||
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 0a0db7a10..58d0f0127 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c | |||
@@ -395,8 +395,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te) | |||
395 | if (NULL != te->proc) | 395 | if (NULL != te->proc) |
396 | te->proc (te->cls, mychk, te->publish_offset, te->current_depth, | 396 | te->proc (te->cls, mychk, te->publish_offset, te->current_depth, |
397 | (0 == | 397 | (0 == |
398 | te-> | 398 | te->current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : |
399 | current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : | ||
400 | GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size); | 399 | GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size); |
401 | if (NULL != te->progress) | 400 | if (NULL != te->progress) |
402 | te->progress (te->cls, te->publish_offset, pt_block, pt_size, | 401 | te->progress (te->cls, te->publish_offset, pt_block, pt_size, |
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index 532c9e9aa..b39a47cd3 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h | |||
@@ -40,7 +40,8 @@ | |||
40 | * @param flen file length for which to compute the depth | 40 | * @param flen file length for which to compute the depth |
41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. | 41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. |
42 | */ | 42 | */ |
43 | unsigned int GNUNET_FS_compute_depth (uint64_t flen); | 43 | unsigned int |
44 | GNUNET_FS_compute_depth (uint64_t flen); | ||
44 | 45 | ||
45 | 46 | ||
46 | /** | 47 | /** |
@@ -52,7 +53,8 @@ unsigned int GNUNET_FS_compute_depth (uint64_t flen); | |||
52 | * @param depth depth of the block. depth==0 is a DBLOCK. | 53 | * @param depth depth of the block. depth==0 is a DBLOCK. |
53 | * @return number of bytes of payload a subtree of this depth may correspond to | 54 | * @return number of bytes of payload a subtree of this depth may correspond to |
54 | */ | 55 | */ |
55 | uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | 56 | uint64_t |
57 | GNUNET_FS_tree_compute_tree_size (unsigned int depth); | ||
56 | 58 | ||
57 | 59 | ||
58 | /** | 60 | /** |
@@ -66,8 +68,9 @@ uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | |||
66 | * @param depth depth of the node in the tree, 0 for DBLOCK | 68 | * @param depth depth of the node in the tree, 0 for DBLOCK |
67 | * @return number of bytes stored in this node | 69 | * @return number of bytes stored in this node |
68 | */ | 70 | */ |
69 | size_t GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, | 71 | size_t |
70 | unsigned int depth); | 72 | GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, |
73 | unsigned int depth); | ||
71 | 74 | ||
72 | 75 | ||
73 | /** | 76 | /** |
@@ -134,18 +137,12 @@ typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, uint64_t offset, | |||
134 | * @param cont function to call when done | 137 | * @param cont function to call when done |
135 | * @return tree encoder context | 138 | * @return tree encoder context |
136 | */ | 139 | */ |
137 | struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | 140 | struct GNUNET_FS_TreeEncoder * |
138 | GNUNET_FS_Handle | 141 | GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, |
139 | *h, uint64_t size, | 142 | void *cls, GNUNET_FS_DataReader reader, |
140 | void *cls, | 143 | GNUNET_FS_TreeBlockProcessor proc, |
141 | GNUNET_FS_DataReader | 144 | GNUNET_FS_TreeProgressCallback progress, |
142 | reader, | 145 | GNUNET_SCHEDULER_Task cont); |
143 | GNUNET_FS_TreeBlockProcessor | ||
144 | proc, | ||
145 | GNUNET_FS_TreeProgressCallback | ||
146 | progress, | ||
147 | GNUNET_SCHEDULER_Task | ||
148 | cont); | ||
149 | 146 | ||
150 | 147 | ||
151 | /** | 148 | /** |
@@ -156,7 +153,8 @@ struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | |||
156 | * | 153 | * |
157 | * @param te tree encoder to use | 154 | * @param te tree encoder to use |
158 | */ | 155 | */ |
159 | void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | 156 | void |
157 | GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | ||
160 | 158 | ||
161 | 159 | ||
162 | /** | 160 | /** |
@@ -170,8 +168,9 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | |||
170 | * prior to completion and prior to an internal error, | 168 | * prior to completion and prior to an internal error, |
171 | * both "*uri" and "*emsg" will be set to NULL). | 169 | * both "*uri" and "*emsg" will be set to NULL). |
172 | */ | 170 | */ |
173 | void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | 171 | void |
174 | struct GNUNET_FS_Uri **uri, char **emsg); | 172 | GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, |
173 | struct GNUNET_FS_Uri **uri, char **emsg); | ||
175 | 174 | ||
176 | 175 | ||
177 | #if 0 | 176 | #if 0 |
@@ -185,8 +184,9 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | |||
185 | * @param data set to the resume data | 184 | * @param data set to the resume data |
186 | * @param size set to the size of the resume data | 185 | * @param size set to the size of the resume data |
187 | */ | 186 | */ |
188 | void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | 187 | void |
189 | *te, void **data, size_t * size); | 188 | GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, |
189 | void **data, size_t * size); | ||
190 | 190 | ||
191 | 191 | ||
192 | /** | 192 | /** |
@@ -197,8 +197,9 @@ void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | |||
197 | * @param data the resume data | 197 | * @param data the resume data |
198 | * @param size the size of the resume data | 198 | * @param size the size of the resume data |
199 | */ | 199 | */ |
200 | void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, | 200 | void |
201 | const void *data, size_t size); | 201 | GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, |
202 | const void *data, size_t size); | ||
202 | #endif | 203 | #endif |
203 | 204 | ||
204 | #endif | 205 | #endif |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 22dab4955..206a8adca 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -1834,8 +1834,8 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
1834 | GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, | 1834 | GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, |
1835 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, | 1835 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, |
1836 | (const char *) &queryhash, | 1836 | (const char *) &queryhash, |
1837 | (unsigned long long) GNUNET_ntohll (uri->data.loc.fi. | 1837 | (unsigned long long) GNUNET_ntohll (uri->data.loc. |
1838 | file_length), peerId, | 1838 | fi.file_length), peerId, |
1839 | peerSig, | 1839 | peerSig, |
1840 | (unsigned long long) uri->data.loc.expirationTime.abs_value); | 1840 | (unsigned long long) uri->data.loc.expirationTime.abs_value); |
1841 | GNUNET_free (peerSig); | 1841 | GNUNET_free (peerSig); |
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 9f18cb99c..748a8f09c 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -106,8 +106,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); | 106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); |
107 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * | 107 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * |
108 | 1000LL / | 108 | 1000LL / |
109 | (info->value.download.duration. | 109 | (info->value.download. |
110 | rel_value + 1)); | 110 | duration.rel_value + 1)); |
111 | fprintf (stdout, | 111 | fprintf (stdout, |
112 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), | 112 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), |
113 | info->value.download.filename, | 113 | info->value.download.filename, |
@@ -124,8 +124,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
124 | break; | 124 | break; |
125 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 125 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
126 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / | 126 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / |
127 | (info->value.download.duration. | 127 | (info->value.download. |
128 | rel_value + 1)); | 128 | duration.rel_value + 1)); |
129 | fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), | 129 | fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), |
130 | info->value.download.filename, s); | 130 | info->value.download.filename, s); |
131 | GNUNET_free (s); | 131 | GNUNET_free (s); |
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index a67886f7d..7edad6979 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c | |||
@@ -133,8 +133,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
133 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 133 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
134 | fprintf (stdout, _("Publishing `%s' done.\n"), | 134 | fprintf (stdout, _("Publishing `%s' done.\n"), |
135 | info->value.publish.filename); | 135 | info->value.publish.filename); |
136 | s = GNUNET_FS_uri_to_string (info->value.publish.specifics.completed. | 136 | s = GNUNET_FS_uri_to_string (info->value.publish.specifics. |
137 | chk_uri); | 137 | completed.chk_uri); |
138 | fprintf (stdout, _("URI is `%s'.\n"), s); | 138 | fprintf (stdout, _("URI is `%s'.\n"), s); |
139 | GNUNET_free (s); | 139 | GNUNET_free (s); |
140 | if (info->value.publish.pctx == NULL) | 140 | if (info->value.publish.pctx == NULL) |
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index c82a0794c..eb5345833 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -150,8 +150,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
150 | uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); | 150 | uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); |
151 | printf ("#%u:\n", cnt++); | 151 | printf ("#%u:\n", cnt++); |
152 | filename = | 152 | filename = |
153 | GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.specifics. | 153 | GNUNET_CONTAINER_meta_data_get_by_type (info->value.search. |
154 | result.meta, | 154 | specifics.result.meta, |
155 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); | 155 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); |
156 | if (filename != NULL) | 156 | if (filename != NULL) |
157 | { | 157 | { |
@@ -162,8 +162,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
162 | else | 162 | else |
163 | printf ("gnunet-download %s\n", uri); | 163 | printf ("gnunet-download %s\n", uri); |
164 | if (verbose) | 164 | if (verbose) |
165 | GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics.result. | 165 | GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics. |
166 | meta, &item_printer, NULL); | 166 | result.meta, &item_printer, NULL); |
167 | printf ("\n"); | 167 | printf ("\n"); |
168 | fflush (stdout); | 168 | fflush (stdout); |
169 | GNUNET_free_non_null (filename); | 169 | GNUNET_free_non_null (filename); |
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index 56604185f..bee814318 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -167,7 +167,8 @@ extern int GSF_enable_randomized_delays; | |||
167 | * GNUNET_NO to process normally (load normal) | 167 | * GNUNET_NO to process normally (load normal) |
168 | * GNUNET_SYSERR to process for free (load low) | 168 | * GNUNET_SYSERR to process for free (load low) |
169 | */ | 169 | */ |
170 | int GSF_test_get_load_too_high_ (uint32_t priority); | 170 | int |
171 | GSF_test_get_load_too_high_ (uint32_t priority); | ||
171 | 172 | ||
172 | 173 | ||
173 | /** | 174 | /** |
@@ -176,7 +177,8 @@ int GSF_test_get_load_too_high_ (uint32_t priority); | |||
176 | * | 177 | * |
177 | * @param start time when the datastore request was issued | 178 | * @param start time when the datastore request was issued |
178 | */ | 179 | */ |
179 | void GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); | 180 | void |
181 | GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); | ||
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 1e93a475e..96d906c5b 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -383,7 +383,8 @@ GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp) | |||
383 | * @param buf where to copy the message | 383 | * @param buf where to copy the message |
384 | * @return number of bytes copied to buf | 384 | * @return number of bytes copied to buf |
385 | */ | 385 | */ |
386 | static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); | 386 | static size_t |
387 | peer_transmit_ready_cb (void *cls, size_t size, void *buf); | ||
387 | 388 | ||
388 | 389 | ||
389 | 390 | ||
@@ -400,12 +401,11 @@ static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); | |||
400 | * long should the client wait until re-trying? | 401 | * long should the client wait until re-trying? |
401 | * @param preference current traffic preference for the given peer | 402 | * @param preference current traffic preference for the given peer |
402 | */ | 403 | */ |
403 | static void core_reserve_callback (void *cls, | 404 | static void |
404 | const struct GNUNET_PeerIdentity *peer, | 405 | core_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer, |
405 | struct GNUNET_BANDWIDTH_Value32NBO | 406 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
406 | bandwidth_out, int32_t amount, | 407 | int32_t amount, struct GNUNET_TIME_Relative res_delay, |
407 | struct GNUNET_TIME_Relative res_delay, | 408 | uint64_t preference); |
408 | uint64_t preference); | ||
409 | 409 | ||
410 | 410 | ||
411 | /** | 411 | /** |
@@ -491,9 +491,8 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf) | |||
491 | GNUNET_assert (0 < cp->ppd.pending_replies--); | 491 | GNUNET_assert (0 < cp->ppd.pending_replies--); |
492 | } | 492 | } |
493 | GNUNET_LOAD_update (cp->ppd.transmission_delay, | 493 | GNUNET_LOAD_update (cp->ppd.transmission_delay, |
494 | GNUNET_TIME_absolute_get_duration (pth-> | 494 | GNUNET_TIME_absolute_get_duration |
495 | transmission_request_start_time). | 495 | (pth->transmission_request_start_time).rel_value); |
496 | rel_value); | ||
497 | ret = pth->gmc (pth->gmc_cls, size, buf); | 496 | ret = pth->gmc (pth->gmc_cls, size, buf); |
498 | GNUNET_assert (NULL == pth->cth); | 497 | GNUNET_assert (NULL == pth->cth); |
499 | for (pos = cp->pth_head; pos != NULL; pos = pos->next) | 498 | for (pos = cp->pth_head; pos != NULL; pos = pos->next) |
@@ -1732,9 +1731,9 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
1732 | #if DEBUG_FS && 0 | 1731 | #if DEBUG_FS && 0 |
1733 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1732 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1734 | "Migration already blocked for another %llu ms\n", | 1733 | "Migration already blocked for another %llu ms\n", |
1735 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp-> | 1734 | (unsigned long long) |
1736 | last_migration_block). | 1735 | GNUNET_TIME_absolute_get_remaining |
1737 | rel_value); | 1736 | (cp->last_migration_block).rel_value); |
1738 | #endif | 1737 | #endif |
1739 | return; /* already blocked */ | 1738 | return; /* already blocked */ |
1740 | } | 1739 | } |
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 84165d8b7..3f25363f1 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h | |||
@@ -170,11 +170,9 @@ struct GSF_PeerTransmitHandle; | |||
170 | * @param atsi performance data for the connection | 170 | * @param atsi performance data for the connection |
171 | * @return handle to connected peer entry | 171 | * @return handle to connected peer entry |
172 | */ | 172 | */ |
173 | struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct | 173 | struct GSF_ConnectedPeer * |
174 | GNUNET_PeerIdentity *peer, | 174 | GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, |
175 | const struct | 175 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
176 | GNUNET_TRANSPORT_ATS_Information | ||
177 | *atsi); | ||
178 | 176 | ||
179 | 177 | ||
180 | /** | 178 | /** |
@@ -183,8 +181,8 @@ struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct | |||
183 | * @param peer peer's identity | 181 | * @param peer peer's identity |
184 | * @return NULL if this peer is not currently connected | 182 | * @return NULL if this peer is not currently connected |
185 | */ | 183 | */ |
186 | struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity | 184 | struct GSF_ConnectedPeer * |
187 | *peer); | 185 | GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); |
188 | 186 | ||
189 | 187 | ||
190 | /** | 188 | /** |
@@ -201,13 +199,10 @@ struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity | |||
201 | * @param gmc_cls closure for gmc | 199 | * @param gmc_cls closure for gmc |
202 | * @return handle to cancel request | 200 | * @return handle to cancel request |
203 | */ | 201 | */ |
204 | struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | 202 | struct GSF_PeerTransmitHandle * |
205 | int is_query, | 203 | GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, int is_query, |
206 | uint32_t priority, | 204 | uint32_t priority, struct GNUNET_TIME_Relative timeout, |
207 | struct GNUNET_TIME_Relative | 205 | size_t size, GSF_GetMessageCallback gmc, void *gmc_cls); |
208 | timeout, size_t size, | ||
209 | GSF_GetMessageCallback gmc, | ||
210 | void *gmc_cls); | ||
211 | 206 | ||
212 | 207 | ||
213 | /** | 208 | /** |
@@ -215,7 +210,8 @@ struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | |||
215 | * | 210 | * |
216 | * @param pth request to cancel | 211 | * @param pth request to cancel |
217 | */ | 212 | */ |
218 | void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | 213 | void |
214 | GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | ||
219 | 215 | ||
220 | 216 | ||
221 | /** | 217 | /** |
@@ -225,9 +221,10 @@ void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | |||
225 | * @param request_time time at which the original query was transmitted | 221 | * @param request_time time at which the original query was transmitted |
226 | * @param request_priority priority of the original request | 222 | * @param request_priority priority of the original request |
227 | */ | 223 | */ |
228 | void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | 224 | void |
229 | struct GNUNET_TIME_Absolute request_time, | 225 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, |
230 | uint32_t request_priority); | 226 | struct GNUNET_TIME_Absolute request_time, |
227 | uint32_t request_priority); | ||
231 | 228 | ||
232 | 229 | ||
233 | /** | 230 | /** |
@@ -237,9 +234,9 @@ void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | |||
237 | * @param cp responding peer (will be updated) | 234 | * @param cp responding peer (will be updated) |
238 | * @param initiator_client local client on responsible for query | 235 | * @param initiator_client local client on responsible for query |
239 | */ | 236 | */ |
240 | void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | 237 | void |
241 | struct GSF_LocalClient | 238 | GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, |
242 | *initiator_client); | 239 | struct GSF_LocalClient *initiator_client); |
243 | 240 | ||
244 | 241 | ||
245 | /** | 242 | /** |
@@ -249,9 +246,10 @@ void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | |||
249 | * @param cp responding peer (will be updated) | 246 | * @param cp responding peer (will be updated) |
250 | * @param initiator_peer other peer responsible for query | 247 | * @param initiator_peer other peer responsible for query |
251 | */ | 248 | */ |
252 | void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | 249 | void |
253 | const struct GSF_ConnectedPeer | 250 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, |
254 | *initiator_peer); | 251 | const struct GSF_ConnectedPeer |
252 | *initiator_peer); | ||
255 | 253 | ||
256 | 254 | ||
257 | /** | 255 | /** |
@@ -265,13 +263,12 @@ void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | |||
265 | * unless we see some further activity from it | 263 | * unless we see some further activity from it |
266 | * @param atsi status information | 264 | * @param atsi status information |
267 | */ | 265 | */ |
268 | void GSF_peer_status_handler_ (void *cls, | 266 | void |
269 | const struct GNUNET_PeerIdentity *peer, | 267 | GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer, |
270 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 268 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
271 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 269 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
272 | struct GNUNET_TIME_Absolute timeout, | 270 | struct GNUNET_TIME_Absolute timeout, |
273 | const struct GNUNET_TRANSPORT_ATS_Information | 271 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
274 | *atsi); | ||
275 | 272 | ||
276 | 273 | ||
277 | /** | 274 | /** |
@@ -285,11 +282,12 @@ void GSF_peer_status_handler_ (void *cls, | |||
285 | * @return GNUNET_OK to keep the connection open, | 282 | * @return GNUNET_OK to keep the connection open, |
286 | * GNUNET_SYSERR to close it (signal serious error) | 283 | * GNUNET_SYSERR to close it (signal serious error) |
287 | */ | 284 | */ |
288 | int GSF_handle_p2p_migration_stop_ (void *cls, | 285 | int |
289 | const struct GNUNET_PeerIdentity *other, | 286 | GSF_handle_p2p_migration_stop_ (void *cls, |
290 | const struct GNUNET_MessageHeader *message, | 287 | const struct GNUNET_PeerIdentity *other, |
291 | const struct | 288 | const struct GNUNET_MessageHeader *message, |
292 | GNUNET_TRANSPORT_ATS_Information *atsi); | 289 | const struct GNUNET_TRANSPORT_ATS_Information |
290 | *atsi); | ||
293 | 291 | ||
294 | 292 | ||
295 | /** | 293 | /** |
@@ -303,11 +301,9 @@ int GSF_handle_p2p_migration_stop_ (void *cls, | |||
303 | * @param message the actual message | 301 | * @param message the actual message |
304 | * @return pending request handle, NULL on error | 302 | * @return pending request handle, NULL on error |
305 | */ | 303 | */ |
306 | struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct | 304 | struct GSF_PendingRequest * |
307 | GNUNET_PeerIdentity *other, | 305 | GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, |
308 | const struct | 306 | const struct GNUNET_MessageHeader *message); |
309 | GNUNET_MessageHeader | ||
310 | *message); | ||
311 | 307 | ||
312 | 308 | ||
313 | /** | 309 | /** |
@@ -316,9 +312,8 @@ struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct | |||
316 | * @param cp peer to query | 312 | * @param cp peer to query |
317 | * @return performance data record for the peer | 313 | * @return performance data record for the peer |
318 | */ | 314 | */ |
319 | struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct | 315 | struct GSF_PeerPerformanceData * |
320 | GSF_ConnectedPeer | 316 | GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); |
321 | *cp); | ||
322 | 317 | ||
323 | 318 | ||
324 | /** | 319 | /** |
@@ -328,8 +323,9 @@ struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct | |||
328 | * @param cp peer to ask | 323 | * @param cp peer to ask |
329 | * @param block_time until when to block | 324 | * @param block_time until when to block |
330 | */ | 325 | */ |
331 | void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | 326 | void |
332 | struct GNUNET_TIME_Relative block_time); | 327 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, |
328 | struct GNUNET_TIME_Relative block_time); | ||
333 | 329 | ||
334 | 330 | ||
335 | /** | 331 | /** |
@@ -339,8 +335,9 @@ void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
339 | * @param cls unused | 335 | * @param cls unused |
340 | * @param peer identity of peer that connected | 336 | * @param peer identity of peer that connected |
341 | */ | 337 | */ |
342 | void GSF_peer_disconnect_handler_ (void *cls, | 338 | void |
343 | const struct GNUNET_PeerIdentity *peer); | 339 | GSF_peer_disconnect_handler_ (void *cls, |
340 | const struct GNUNET_PeerIdentity *peer); | ||
344 | 341 | ||
345 | 342 | ||
346 | /** | 343 | /** |
@@ -349,7 +346,8 @@ void GSF_peer_disconnect_handler_ (void *cls, | |||
349 | * | 346 | * |
350 | * @param lc handle to the local client (henceforth invalid) | 347 | * @param lc handle to the local client (henceforth invalid) |
351 | */ | 348 | */ |
352 | void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | 349 | void |
350 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | ||
353 | 351 | ||
354 | 352 | ||
355 | /** | 353 | /** |
@@ -361,8 +359,9 @@ void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | |||
361 | * @param cp peer to reserve bandwidth from | 359 | * @param cp peer to reserve bandwidth from |
362 | * @param pref preference change | 360 | * @param pref preference change |
363 | */ | 361 | */ |
364 | void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | 362 | void |
365 | uint64_t pref); | 363 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, |
364 | uint64_t pref); | ||
366 | 365 | ||
367 | 366 | ||
368 | /** | 367 | /** |
@@ -371,8 +370,9 @@ void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | |||
371 | * @param cp peer to reserve bandwidth from | 370 | * @param cp peer to reserve bandwidth from |
372 | * @param id identity to set (written to) | 371 | * @param id identity to set (written to) |
373 | */ | 372 | */ |
374 | void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | 373 | void |
375 | struct GNUNET_PeerIdentity *id); | 374 | GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, |
375 | struct GNUNET_PeerIdentity *id); | ||
376 | 376 | ||
377 | 377 | ||
378 | /** | 378 | /** |
@@ -381,19 +381,22 @@ void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | |||
381 | * @param it function to call for each peer | 381 | * @param it function to call for each peer |
382 | * @param it_cls closure for it | 382 | * @param it_cls closure for it |
383 | */ | 383 | */ |
384 | void GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); | 384 | void |
385 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); | ||
385 | 386 | ||
386 | 387 | ||
387 | /** | 388 | /** |
388 | * Initialize peer management subsystem. | 389 | * Initialize peer management subsystem. |
389 | */ | 390 | */ |
390 | void GSF_connected_peer_init_ (void); | 391 | void |
392 | GSF_connected_peer_init_ (void); | ||
391 | 393 | ||
392 | 394 | ||
393 | /** | 395 | /** |
394 | * Shutdown peer management subsystem. | 396 | * Shutdown peer management subsystem. |
395 | */ | 397 | */ |
396 | void GSF_connected_peer_done_ (void); | 398 | void |
399 | GSF_connected_peer_done_ (void); | ||
397 | 400 | ||
398 | 401 | ||
399 | #endif | 402 | #endif |
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index c7bff3a9d..ab3f77abe 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -228,8 +228,7 @@ signal_index_ok (struct IndexInfo *ii) | |||
228 | ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), | 228 | ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), |
229 | ii->filename, | 229 | ii->filename, |
230 | (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, | 230 | (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, |
231 | &ii-> | 231 | &ii->file_id)); |
232 | file_id)); | ||
233 | GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, | 232 | GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, |
234 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); | 233 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); |
235 | GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); | 234 | GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); |
@@ -447,8 +446,8 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | |||
447 | prev->next = next; | 446 | prev->next = next; |
448 | GNUNET_break (GNUNET_OK == | 447 | GNUNET_break (GNUNET_OK == |
449 | GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id, | 448 | GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id, |
450 | (void *) pos-> | 449 | (void *) |
451 | filename)); | 450 | pos->filename)); |
452 | GNUNET_free (pos); | 451 | GNUNET_free (pos); |
453 | found = GNUNET_YES; | 452 | found = GNUNET_YES; |
454 | } | 453 | } |
diff --git a/src/fs/gnunet-service-fs_indexing.h b/src/fs/gnunet-service-fs_indexing.h index a5c8f6593..4295b2011 100644 --- a/src/fs/gnunet-service-fs_indexing.h +++ b/src/fs/gnunet-service-fs_indexing.h | |||
@@ -54,14 +54,14 @@ | |||
54 | * @param cont_cls closure for cont | 54 | * @param cont_cls closure for cont |
55 | * @return GNUNET_OK on success | 55 | * @return GNUNET_OK on success |
56 | */ | 56 | */ |
57 | int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | 57 | int |
58 | uint32_t size, const void *data, | 58 | GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size, |
59 | enum GNUNET_BLOCK_Type type, | 59 | const void *data, enum GNUNET_BLOCK_Type type, |
60 | uint32_t priority, uint32_t anonymity, | 60 | uint32_t priority, uint32_t anonymity, |
61 | struct GNUNET_TIME_Absolute expiration, | 61 | struct GNUNET_TIME_Absolute expiration, |
62 | uint64_t uid, | 62 | uint64_t uid, |
63 | GNUNET_DATASTORE_DatumProcessor cont, | 63 | GNUNET_DATASTORE_DatumProcessor cont, |
64 | void *cont_cls); | 64 | void *cont_cls); |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Handle INDEX_START-message. | 67 | * Handle INDEX_START-message. |
@@ -70,9 +70,9 @@ int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | |||
70 | * @param client identification of the client | 70 | * @param client identification of the client |
71 | * @param message the actual message | 71 | * @param message the actual message |
72 | */ | 72 | */ |
73 | void GNUNET_FS_handle_index_start (void *cls, | 73 | void |
74 | struct GNUNET_SERVER_Client *client, | 74 | GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client, |
75 | const struct GNUNET_MessageHeader *message); | 75 | const struct GNUNET_MessageHeader *message); |
76 | 76 | ||
77 | 77 | ||
78 | /** | 78 | /** |
@@ -82,10 +82,9 @@ void GNUNET_FS_handle_index_start (void *cls, | |||
82 | * @param client identification of the client | 82 | * @param client identification of the client |
83 | * @param message the actual message | 83 | * @param message the actual message |
84 | */ | 84 | */ |
85 | void GNUNET_FS_handle_index_list_get (void *cls, | 85 | void |
86 | struct GNUNET_SERVER_Client *client, | 86 | GNUNET_FS_handle_index_list_get (void *cls, struct GNUNET_SERVER_Client *client, |
87 | const struct GNUNET_MessageHeader | 87 | const struct GNUNET_MessageHeader *message); |
88 | *message); | ||
89 | 88 | ||
90 | 89 | ||
91 | /** | 90 | /** |
@@ -95,8 +94,9 @@ void GNUNET_FS_handle_index_list_get (void *cls, | |||
95 | * @param client identification of the client | 94 | * @param client identification of the client |
96 | * @param message the actual message | 95 | * @param message the actual message |
97 | */ | 96 | */ |
98 | void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | 97 | void |
99 | const struct GNUNET_MessageHeader *message); | 98 | GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, |
99 | const struct GNUNET_MessageHeader *message); | ||
100 | 100 | ||
101 | 101 | ||
102 | /** | 102 | /** |
@@ -106,14 +106,16 @@ void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | |||
106 | * @param d datastore to use | 106 | * @param d datastore to use |
107 | * @return GNUNET_OK on success | 107 | * @return GNUNET_OK on success |
108 | */ | 108 | */ |
109 | int GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, | 109 | int |
110 | struct GNUNET_DATASTORE_Handle *d); | 110 | GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, |
111 | struct GNUNET_DATASTORE_Handle *d); | ||
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
114 | * Shutdown the module. | 115 | * Shutdown the module. |
115 | */ | 116 | */ |
116 | void GNUNET_FS_indexing_done (void); | 117 | void |
118 | GNUNET_FS_indexing_done (void); | ||
117 | 119 | ||
118 | 120 | ||
119 | #endif | 121 | #endif |
diff --git a/src/fs/gnunet-service-fs_lc.h b/src/fs/gnunet-service-fs_lc.h index 6b79690f1..c625edf0b 100644 --- a/src/fs/gnunet-service-fs_lc.h +++ b/src/fs/gnunet-service-fs_lc.h | |||
@@ -36,8 +36,8 @@ | |||
36 | * @param client handle of the client | 36 | * @param client handle of the client |
37 | * @return handle to local client entry | 37 | * @return handle to local client entry |
38 | */ | 38 | */ |
39 | struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client | 39 | struct GSF_LocalClient * |
40 | *client); | 40 | GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client); |
41 | 41 | ||
42 | 42 | ||
43 | /** | 43 | /** |
@@ -50,12 +50,10 @@ struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client | |||
50 | * @param message the actual message | 50 | * @param message the actual message |
51 | * @return pending request handle for the request, NULL on error | 51 | * @return pending request handle for the request, NULL on error |
52 | */ | 52 | */ |
53 | struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct | 53 | struct GSF_PendingRequest * |
54 | GNUNET_SERVER_Client | 54 | GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, |
55 | *client, | 55 | const struct GNUNET_MessageHeader |
56 | const struct | 56 | *message); |
57 | GNUNET_MessageHeader | ||
58 | *message); | ||
59 | 57 | ||
60 | 58 | ||
61 | /** | 59 | /** |
@@ -66,8 +64,9 @@ struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct | |||
66 | * @param lc recipient | 64 | * @param lc recipient |
67 | * @param msg message to transmit to client | 65 | * @param msg message to transmit to client |
68 | */ | 66 | */ |
69 | void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, | 67 | void |
70 | const struct GNUNET_MessageHeader *msg); | 68 | GSF_local_client_transmit_ (struct GSF_LocalClient *lc, |
69 | const struct GNUNET_MessageHeader *msg); | ||
71 | 70 | ||
72 | 71 | ||
73 | /** | 72 | /** |
@@ -76,8 +75,8 @@ void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, | |||
76 | * @param cls unused | 75 | * @param cls unused |
77 | * @param client handle of the client | 76 | * @param client handle of the client |
78 | */ | 77 | */ |
79 | void GSF_client_disconnect_handler_ (void *cls, | 78 | void |
80 | struct GNUNET_SERVER_Client *client); | 79 | GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client); |
81 | 80 | ||
82 | 81 | ||
83 | #endif | 82 | #endif |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 58fb11cee..d1a8a1163 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -207,9 +207,9 @@ static unsigned long long plan_count; | |||
207 | * @param cls the 'struct GSF_ConnectedPeer' for transmission | 207 | * @param cls the 'struct GSF_ConnectedPeer' for transmission |
208 | * @param tc scheduler context | 208 | * @param tc scheduler context |
209 | */ | 209 | */ |
210 | static void schedule_peer_transmission (void *cls, | 210 | static void |
211 | const struct | 211 | schedule_peer_transmission (void *cls, |
212 | GNUNET_SCHEDULER_TaskContext *tc); | 212 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
213 | 213 | ||
214 | 214 | ||
215 | /** | 215 | /** |
@@ -243,8 +243,8 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) | |||
243 | #endif | 243 | #endif |
244 | 244 | ||
245 | GNUNET_assert (rp->hn == NULL); | 245 | GNUNET_assert (rp->hn == NULL); |
246 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). | 246 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value |
247 | rel_value == 0) | 247 | == 0) |
248 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 248 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
249 | else | 249 | else |
250 | rp->hn = | 250 | rp->hn = |
@@ -359,8 +359,8 @@ schedule_peer_transmission (void *cls, | |||
359 | } | 359 | } |
360 | /* move ready requests to priority queue */ | 360 | /* move ready requests to priority queue */ |
361 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && | 361 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && |
362 | (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). | 362 | (GNUNET_TIME_absolute_get_remaining |
363 | rel_value == 0)) | 363 | (rp->earliest_transmission).rel_value == 0)) |
364 | { | 364 | { |
365 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); | 365 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); |
366 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 366 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
@@ -380,9 +380,9 @@ schedule_peer_transmission (void *cls, | |||
380 | #if DEBUG_FS | 380 | #if DEBUG_FS |
381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
382 | "Sleeping for %llu ms before retrying requests on plan %p.\n", | 382 | "Sleeping for %llu ms before retrying requests on plan %p.\n", |
383 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (rp-> | 383 | (unsigned long long) |
384 | earliest_transmission). | 384 | GNUNET_TIME_absolute_get_remaining |
385 | rel_value, pp); | 385 | (rp->earliest_transmission).rel_value, pp); |
386 | #endif | 386 | #endif |
387 | pp->task = | 387 | pp->task = |
388 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 388 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h index cfaeabe22..23787908e 100644 --- a/src/fs/gnunet-service-fs_pe.h +++ b/src/fs/gnunet-service-fs_pe.h | |||
@@ -35,8 +35,8 @@ | |||
35 | * @param cp peer with the entry | 35 | * @param cp peer with the entry |
36 | * @param pr request with the entry | 36 | * @param pr request with the entry |
37 | */ | 37 | */ |
38 | void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | 38 | void |
39 | struct GSF_PendingRequest *pr); | 39 | GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr); |
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
@@ -45,7 +45,8 @@ void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | |||
45 | * | 45 | * |
46 | * @param cp connected peer | 46 | * @param cp connected peer |
47 | */ | 47 | */ |
48 | void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | 48 | void |
49 | GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | ||
49 | 50 | ||
50 | 51 | ||
51 | /** | 52 | /** |
@@ -54,19 +55,22 @@ void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | |||
54 | * | 55 | * |
55 | * @param pr request that is done | 56 | * @param pr request that is done |
56 | */ | 57 | */ |
57 | void GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); | 58 | void |
59 | GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); | ||
58 | 60 | ||
59 | 61 | ||
60 | /** | 62 | /** |
61 | * Initialize plan subsystem. | 63 | * Initialize plan subsystem. |
62 | */ | 64 | */ |
63 | void GSF_plan_init (void); | 65 | void |
66 | GSF_plan_init (void); | ||
64 | 67 | ||
65 | 68 | ||
66 | /** | 69 | /** |
67 | * Shutdown plan subsystem. | 70 | * Shutdown plan subsystem. |
68 | */ | 71 | */ |
69 | void GSF_plan_done (void); | 72 | void |
73 | GSF_plan_done (void); | ||
70 | 74 | ||
71 | 75 | ||
72 | #endif | 76 | #endif |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 7b6290bbb..e5cb1f03c 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -817,9 +817,8 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
817 | /* short cut: stop processing early, no BF-update, etc. */ | 817 | /* short cut: stop processing early, no BF-update, etc. */ |
818 | update_request_performance_data (prq, pr); | 818 | update_request_performance_data (prq, pr); |
819 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, | 819 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, |
820 | GNUNET_TIME_absolute_get_duration (pr->public_data. | 820 | GNUNET_TIME_absolute_get_duration (pr-> |
821 | start_time). | 821 | public_data.start_time).rel_value); |
822 | rel_value); | ||
823 | /* pass on to other peers / local clients */ | 822 | /* pass on to other peers / local clients */ |
824 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, | 823 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, |
825 | prq->type, prq->data, prq->size); | 824 | prq->type, prq->data, prq->size); |
@@ -1101,9 +1100,8 @@ warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1101 | 1100 | ||
1102 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1101 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1103 | _("Datastore lookup already took %llu ms!\n"), | 1102 | _("Datastore lookup already took %llu ms!\n"), |
1104 | (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> | 1103 | (unsigned long long) |
1105 | qe_start). | 1104 | GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); |
1106 | rel_value); | ||
1107 | pr->warn_task = | 1105 | pr->warn_task = |
1108 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, | 1106 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, |
1109 | pr); | 1107 | pr); |
@@ -1123,9 +1121,8 @@ odc_warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1123 | 1121 | ||
1124 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1122 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1125 | _("On-demand lookup already took %llu ms!\n"), | 1123 | _("On-demand lookup already took %llu ms!\n"), |
1126 | (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> | 1124 | (unsigned long long) |
1127 | qe_start). | 1125 | GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); |
1128 | rel_value); | ||
1129 | pr->warn_task = | 1126 | pr->warn_task = |
1130 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, | 1127 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, |
1131 | &odc_warn_delay_task, pr); | 1128 | &odc_warn_delay_task, pr); |
@@ -1257,12 +1254,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1257 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1254 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1258 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1255 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1259 | (0 != | 1256 | (0 != |
1260 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1257 | (GSF_PRO_PRIORITY_UNLIMITED & |
1261 | public_data.options)) ? UINT_MAX : 1 | 1258 | pr->public_data.options)) ? UINT_MAX : 1 |
1262 | /* queue priority */ , | 1259 | /* queue priority */ , |
1263 | (0 != | 1260 | (0 != |
1264 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1261 | (GSF_PRO_PRIORITY_UNLIMITED & |
1265 | public_data.options)) ? UINT_MAX : 1 | 1262 | pr->public_data.options)) ? UINT_MAX : 1 |
1266 | /* max queue size */ , | 1263 | /* max queue size */ , |
1267 | GNUNET_TIME_UNIT_FOREVER_REL, | 1264 | GNUNET_TIME_UNIT_FOREVER_REL, |
1268 | &process_local_reply, pr); | 1265 | &process_local_reply, pr); |
@@ -1298,12 +1295,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1298 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1295 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1299 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1296 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1300 | (0 != | 1297 | (0 != |
1301 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1298 | (GSF_PRO_PRIORITY_UNLIMITED & |
1302 | public_data.options)) ? UINT_MAX : 1 | 1299 | pr->public_data.options)) ? UINT_MAX : 1 |
1303 | /* queue priority */ , | 1300 | /* queue priority */ , |
1304 | (0 != | 1301 | (0 != |
1305 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1302 | (GSF_PRO_PRIORITY_UNLIMITED & |
1306 | public_data.options)) ? UINT_MAX : 1 | 1303 | pr->public_data.options)) ? UINT_MAX : 1 |
1307 | /* max queue size */ , | 1304 | /* max queue size */ , |
1308 | GNUNET_TIME_UNIT_FOREVER_REL, | 1305 | GNUNET_TIME_UNIT_FOREVER_REL, |
1309 | &process_local_reply, pr); | 1306 | &process_local_reply, pr); |
@@ -1357,12 +1354,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1357 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1354 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1358 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1355 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1359 | (0 != | 1356 | (0 != |
1360 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1357 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1361 | options)) ? UINT_MAX : 1 | 1358 | public_data.options)) ? UINT_MAX : 1 |
1362 | /* queue priority */ , | 1359 | /* queue priority */ , |
1363 | (0 != | 1360 | (0 != |
1364 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1361 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1365 | options)) ? UINT_MAX : 1 | 1362 | public_data.options)) ? UINT_MAX : 1 |
1366 | /* max queue size */ , | 1363 | /* max queue size */ , |
1367 | GNUNET_TIME_UNIT_FOREVER_REL, | 1364 | GNUNET_TIME_UNIT_FOREVER_REL, |
1368 | &process_local_reply, pr); | 1365 | &process_local_reply, pr); |
@@ -1413,12 +1410,12 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
1413 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1410 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1414 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1411 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1415 | (0 != | 1412 | (0 != |
1416 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1413 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1417 | options)) ? UINT_MAX : 1 | 1414 | public_data.options)) ? UINT_MAX : 1 |
1418 | /* queue priority */ , | 1415 | /* queue priority */ , |
1419 | (0 != | 1416 | (0 != |
1420 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1417 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1421 | options)) ? UINT_MAX : 1 | 1418 | public_data.options)) ? UINT_MAX : 1 |
1422 | /* max queue size */ , | 1419 | /* max queue size */ , |
1423 | GNUNET_TIME_UNIT_FOREVER_REL, | 1420 | GNUNET_TIME_UNIT_FOREVER_REL, |
1424 | &process_local_reply, pr); | 1421 | &process_local_reply, pr); |
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index f2e7bcf62..b68989be7 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -201,33 +201,19 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls, | |||
201 | * @param rh_cls closure for rh | 201 | * @param rh_cls closure for rh |
202 | * @return handle for the new pending request | 202 | * @return handle for the new pending request |
203 | */ | 203 | */ |
204 | struct GSF_PendingRequest *GSF_pending_request_create_ (enum | 204 | struct GSF_PendingRequest * |
205 | GSF_PendingRequestOptions | 205 | GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, |
206 | options, | 206 | enum GNUNET_BLOCK_Type type, |
207 | enum GNUNET_BLOCK_Type | 207 | const GNUNET_HashCode * query, |
208 | type, | 208 | const GNUNET_HashCode * namespace, |
209 | const GNUNET_HashCode * | 209 | const struct GNUNET_PeerIdentity *target, |
210 | query, | 210 | const char *bf_data, size_t bf_size, |
211 | const GNUNET_HashCode * | 211 | uint32_t mingle, uint32_t anonymity_level, |
212 | namespace, | 212 | uint32_t priority, int32_t ttl, |
213 | const struct | 213 | GNUNET_PEER_Id sender_pid, |
214 | GNUNET_PeerIdentity | 214 | const GNUNET_HashCode * replies_seen, |
215 | *target, | 215 | unsigned int replies_seen_count, |
216 | const char *bf_data, | 216 | GSF_PendingRequestReplyHandler rh, void *rh_cls); |
217 | size_t bf_size, | ||
218 | uint32_t mingle, | ||
219 | uint32_t | ||
220 | anonymity_level, | ||
221 | uint32_t priority, | ||
222 | int32_t ttl, | ||
223 | GNUNET_PEER_Id | ||
224 | sender_pid, | ||
225 | const GNUNET_HashCode * | ||
226 | replies_seen, | ||
227 | unsigned int | ||
228 | replies_seen_count, | ||
229 | GSF_PendingRequestReplyHandler | ||
230 | rh, void *rh_cls); | ||
231 | 217 | ||
232 | 218 | ||
233 | /** | 219 | /** |
@@ -238,9 +224,10 @@ struct GSF_PendingRequest *GSF_pending_request_create_ (enum | |||
238 | * @param replies_seen hash codes of replies that we've seen | 224 | * @param replies_seen hash codes of replies that we've seen |
239 | * @param replies_seen_count size of the replies_seen array | 225 | * @param replies_seen_count size of the replies_seen array |
240 | */ | 226 | */ |
241 | void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | 227 | void |
242 | const GNUNET_HashCode * replies_seen, | 228 | GSF_pending_request_update_ (struct GSF_PendingRequest *pr, |
243 | unsigned int replies_seen_count); | 229 | const GNUNET_HashCode * replies_seen, |
230 | unsigned int replies_seen_count); | ||
244 | 231 | ||
245 | 232 | ||
246 | /** | 233 | /** |
@@ -249,9 +236,8 @@ void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
249 | * @param pr pending request | 236 | * @param pr pending request |
250 | * @return associated public data | 237 | * @return associated public data |
251 | */ | 238 | */ |
252 | struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct | 239 | struct GSF_PendingRequestData * |
253 | GSF_PendingRequest | 240 | GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); |
254 | *pr); | ||
255 | 241 | ||
256 | 242 | ||
257 | /** | 243 | /** |
@@ -263,8 +249,9 @@ struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct | |||
263 | * @param pra another pending request | 249 | * @param pra another pending request |
264 | * @return GNUNET_OK if the requests are compatible | 250 | * @return GNUNET_OK if the requests are compatible |
265 | */ | 251 | */ |
266 | int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | 252 | int |
267 | struct GSF_PendingRequest *prb); | 253 | GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, |
254 | struct GSF_PendingRequest *prb); | ||
268 | 255 | ||
269 | 256 | ||
270 | /** | 257 | /** |
@@ -276,9 +263,9 @@ int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | |||
276 | * @param buf where to copy the message (can be NULL) | 263 | * @param buf where to copy the message (can be NULL) |
277 | * @return number of bytes needed (if buf_size too small) or used | 264 | * @return number of bytes needed (if buf_size too small) or used |
278 | */ | 265 | */ |
279 | size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest | 266 | size_t |
280 | *pr, size_t buf_size, | 267 | GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, |
281 | void *buf); | 268 | size_t buf_size, void *buf); |
282 | 269 | ||
283 | 270 | ||
284 | /** | 271 | /** |
@@ -287,8 +274,8 @@ size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest | |||
287 | * @param pr request to cancel | 274 | * @param pr request to cancel |
288 | * @param full_cleanup fully purge the request | 275 | * @param full_cleanup fully purge the request |
289 | */ | 276 | */ |
290 | void GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, | 277 | void |
291 | int full_cleanup); | 278 | GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup); |
292 | 279 | ||
293 | 280 | ||
294 | /** | 281 | /** |
@@ -311,7 +298,8 @@ typedef int (*GSF_PendingRequestIterator) (void *cls, | |||
311 | * @param it function to call for each request | 298 | * @param it function to call for each request |
312 | * @param cls closure for it | 299 | * @param cls closure for it |
313 | */ | 300 | */ |
314 | void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | 301 | void |
302 | GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | ||
315 | 303 | ||
316 | 304 | ||
317 | /** | 305 | /** |
@@ -327,8 +315,9 @@ void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | |||
327 | * GNUNET_SYSERR if the message was malformed (close connection, | 315 | * GNUNET_SYSERR if the message was malformed (close connection, |
328 | * do not cache under any circumstances) | 316 | * do not cache under any circumstances) |
329 | */ | 317 | */ |
330 | int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | 318 | int |
331 | const struct GNUNET_MessageHeader *message); | 319 | GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, |
320 | const struct GNUNET_MessageHeader *message); | ||
332 | 321 | ||
333 | 322 | ||
334 | /** | 323 | /** |
@@ -336,7 +325,8 @@ int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
336 | * | 325 | * |
337 | * @param pr the pending request to process | 326 | * @param pr the pending request to process |
338 | */ | 327 | */ |
339 | void GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | 328 | void |
329 | GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | ||
340 | 330 | ||
341 | 331 | ||
342 | /** | 332 | /** |
@@ -360,20 +350,23 @@ typedef void (*GSF_LocalLookupContinuation) (void *cls, | |||
360 | * @param cont function to call at the end | 350 | * @param cont function to call at the end |
361 | * @param cont_cls closure for cont | 351 | * @param cont_cls closure for cont |
362 | */ | 352 | */ |
363 | void GSF_local_lookup_ (struct GSF_PendingRequest *pr, | 353 | void |
364 | GSF_LocalLookupContinuation cont, void *cont_cls); | 354 | GSF_local_lookup_ (struct GSF_PendingRequest *pr, |
355 | GSF_LocalLookupContinuation cont, void *cont_cls); | ||
365 | 356 | ||
366 | 357 | ||
367 | /** | 358 | /** |
368 | * Setup the subsystem. | 359 | * Setup the subsystem. |
369 | */ | 360 | */ |
370 | void GSF_pending_request_init_ (void); | 361 | void |
362 | GSF_pending_request_init_ (void); | ||
371 | 363 | ||
372 | 364 | ||
373 | /** | 365 | /** |
374 | * Shutdown the subsystem. | 366 | * Shutdown the subsystem. |
375 | */ | 367 | */ |
376 | void GSF_pending_request_done_ (void); | 368 | void |
369 | GSF_pending_request_done_ (void); | ||
377 | 370 | ||
378 | 371 | ||
379 | #endif | 372 | #endif |
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 6d8c05999..fb05366af 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -191,7 +191,8 @@ delete_migration_block (struct MigrationReadyBlock *mb) | |||
191 | /** | 191 | /** |
192 | * Find content for migration to this peer. | 192 | * Find content for migration to this peer. |
193 | */ | 193 | */ |
194 | static void find_content (struct MigrationReadyPeer *mrp); | 194 | static void |
195 | find_content (struct MigrationReadyPeer *mrp); | ||
195 | 196 | ||
196 | 197 | ||
197 | /** | 198 | /** |
@@ -343,7 +344,8 @@ score_content (struct MigrationReadyPeer *peer, | |||
343 | * If the migration task is not currently running, consider | 344 | * If the migration task is not currently running, consider |
344 | * (re)scheduling it with the appropriate delay. | 345 | * (re)scheduling it with the appropriate delay. |
345 | */ | 346 | */ |
346 | static void consider_gathering (void); | 347 | static void |
348 | consider_gathering (void); | ||
347 | 349 | ||
348 | 350 | ||
349 | /** | 351 | /** |
@@ -421,9 +423,9 @@ find_content (struct MigrationReadyPeer *mrp) | |||
421 | * @param cls unused | 423 | * @param cls unused |
422 | * @param tc scheduler context (also unused) | 424 | * @param tc scheduler context (also unused) |
423 | */ | 425 | */ |
424 | static void gather_migration_blocks (void *cls, | 426 | static void |
425 | const struct GNUNET_SCHEDULER_TaskContext | 427 | gather_migration_blocks (void *cls, |
426 | *tc); | 428 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
427 | 429 | ||
428 | 430 | ||
429 | /** | 431 | /** |
diff --git a/src/fs/gnunet-service-fs_push.h b/src/fs/gnunet-service-fs_push.h index 40e1252be..7967b04cd 100644 --- a/src/fs/gnunet-service-fs_push.h +++ b/src/fs/gnunet-service-fs_push.h | |||
@@ -32,13 +32,15 @@ | |||
32 | /** | 32 | /** |
33 | * Setup the module. | 33 | * Setup the module. |
34 | */ | 34 | */ |
35 | void GSF_push_init_ (void); | 35 | void |
36 | GSF_push_init_ (void); | ||
36 | 37 | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * Shutdown the module. | 40 | * Shutdown the module. |
40 | */ | 41 | */ |
41 | void GSF_push_done_ (void); | 42 | void |
43 | GSF_push_done_ (void); | ||
42 | 44 | ||
43 | 45 | ||
44 | /** | 46 | /** |
@@ -47,7 +49,8 @@ void GSF_push_done_ (void); | |||
47 | * | 49 | * |
48 | * @param peer handle for the peer that connected | 50 | * @param peer handle for the peer that connected |
49 | */ | 51 | */ |
50 | void GSF_push_start_ (struct GSF_ConnectedPeer *peer); | 52 | void |
53 | GSF_push_start_ (struct GSF_ConnectedPeer *peer); | ||
51 | 54 | ||
52 | 55 | ||
53 | /** | 56 | /** |
@@ -56,7 +59,8 @@ void GSF_push_start_ (struct GSF_ConnectedPeer *peer); | |||
56 | * | 59 | * |
57 | * @param peer handle for the peer that disconnected | 60 | * @param peer handle for the peer that disconnected |
58 | */ | 61 | */ |
59 | void GSF_push_stop_ (struct GSF_ConnectedPeer *peer); | 62 | void |
63 | GSF_push_stop_ (struct GSF_ConnectedPeer *peer); | ||
60 | 64 | ||
61 | 65 | ||
62 | #endif | 66 | #endif |
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c index ec2344b37..4b4925d22 100644 --- a/src/fs/gnunet-service-fs_put.c +++ b/src/fs/gnunet-service-fs_put.c | |||
@@ -86,9 +86,9 @@ static struct PutOperator operators[] = { | |||
86 | * @param cls type of blocks to gather | 86 | * @param cls type of blocks to gather |
87 | * @param tc scheduler context (unused) | 87 | * @param tc scheduler context (unused) |
88 | */ | 88 | */ |
89 | static void gather_dht_put_blocks (void *cls, | 89 | static void |
90 | const struct GNUNET_SCHEDULER_TaskContext | 90 | gather_dht_put_blocks (void *cls, |
91 | *tc); | 91 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
92 | 92 | ||
93 | 93 | ||
94 | /** | 94 | /** |
diff --git a/src/fs/gnunet-service-fs_put.h b/src/fs/gnunet-service-fs_put.h index 21c3c3baf..59b1f83e3 100644 --- a/src/fs/gnunet-service-fs_put.h +++ b/src/fs/gnunet-service-fs_put.h | |||
@@ -32,13 +32,15 @@ | |||
32 | /** | 32 | /** |
33 | * Setup the module. | 33 | * Setup the module. |
34 | */ | 34 | */ |
35 | void GSF_put_init_ (void); | 35 | void |
36 | GSF_put_init_ (void); | ||
36 | 37 | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * Shutdown the module. | 40 | * Shutdown the module. |
40 | */ | 41 | */ |
41 | void GSF_put_done_ (void); | 42 | void |
43 | GSF_put_done_ (void); | ||
42 | 44 | ||
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 0737ea949..0bf05d0ce 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -129,7 +129,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
129 | /** | 129 | /** |
130 | * Function that gathers stats from all daemons. | 130 | * Function that gathers stats from all daemons. |
131 | */ | 131 | */ |
132 | static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 132 | static void |
133 | stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
133 | 134 | ||
134 | 135 | ||
135 | /** | 136 | /** |
@@ -206,8 +207,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
206 | sm->stat = | 207 | sm->stat = |
207 | GNUNET_STATISTICS_create ("<driver>", | 208 | GNUNET_STATISTICS_create ("<driver>", |
208 | GNUNET_FS_TEST_get_configuration (daemons, | 209 | GNUNET_FS_TEST_get_configuration (daemons, |
209 | sm-> | 210 | sm->daemon)); |
210 | daemon)); | ||
211 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | 211 | GNUNET_SCHEDULER_add_now (&stat_run, sm); |
212 | } | 212 | } |
213 | else | 213 | else |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c index 5a8d4242a..3432714b3 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_trust.c +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c | |||
@@ -162,7 +162,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
162 | /** | 162 | /** |
163 | * Function that gathers stats from all daemons. | 163 | * Function that gathers stats from all daemons. |
164 | */ | 164 | */ |
165 | static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 165 | static void |
166 | stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
166 | 167 | ||
167 | 168 | ||
168 | /** | 169 | /** |
@@ -244,8 +245,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
244 | sm->stat = | 245 | sm->stat = |
245 | GNUNET_STATISTICS_create ("<driver>", | 246 | GNUNET_STATISTICS_create ("<driver>", |
246 | GNUNET_FS_TEST_get_configuration (daemons, | 247 | GNUNET_FS_TEST_get_configuration (daemons, |
247 | sm-> | 248 | sm->daemon)); |
248 | daemon)); | ||
249 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | 249 | GNUNET_SCHEDULER_add_now (&stat_run, sm); |
250 | } | 250 | } |
251 | else | 251 | else |
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 34625ff2e..10f4c0ce4 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -140,42 +140,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
140 | (unsigned long long) event->value.publish.completed, | 140 | (unsigned long long) event->value.publish.completed, |
141 | (unsigned long long) event->value.publish.size, | 141 | (unsigned long long) event->value.publish.size, |
142 | event->value.publish.specifics.progress.depth, | 142 | event->value.publish.specifics.progress.depth, |
143 | (unsigned long long) event->value.publish.specifics.progress. | 143 | (unsigned long long) event->value.publish.specifics. |
144 | offset); | 144 | progress.offset); |
145 | #endif | 145 | #endif |
146 | break; | 146 | break; |
147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
148 | printf ("Publishing complete, %llu kb/s.\n", | 148 | printf ("Publishing complete, %llu kb/s.\n", |
149 | (unsigned long long) (FILESIZE * 1000LL / | 149 | (unsigned long long) (FILESIZE * 1000LL / |
150 | (1 + | 150 | (1 + |
151 | GNUNET_TIME_absolute_get_duration (start). | 151 | GNUNET_TIME_absolute_get_duration |
152 | rel_value) / 1024LL)); | 152 | (start).rel_value) / 1024LL)); |
153 | GAUGER ("FS", "Publishing speed (insertion)", | 153 | GAUGER ("FS", "Publishing speed (insertion)", |
154 | (unsigned long long) (FILESIZE * 1000LL / | 154 | (unsigned long long) (FILESIZE * 1000LL / |
155 | (1 + | 155 | (1 + |
156 | GNUNET_TIME_absolute_get_duration (start). | 156 | GNUNET_TIME_absolute_get_duration |
157 | rel_value) / 1024LL), "kb/s"); | 157 | (start).rel_value) / 1024LL), "kb/s"); |
158 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 158 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
159 | start = GNUNET_TIME_absolute_get (); | 159 | start = GNUNET_TIME_absolute_get (); |
160 | download = | 160 | download = |
161 | GNUNET_FS_download_start (fs, | 161 | GNUNET_FS_download_start (fs, |
162 | event->value.publish.specifics.completed. | 162 | event->value.publish.specifics. |
163 | chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, | 163 | completed.chk_uri, NULL, fn, NULL, 0, |
164 | GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", | 164 | FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, |
165 | NULL); | 165 | "download", NULL); |
166 | GNUNET_assert (download != NULL); | 166 | GNUNET_assert (download != NULL); |
167 | break; | 167 | break; |
168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
169 | printf ("Download complete, %llu kb/s.\n", | 169 | printf ("Download complete, %llu kb/s.\n", |
170 | (unsigned long long) (FILESIZE * 1000LL / | 170 | (unsigned long long) (FILESIZE * 1000LL / |
171 | (1 + | 171 | (1 + |
172 | GNUNET_TIME_absolute_get_duration (start). | 172 | GNUNET_TIME_absolute_get_duration |
173 | rel_value) / 1024LL)); | 173 | (start).rel_value) / 1024LL)); |
174 | GAUGER ("FS", "Local download speed (inserted)", | 174 | GAUGER ("FS", "Local download speed (inserted)", |
175 | (unsigned long long) (FILESIZE * 1000LL / | 175 | (unsigned long long) (FILESIZE * 1000LL / |
176 | (1 + | 176 | (1 + |
177 | GNUNET_TIME_absolute_get_duration (start). | 177 | GNUNET_TIME_absolute_get_duration |
178 | rel_value) / 1024LL), "kb/s"); | 178 | (start).rel_value) / 1024LL), "kb/s"); |
179 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 179 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
180 | break; | 180 | break; |
181 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 181 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -185,8 +185,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
185 | (unsigned long long) event->value.download.completed, | 185 | (unsigned long long) event->value.download.completed, |
186 | (unsigned long long) event->value.download.size, | 186 | (unsigned long long) event->value.download.size, |
187 | event->value.download.specifics.progress.depth, | 187 | event->value.download.specifics.progress.depth, |
188 | (unsigned long long) event->value.download.specifics.progress. | 188 | (unsigned long long) event->value.download.specifics. |
189 | offset); | 189 | progress.offset); |
190 | #endif | 190 | #endif |
191 | break; | 191 | break; |
192 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 192 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 5b1752e63..1811b325d 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c | |||
@@ -141,42 +141,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
141 | (unsigned long long) event->value.publish.completed, | 141 | (unsigned long long) event->value.publish.completed, |
142 | (unsigned long long) event->value.publish.size, | 142 | (unsigned long long) event->value.publish.size, |
143 | event->value.publish.specifics.progress.depth, | 143 | event->value.publish.specifics.progress.depth, |
144 | (unsigned long long) event->value.publish.specifics.progress. | 144 | (unsigned long long) event->value.publish.specifics. |
145 | offset); | 145 | progress.offset); |
146 | #endif | 146 | #endif |
147 | break; | 147 | break; |
148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
149 | printf ("Publishing complete, %llu kbps.\n", | 149 | printf ("Publishing complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000LL / | 150 | (unsigned long long) (FILESIZE * 1000LL / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024LL)); | 153 | (start).rel_value) / 1024LL)); |
154 | GAUGER ("FS", "Publishing speed (indexing)", | 154 | GAUGER ("FS", "Publishing speed (indexing)", |
155 | (unsigned long long) (FILESIZE * 1000LL / | 155 | (unsigned long long) (FILESIZE * 1000LL / |
156 | (1 + | 156 | (1 + |
157 | GNUNET_TIME_absolute_get_duration (start). | 157 | GNUNET_TIME_absolute_get_duration |
158 | rel_value) / 1024LL), "kb/s"); | 158 | (start).rel_value) / 1024LL), "kb/s"); |
159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
160 | start = GNUNET_TIME_absolute_get (); | 160 | start = GNUNET_TIME_absolute_get (); |
161 | download = | 161 | download = |
162 | GNUNET_FS_download_start (fs, | 162 | GNUNET_FS_download_start (fs, |
163 | event->value.publish.specifics.completed. | 163 | event->value.publish.specifics. |
164 | chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, | 164 | completed.chk_uri, NULL, fn, NULL, 0, |
165 | GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", | 165 | FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, |
166 | NULL); | 166 | "download", NULL); |
167 | GNUNET_assert (download != NULL); | 167 | GNUNET_assert (download != NULL); |
168 | break; | 168 | break; |
169 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 169 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
170 | printf ("Download complete, %llu kbps.\n", | 170 | printf ("Download complete, %llu kbps.\n", |
171 | (unsigned long long) (FILESIZE * 1000LL / | 171 | (unsigned long long) (FILESIZE * 1000LL / |
172 | (1 + | 172 | (1 + |
173 | GNUNET_TIME_absolute_get_duration (start). | 173 | GNUNET_TIME_absolute_get_duration |
174 | rel_value) / 1024LL)); | 174 | (start).rel_value) / 1024LL)); |
175 | GAUGER ("FS", "Local download speed (indexed)", | 175 | GAUGER ("FS", "Local download speed (indexed)", |
176 | (unsigned long long) (FILESIZE * 1000LL / | 176 | (unsigned long long) (FILESIZE * 1000LL / |
177 | (1 + | 177 | (1 + |
178 | GNUNET_TIME_absolute_get_duration (start). | 178 | GNUNET_TIME_absolute_get_duration |
179 | rel_value) / 1024LL), "kb/s"); | 179 | (start).rel_value) / 1024LL), "kb/s"); |
180 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 180 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
181 | break; | 181 | break; |
182 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 182 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -186,8 +186,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
186 | (unsigned long long) event->value.download.completed, | 186 | (unsigned long long) event->value.download.completed, |
187 | (unsigned long long) event->value.download.size, | 187 | (unsigned long long) event->value.download.size, |
188 | event->value.download.specifics.progress.depth, | 188 | event->value.download.specifics.progress.depth, |
189 | (unsigned long long) event->value.download.specifics.progress. | 189 | (unsigned long long) event->value.download.specifics. |
190 | offset); | 190 | progress.offset); |
191 | #endif | 191 | #endif |
192 | break; | 192 | break; |
193 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 193 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 5b2a53f80..c7a0a8b7c 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c | |||
@@ -123,8 +123,8 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | static void *progress_cb (void *cls, | 126 | static void * |
127 | const struct GNUNET_FS_ProgressInfo *event); | 127 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
128 | 128 | ||
129 | 129 | ||
130 | static void | 130 | static void |
@@ -171,16 +171,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
171 | (unsigned long long) event->value.publish.completed, | 171 | (unsigned long long) event->value.publish.completed, |
172 | (unsigned long long) event->value.publish.size, | 172 | (unsigned long long) event->value.publish.size, |
173 | event->value.publish.specifics.progress.depth, | 173 | event->value.publish.specifics.progress.depth, |
174 | (unsigned long long) event->value.publish.specifics.progress. | 174 | (unsigned long long) event->value.publish.specifics. |
175 | offset); | 175 | progress.offset); |
176 | #endif | 176 | #endif |
177 | break; | 177 | break; |
178 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 178 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
179 | printf ("Publishing complete, %llu kbps.\n", | 179 | printf ("Publishing complete, %llu kbps.\n", |
180 | (unsigned long long) (FILESIZE * 1000LL / | 180 | (unsigned long long) (FILESIZE * 1000LL / |
181 | (1 + | 181 | (1 + |
182 | GNUNET_TIME_absolute_get_duration (start). | 182 | GNUNET_TIME_absolute_get_duration |
183 | rel_value) / 1024LL)); | 183 | (start).rel_value) / 1024LL)); |
184 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 184 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
185 | start = GNUNET_TIME_absolute_get (); | 185 | start = GNUNET_TIME_absolute_get (); |
186 | GNUNET_assert (download == NULL); | 186 | GNUNET_assert (download == NULL); |
@@ -194,8 +194,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
194 | printf ("Download complete, %llu kbps.\n", | 194 | printf ("Download complete, %llu kbps.\n", |
195 | (unsigned long long) (FILESIZE * 1000LL / | 195 | (unsigned long long) (FILESIZE * 1000LL / |
196 | (1 + | 196 | (1 + |
197 | GNUNET_TIME_absolute_get_duration (start). | 197 | GNUNET_TIME_absolute_get_duration |
198 | rel_value) / 1024LL)); | 198 | (start).rel_value) / 1024LL)); |
199 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 199 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
200 | break; | 200 | break; |
201 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 201 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -206,8 +206,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
206 | (unsigned long long) event->value.download.completed, | 206 | (unsigned long long) event->value.download.completed, |
207 | (unsigned long long) event->value.download.size, | 207 | (unsigned long long) event->value.download.size, |
208 | event->value.download.specifics.progress.depth, | 208 | event->value.download.specifics.progress.depth, |
209 | (unsigned long long) event->value.download.specifics.progress. | 209 | (unsigned long long) event->value.download.specifics. |
210 | offset); | 210 | progress.offset); |
211 | #endif | 211 | #endif |
212 | break; | 212 | break; |
213 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 213 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 87afa12e1..b86506f8d 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c | |||
@@ -110,8 +110,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
110 | printf ("Publish complete, %llu kbps.\n", | 110 | printf ("Publish complete, %llu kbps.\n", |
111 | (unsigned long long) (FILESIZE * 1000 / | 111 | (unsigned long long) (FILESIZE * 1000 / |
112 | (1 + | 112 | (1 + |
113 | GNUNET_TIME_absolute_get_duration (start). | 113 | GNUNET_TIME_absolute_get_duration |
114 | rel_value) / 1024)); | 114 | (start).rel_value) / 1024)); |
115 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) | 115 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) |
116 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, | 116 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, |
117 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 117 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
@@ -125,8 +125,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
125 | (unsigned long long) event->value.publish.completed, | 125 | (unsigned long long) event->value.publish.completed, |
126 | (unsigned long long) event->value.publish.size, | 126 | (unsigned long long) event->value.publish.size, |
127 | event->value.publish.specifics.progress.depth, | 127 | event->value.publish.specifics.progress.depth, |
128 | (unsigned long long) event->value.publish.specifics.progress. | 128 | (unsigned long long) event->value.publish.specifics. |
129 | offset); | 129 | progress.offset); |
130 | #endif | 130 | #endif |
131 | break; | 131 | break; |
132 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 132 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 797c4c9a8..3db0a7c62 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c | |||
@@ -98,8 +98,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
98 | printf ("Publish complete, %llu kbps.\n", | 98 | printf ("Publish complete, %llu kbps.\n", |
99 | (unsigned long long) (FILESIZE * 1000 / | 99 | (unsigned long long) (FILESIZE * 1000 / |
100 | (1 + | 100 | (1 + |
101 | GNUNET_TIME_absolute_get_duration (start). | 101 | GNUNET_TIME_absolute_get_duration |
102 | rel_value) / 1024)); | 102 | (start).rel_value) / 1024)); |
103 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 103 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
104 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 104 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, |
105 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 105 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
@@ -112,8 +112,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
112 | (unsigned long long) event->value.publish.completed, | 112 | (unsigned long long) event->value.publish.completed, |
113 | (unsigned long long) event->value.publish.size, | 113 | (unsigned long long) event->value.publish.size, |
114 | event->value.publish.specifics.progress.depth, | 114 | event->value.publish.specifics.progress.depth, |
115 | (unsigned long long) event->value.publish.specifics.progress. | 115 | (unsigned long long) event->value.publish.specifics. |
116 | offset); | 116 | progress.offset); |
117 | #endif | 117 | #endif |
118 | break; | 118 | break; |
119 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 119 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index f69ac5d9a..704c2a4c0 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c | |||
@@ -97,8 +97,8 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | static void *progress_cb (void *cls, | 100 | static void * |
101 | const struct GNUNET_FS_ProgressInfo *event); | 101 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
102 | 102 | ||
103 | 103 | ||
104 | static void | 104 | static void |
@@ -149,8 +149,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
149 | printf ("Publish complete, %llu kbps.\n", | 149 | printf ("Publish complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000LL / | 150 | (unsigned long long) (FILESIZE * 1000LL / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024)); | 153 | (start).rel_value) / 1024)); |
154 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 154 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
155 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); | 155 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
156 | break; | 156 | break; |
@@ -163,8 +163,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
163 | (unsigned long long) event->value.publish.completed, | 163 | (unsigned long long) event->value.publish.completed, |
164 | (unsigned long long) event->value.publish.size, | 164 | (unsigned long long) event->value.publish.size, |
165 | event->value.publish.specifics.progress.depth, | 165 | event->value.publish.specifics.progress.depth, |
166 | (unsigned long long) event->value.publish.specifics.progress. | 166 | (unsigned long long) event->value.publish.specifics. |
167 | offset); | 167 | progress.offset); |
168 | #endif | 168 | #endif |
169 | break; | 169 | break; |
170 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 170 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |
@@ -175,8 +175,9 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
175 | if (NULL == publish) | 175 | if (NULL == publish) |
176 | { | 176 | { |
177 | GNUNET_assert (GNUNET_YES == | 177 | GNUNET_assert (GNUNET_YES == |
178 | GNUNET_FS_file_information_is_directory (event->value. | 178 | GNUNET_FS_file_information_is_directory (event-> |
179 | publish.fi)); | 179 | value.publish. |
180 | fi)); | ||
180 | publish = event->value.publish.pc; | 181 | publish = event->value.publish.pc; |
181 | return "publish-context-dir"; | 182 | return "publish-context-dir"; |
182 | } | 183 | } |
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 3961017cf..d8e592b6f 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c | |||
@@ -101,8 +101,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
101 | (unsigned long long) event->value.publish.completed, | 101 | (unsigned long long) event->value.publish.completed, |
102 | (unsigned long long) event->value.publish.size, | 102 | (unsigned long long) event->value.publish.size, |
103 | event->value.publish.specifics.progress.depth, | 103 | event->value.publish.specifics.progress.depth, |
104 | (unsigned long long) event->value.publish.specifics.progress. | 104 | (unsigned long long) event->value.publish.specifics. |
105 | offset); | 105 | progress.offset); |
106 | #endif | 106 | #endif |
107 | break; | 107 | break; |
108 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 108 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 5c5a6f140..6eb18dafb 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c | |||
@@ -86,8 +86,8 @@ abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||
89 | static void *progress_cb (void *cls, | 89 | static void * |
90 | const struct GNUNET_FS_ProgressInfo *event); | 90 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
91 | 91 | ||
92 | 92 | ||
93 | static void | 93 | static void |
@@ -140,8 +140,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
140 | (unsigned long long) event->value.publish.completed, | 140 | (unsigned long long) event->value.publish.completed, |
141 | (unsigned long long) event->value.publish.size, | 141 | (unsigned long long) event->value.publish.size, |
142 | event->value.publish.specifics.progress.depth, | 142 | event->value.publish.specifics.progress.depth, |
143 | (unsigned long long) event->value.publish.specifics.progress. | 143 | (unsigned long long) event->value.publish.specifics. |
144 | offset); | 144 | progress.offset); |
145 | #endif | 145 | #endif |
146 | break; | 146 | break; |
147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 177b687ca..99913fbcf 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c | |||
@@ -100,16 +100,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
100 | (unsigned long long) event->value.publish.completed, | 100 | (unsigned long long) event->value.publish.completed, |
101 | (unsigned long long) event->value.publish.size, | 101 | (unsigned long long) event->value.publish.size, |
102 | event->value.publish.specifics.progress.depth, | 102 | event->value.publish.specifics.progress.depth, |
103 | (unsigned long long) event->value.publish.specifics.progress. | 103 | (unsigned long long) event->value.publish.specifics. |
104 | offset); | 104 | progress.offset); |
105 | #endif | 105 | #endif |
106 | break; | 106 | break; |
107 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 107 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
108 | printf ("Publishing complete, %llu kbps.\n", | 108 | printf ("Publishing complete, %llu kbps.\n", |
109 | (unsigned long long) (FILESIZE * 1000 / | 109 | (unsigned long long) (FILESIZE * 1000 / |
110 | (1 + | 110 | (1 + |
111 | GNUNET_TIME_absolute_get_duration (start). | 111 | GNUNET_TIME_absolute_get_duration |
112 | rel_value) / 1024)); | 112 | (start).rel_value) / 1024)); |
113 | start = GNUNET_TIME_absolute_get (); | 113 | start = GNUNET_TIME_absolute_get (); |
114 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 114 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
115 | GNUNET_assert (unindex != NULL); | 115 | GNUNET_assert (unindex != NULL); |
@@ -118,8 +118,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
118 | printf ("Unindex complete, %llu kbps.\n", | 118 | printf ("Unindex complete, %llu kbps.\n", |
119 | (unsigned long long) (FILESIZE * 1000 / | 119 | (unsigned long long) (FILESIZE * 1000 / |
120 | (1 + | 120 | (1 + |
121 | GNUNET_TIME_absolute_get_duration (start). | 121 | GNUNET_TIME_absolute_get_duration |
122 | rel_value) / 1024)); | 122 | (start).rel_value) / 1024)); |
123 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 123 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
124 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 124 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
125 | break; | 125 | break; |
@@ -130,8 +130,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
130 | (unsigned long long) event->value.unindex.completed, | 130 | (unsigned long long) event->value.unindex.completed, |
131 | (unsigned long long) event->value.unindex.size, | 131 | (unsigned long long) event->value.unindex.size, |
132 | event->value.unindex.specifics.progress.depth, | 132 | event->value.unindex.specifics.progress.depth, |
133 | (unsigned long long) event->value.unindex.specifics.progress. | 133 | (unsigned long long) event->value.unindex.specifics. |
134 | offset); | 134 | progress.offset); |
135 | #endif | 135 | #endif |
136 | break; | 136 | break; |
137 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 137 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 4fcd1445f..e81400817 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -94,8 +94,8 @@ abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | static void *progress_cb (void *cls, | 97 | static void * |
98 | const struct GNUNET_FS_ProgressInfo *event); | 98 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
99 | 99 | ||
100 | 100 | ||
101 | static void | 101 | static void |
@@ -141,16 +141,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
141 | (unsigned long long) event->value.publish.completed, | 141 | (unsigned long long) event->value.publish.completed, |
142 | (unsigned long long) event->value.publish.size, | 142 | (unsigned long long) event->value.publish.size, |
143 | event->value.publish.specifics.progress.depth, | 143 | event->value.publish.specifics.progress.depth, |
144 | (unsigned long long) event->value.publish.specifics.progress. | 144 | (unsigned long long) event->value.publish.specifics. |
145 | offset); | 145 | progress.offset); |
146 | #endif | 146 | #endif |
147 | break; | 147 | break; |
148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
149 | printf ("Publishing complete, %llu kbps.\n", | 149 | printf ("Publishing complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000 / | 150 | (unsigned long long) (FILESIZE * 1000 / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024)); | 153 | (start).rel_value) / 1024)); |
154 | start = GNUNET_TIME_absolute_get (); | 154 | start = GNUNET_TIME_absolute_get (); |
155 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 155 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
156 | GNUNET_assert (unindex != NULL); | 156 | GNUNET_assert (unindex != NULL); |
@@ -159,8 +159,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
159 | printf ("Unindex complete, %llu kbps.\n", | 159 | printf ("Unindex complete, %llu kbps.\n", |
160 | (unsigned long long) (FILESIZE * 1000 / | 160 | (unsigned long long) (FILESIZE * 1000 / |
161 | (1 + | 161 | (1 + |
162 | GNUNET_TIME_absolute_get_duration (start). | 162 | GNUNET_TIME_absolute_get_duration |
163 | rel_value) / 1024)); | 163 | (start).rel_value) / 1024)); |
164 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 164 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
165 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 165 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
166 | break; | 166 | break; |
@@ -172,8 +172,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
172 | (unsigned long long) event->value.unindex.completed, | 172 | (unsigned long long) event->value.unindex.completed, |
173 | (unsigned long long) event->value.unindex.size, | 173 | (unsigned long long) event->value.unindex.size, |
174 | event->value.unindex.specifics.progress.depth, | 174 | event->value.unindex.specifics.progress.depth, |
175 | (unsigned long long) event->value.unindex.specifics.progress. | 175 | (unsigned long long) event->value.unindex.specifics. |
176 | offset); | 176 | progress.offset); |
177 | #endif | 177 | #endif |
178 | break; | 178 | break; |
179 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 179 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |