diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-02 19:55:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-02 19:55:10 +0000 |
commit | 586cf79331064d131c90df08e2d51215214a37d2 (patch) | |
tree | ffd2dd05efea3d42de5e532abd78b88ab63c7fb9 /src | |
parent | bec64fd32ad5f930ee60634103222c4575904728 (diff) | |
download | gnunet-586cf79331064d131c90df08e2d51215214a37d2.tar.gz gnunet-586cf79331064d131c90df08e2d51215214a37d2.zip |
finishing first run at unindex
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_unindex.c | 55 | ||||
-rw-r--r-- | src/include/gnunet_fs_service.h | 16 |
2 files changed, 48 insertions, 23 deletions
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index a6d414f09..2d16e9aee 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -144,29 +144,6 @@ unindex_process (void *cls, | |||
144 | uc, | 144 | uc, |
145 | GNUNET_CONSTANTS_SERVICE_TIMEOUT); | 145 | GNUNET_CONSTANTS_SERVICE_TIMEOUT); |
146 | } | 146 | } |
147 | |||
148 | |||
149 | /** | ||
150 | * Function called with information about our | ||
151 | * progress in computing the tree encoding. | ||
152 | * | ||
153 | * @param cls closure | ||
154 | * @param offset where are we in the file | ||
155 | * @param pt_block plaintext of the currently processed block | ||
156 | * @param pt_size size of pt_block | ||
157 | * @param depth depth of the block in the tree | ||
158 | */ | ||
159 | static void | ||
160 | unindex_progress (void *cls, | ||
161 | uint64_t offset, | ||
162 | const void *pt_block, | ||
163 | size_t pt_size, | ||
164 | unsigned int depth) | ||
165 | { | ||
166 | struct GNUNET_FS_UnindexContext *uc = cls; | ||
167 | // FIXME: call callback! | ||
168 | } | ||
169 | |||
170 | 147 | ||
171 | 148 | ||
172 | /** | 149 | /** |
@@ -195,6 +172,38 @@ make_unindex_status (struct GNUNET_FS_ProgressInfo *pi, | |||
195 | 172 | ||
196 | 173 | ||
197 | /** | 174 | /** |
175 | * Function called with information about our | ||
176 | * progress in computing the tree encoding. | ||
177 | * | ||
178 | * @param cls closure | ||
179 | * @param offset where are we in the file | ||
180 | * @param pt_block plaintext of the currently processed block | ||
181 | * @param pt_size size of pt_block | ||
182 | * @param depth depth of the block in the tree | ||
183 | */ | ||
184 | static void | ||
185 | unindex_progress (void *cls, | ||
186 | uint64_t offset, | ||
187 | const void *pt_block, | ||
188 | size_t pt_size, | ||
189 | unsigned int depth) | ||
190 | { | ||
191 | struct GNUNET_FS_UnindexContext *uc = cls; | ||
192 | struct GNUNET_FS_ProgressInfo pi; | ||
193 | |||
194 | pi.status = GNUNET_FS_STATUS_UNINDEX_PROGRESS; | ||
195 | make_unindex_status (&pi, uc, offset); | ||
196 | pi.value.unindex.specifics.progress.data = pt_block; | ||
197 | pi.value.unindex.specifics.progress.offset = offset; | ||
198 | pi.value.unindex.specifics.progress.data_len = pt_size; | ||
199 | pi.value.unindex.specifics.progress.depth = depth; | ||
200 | uc->client_info | ||
201 | = uc->h->upcb (uc->h->upcb_cls, | ||
202 | &pi); | ||
203 | } | ||
204 | |||
205 | |||
206 | /** | ||
198 | * We've encountered an error during | 207 | * We've encountered an error during |
199 | * unindexing. Signal the client. | 208 | * unindexing. Signal the client. |
200 | * | 209 | * |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 8f7c67407..e8b8d0ba0 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -920,6 +920,14 @@ struct GNUNET_FS_ProgressInfo | |||
920 | uint64_t data_len; | 920 | uint64_t data_len; |
921 | 921 | ||
922 | /** | 922 | /** |
923 | * Depth of the given block in the tree; | ||
924 | * 0 would be the highest level (the first | ||
925 | * call is guaranteed to be for the lowest | ||
926 | * level). | ||
927 | */ | ||
928 | unsigned int depth; | ||
929 | |||
930 | /** | ||
923 | * Amount of trust we offered to get the block. | 931 | * Amount of trust we offered to get the block. |
924 | */ | 932 | */ |
925 | unsigned int trust_offered; | 933 | unsigned int trust_offered; |
@@ -1327,6 +1335,14 @@ struct GNUNET_FS_ProgressInfo | |||
1327 | */ | 1335 | */ |
1328 | uint64_t data_len; | 1336 | uint64_t data_len; |
1329 | 1337 | ||
1338 | /** | ||
1339 | * Depth of the given block in the tree; | ||
1340 | * 0 would be the highest level (the first | ||
1341 | * call is guaranteed to be for the lowest | ||
1342 | * level). | ||
1343 | */ | ||
1344 | unsigned int depth; | ||
1345 | |||
1330 | } progress; | 1346 | } progress; |
1331 | 1347 | ||
1332 | /** | 1348 | /** |