aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c34
-rw-r--r--src/fs/fs_api.h14
-rw-r--r--src/fs/fs_dirmetascan.c52
-rw-r--r--src/fs/fs_download.c24
-rw-r--r--src/fs/fs_namespace.c26
-rw-r--r--src/fs/fs_publish.c48
-rw-r--r--src/fs/fs_publish_ksk.c8
-rw-r--r--src/fs/fs_publish_ublock.c14
-rw-r--r--src/fs/fs_publish_ublock.h4
-rw-r--r--src/fs/fs_search.c52
-rw-r--r--src/fs/fs_sharetree.c16
-rw-r--r--src/fs/fs_test_lib.c30
-rw-r--r--src/fs/fs_unindex.c22
-rw-r--r--src/fs/fs_uri.c24
-rw-r--r--src/fs/gnunet-auto-share.c26
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c42
-rw-r--r--src/fs/gnunet-download.c8
-rw-r--r--src/fs/gnunet-fs-profiler.c6
-rw-r--r--src/fs/gnunet-helper-fs-publish.c46
-rw-r--r--src/fs/gnunet-publish.c36
-rw-r--r--src/fs/gnunet-service-fs.c8
-rw-r--r--src/fs/gnunet-service-fs_cp.c24
-rw-r--r--src/fs/gnunet-service-fs_indexing.c4
-rw-r--r--src/fs/gnunet-service-fs_lc.c2
-rw-r--r--src/fs/gnunet-service-fs_mesh.h2
-rw-r--r--src/fs/gnunet-service-fs_mesh_client.c30
-rw-r--r--src/fs/gnunet-service-fs_mesh_server.c32
-rw-r--r--src/fs/gnunet-service-fs_pe.c6
-rw-r--r--src/fs/gnunet-service-fs_pe.h2
-rw-r--r--src/fs/gnunet-service-fs_pr.c38
-rw-r--r--src/fs/gnunet-service-fs_put.c6
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c20
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c18
-rw-r--r--src/fs/test_fs_download.c10
-rw-r--r--src/fs/test_fs_download_persistence.c2
-rw-r--r--src/fs/test_fs_namespace.c6
-rw-r--r--src/fs/test_fs_namespace_list_updateable.c2
-rw-r--r--src/fs/test_fs_publish.c2
-rw-r--r--src/fs/test_fs_publish_persistence.c4
-rw-r--r--src/fs/test_fs_search.c2
-rw-r--r--src/fs/test_fs_search_probes.c2
-rw-r--r--src/fs/test_fs_start_stop.c2
-rw-r--r--src/fs/test_fs_test_lib.c12
-rw-r--r--src/fs/test_fs_unindex_persistence.c2
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c4
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c12
46 files changed, 393 insertions, 393 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index c2e2ada3e..04057bc98 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -211,8 +211,8 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
211 /* stop probes if possible */ 211 /* stop probes if possible */
212 num_probes_change = - num_probes_active; 212 num_probes_change = - num_probes_active;
213 num_downloads_change = h->max_parallel_requests - h->active_downloads; 213 num_downloads_change = h->max_parallel_requests - h->active_downloads;
214 } 214 }
215 else 215 else
216 { 216 {
217 /* start all downloads */ 217 /* start all downloads */
218 num_downloads_change = num_downloads_waiting; 218 num_downloads_change = num_downloads_waiting;
@@ -220,7 +220,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
220 num_probes_change = GNUNET_MIN (num_probes_waiting, 220 num_probes_change = GNUNET_MIN (num_probes_waiting,
221 h->max_parallel_requests - (h->active_downloads + num_downloads_waiting)); 221 h->max_parallel_requests - (h->active_downloads + num_downloads_waiting));
222 } 222 }
223 223
224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
225 "Changing %d probes and %d downloads\n", 225 "Changing %d probes and %d downloads\n",
226 num_probes_change, 226 num_probes_change,
@@ -232,7 +232,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
232 next = qe->next; 232 next = qe->next;
233 if (GNUNET_FS_QUEUE_PRIORITY_PROBE != qe->priority) 233 if (GNUNET_FS_QUEUE_PRIORITY_PROBE != qe->priority)
234 continue; 234 continue;
235 if (num_probes_change < 0) 235 if (num_probes_change < 0)
236 { 236 {
237 stop_job (qe); 237 stop_job (qe);
238 num_probes_change++; 238 num_probes_change++;
@@ -266,7 +266,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
266 ( (qe->blocks + h->active_blocks <= h->max_parallel_requests) || 266 ( (qe->blocks + h->active_blocks <= h->max_parallel_requests) ||
267 ( (qe->blocks > h->max_parallel_requests) && 267 ( (qe->blocks > h->max_parallel_requests) &&
268 (0 == h->active_downloads) ) ) ) 268 (0 == h->active_downloads) ) ) )
269 { 269 {
270 start_job (qe); 270 start_job (qe);
271 num_downloads_change--; 271 num_downloads_change--;
272 } 272 }
@@ -284,7 +284,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
284 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 284 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
285 "AD: %u, MP: %u; %d probes and %d downloads to start, will run again in %s\n", 285 "AD: %u, MP: %u; %d probes and %d downloads to start, will run again in %s\n",
286 h->active_downloads, 286 h->active_downloads,
287 h->max_parallel_requests, 287 h->max_parallel_requests,
288 num_probes_change, 288 num_probes_change,
289 num_downloads_change, 289 num_downloads_change,
290 GNUNET_STRINGS_relative_time_to_string (restart_at, GNUNET_YES)); 290 GNUNET_STRINGS_relative_time_to_string (restart_at, GNUNET_YES));
@@ -467,7 +467,7 @@ GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf,
467 return 0; 467 return 0;
468 } 468 }
469 } 469 }
470 if ( (GNUNET_SYSERR == 470 if ( (GNUNET_SYSERR ==
471 GNUNET_DISK_file_seek (fi->fd, offset, GNUNET_DISK_SEEK_SET)) || 471 GNUNET_DISK_file_seek (fi->fd, offset, GNUNET_DISK_SEEK_SET)) ||
472 (-1 == (ret = GNUNET_DISK_file_read (fi->fd, buf, max))) ) 472 (-1 == (ret = GNUNET_DISK_file_read (fi->fd, buf, max))) )
473 { 473 {
@@ -1398,7 +1398,7 @@ cleanup:
1398 * @return NULL if srch was not found in this subtree 1398 * @return NULL if srch was not found in this subtree
1399 */ 1399 */
1400static struct GNUNET_FS_FileInformation * 1400static struct GNUNET_FS_FileInformation *
1401find_file_position (struct GNUNET_FS_FileInformation *pos, 1401find_file_position (struct GNUNET_FS_FileInformation *pos,
1402 const char *srch) 1402 const char *srch)
1403{ 1403{
1404 struct GNUNET_FS_FileInformation *r; 1404 struct GNUNET_FS_FileInformation *r;
@@ -1409,7 +1409,7 @@ find_file_position (struct GNUNET_FS_FileInformation *pos,
1409 return pos; 1409 return pos;
1410 if ( (GNUNET_YES == pos->is_directory) && 1410 if ( (GNUNET_YES == pos->is_directory) &&
1411 (NULL != (r = find_file_position (pos->data.dir.entries, srch))) ) 1411 (NULL != (r = find_file_position (pos->data.dir.entries, srch))) )
1412 return r; 1412 return r;
1413 pos = pos->next; 1413 pos = pos->next;
1414 } 1414 }
1415 return NULL; 1415 return NULL;
@@ -1556,7 +1556,7 @@ deserialize_publish_file (void *cls, const char *filename)
1556 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 1556 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
1557 pc->upload_task = 1557 pc->upload_task =
1558 GNUNET_SCHEDULER_add_with_priority 1558 GNUNET_SCHEDULER_add_with_priority
1559 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 1559 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
1560 &GNUNET_FS_publish_main_, pc); 1560 &GNUNET_FS_publish_main_, pc);
1561 } 1561 }
1562 if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) 1562 if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))
@@ -2031,8 +2031,8 @@ cleanup:
2031 if (NULL != wh) 2031 if (NULL != wh)
2032 (void) GNUNET_BIO_write_close (wh); 2032 (void) GNUNET_BIO_write_close (wh);
2033 remove_sync_file_in_dir (sr->h, 2033 remove_sync_file_in_dir (sr->h,
2034 (NULL == sr->sc->psearch_result) 2034 (NULL == sr->sc->psearch_result)
2035 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH 2035 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH
2036 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, 2036 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH,
2037 sr->sc->serialization, sr->serialization); 2037 sr->sc->serialization, sr->serialization);
2038 GNUNET_free (sr->serialization); 2038 GNUNET_free (sr->serialization);
@@ -2057,8 +2057,8 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc)
2057 const char *category; 2057 const char *category;
2058 2058
2059 category = 2059 category =
2060 (NULL == sc->psearch_result) 2060 (NULL == sc->psearch_result)
2061 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH 2061 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH
2062 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH; 2062 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH;
2063 if (NULL == sc->serialization) 2063 if (NULL == sc->serialization)
2064 sc->serialization = make_serialization_file_name (sc->h, category); 2064 sc->serialization = make_serialization_file_name (sc->h, category);
@@ -2163,7 +2163,7 @@ deserialize_unindex_file (void *cls, const char *filename)
2163 { 2163 {
2164 GNUNET_break (0); 2164 GNUNET_break (0);
2165 goto cleanup; 2165 goto cleanup;
2166 } 2166 }
2167 uc->state = (enum UnindexState) state; 2167 uc->state = (enum UnindexState) state;
2168 switch (state) 2168 switch (state)
2169 { 2169 {
@@ -2316,8 +2316,8 @@ deserialize_search_result (void *cls, const char *filename)
2316 if (NULL != ser) 2316 if (NULL != ser)
2317 { 2317 {
2318 remove_sync_file_in_dir (sc->h, 2318 remove_sync_file_in_dir (sc->h,
2319 (NULL == sc->psearch_result) 2319 (NULL == sc->psearch_result)
2320 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH 2320 ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH
2321 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, 2321 : GNUNET_FS_SYNC_PATH_CHILD_SEARCH,
2322 sc->serialization, ser); 2322 sc->serialization, ser);
2323 GNUNET_free (ser); 2323 GNUNET_free (ser);
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index d8ea21c54..5858c916c 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -414,7 +414,7 @@ typedef void (*GNUNET_FS_QueueStop) (void *cls);
414 414
415/** 415/**
416 * Priorities for the queue. 416 * Priorities for the queue.
417 */ 417 */
418enum GNUNET_FS_QueuePriority 418enum GNUNET_FS_QueuePriority
419 { 419 {
420 /** 420 /**
@@ -1259,7 +1259,7 @@ struct GNUNET_FS_PublishContext
1259 * Set to GNUNET_YES if all processing has completed. 1259 * Set to GNUNET_YES if all processing has completed.
1260 */ 1260 */
1261 int all_done; 1261 int all_done;
1262 1262
1263 /** 1263 /**
1264 * Flag set to GNUNET_YES if the next callback from 1264 * Flag set to GNUNET_YES if the next callback from
1265 * GNUNET_FS_file_information_inspect should be skipped because it 1265 * GNUNET_FS_file_information_inspect should be skipped because it
@@ -1284,7 +1284,7 @@ enum UnindexState
1284 * the respective DBlocks and IBlocks. 1284 * the respective DBlocks and IBlocks.
1285 */ 1285 */
1286 UNINDEX_STATE_DS_REMOVE = 1, 1286 UNINDEX_STATE_DS_REMOVE = 1,
1287 1287
1288 /** 1288 /**
1289 * Find out which keywords apply. 1289 * Find out which keywords apply.
1290 */ 1290 */
@@ -1300,12 +1300,12 @@ enum UnindexState
1300 * the unindexing. 1300 * the unindexing.
1301 */ 1301 */
1302 UNINDEX_STATE_FS_NOTIFY = 4, 1302 UNINDEX_STATE_FS_NOTIFY = 4,
1303 1303
1304 /** 1304 /**
1305 * We're done. 1305 * We're done.
1306 */ 1306 */
1307 UNINDEX_STATE_COMPLETE = 5, 1307 UNINDEX_STATE_COMPLETE = 5,
1308 1308
1309 /** 1309 /**
1310 * We've encountered a fatal error. 1310 * We've encountered a fatal error.
1311 */ 1311 */
@@ -1323,7 +1323,7 @@ struct GNUNET_FS_UnindexContext
1323 * The content hash key of the last block we processed, will in the 1323 * The content hash key of the last block we processed, will in the
1324 * end be set to the CHK from the URI. Used to remove the KBlocks. 1324 * end be set to the CHK from the URI. Used to remove the KBlocks.
1325 */ 1325 */
1326 struct ContentHashKey chk; 1326 struct ContentHashKey chk;
1327 1327
1328 /** 1328 /**
1329 * Global FS context. 1329 * Global FS context.
@@ -1460,7 +1460,7 @@ struct SearchRequestEntry
1460 1460
1461 /** 1461 /**
1462 * Derived public key, hashes to 'uquery'. 1462 * Derived public key, hashes to 'uquery'.
1463 */ 1463 */
1464 struct GNUNET_CRYPTO_EccPublicSignKey dpub; 1464 struct GNUNET_CRYPTO_EccPublicSignKey dpub;
1465 1465
1466 /** 1466 /**
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index d1b6d1c39..1df07a01c 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -53,13 +53,13 @@ struct GNUNET_FS_DirScanner
53 * Second argument to helper process. 53 * Second argument to helper process.
54 */ 54 */
55 char *ex_arg; 55 char *ex_arg;
56 56
57 /** 57 /**
58 * The function that will be called every time there's a progress 58 * The function that will be called every time there's a progress
59 * message. 59 * message.
60 */ 60 */
61 GNUNET_FS_DirScannerProgressCallback progress_callback; 61 GNUNET_FS_DirScannerProgressCallback progress_callback;
62 62
63 /** 63 /**
64 * A closure for progress_callback. 64 * A closure for progress_callback.
65 */ 65 */
@@ -68,7 +68,7 @@ struct GNUNET_FS_DirScanner
68 /** 68 /**
69 * After the scan is finished, it will contain a pointer to the 69 * After the scan is finished, it will contain a pointer to the
70 * top-level directory entry in the directory tree built by the 70 * top-level directory entry in the directory tree built by the
71 * scanner. 71 * scanner.
72 */ 72 */
73 struct GNUNET_FS_ShareTreeItem *toplevel; 73 struct GNUNET_FS_ShareTreeItem *toplevel;
74 74
@@ -103,7 +103,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
103 /* terminate helper */ 103 /* terminate helper */
104 if (NULL != ds->helper) 104 if (NULL != ds->helper)
105 GNUNET_HELPER_stop (ds->helper, GNUNET_NO); 105 GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
106 106
107 /* free resources */ 107 /* free resources */
108 if (NULL != ds->toplevel) 108 if (NULL != ds->toplevel)
109 GNUNET_FS_share_tree_free (ds->toplevel); 109 GNUNET_FS_share_tree_free (ds->toplevel);
@@ -132,7 +132,7 @@ GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds)
132 GNUNET_assert (NULL == ds->helper); 132 GNUNET_assert (NULL == ds->helper);
133 /* preserve result */ 133 /* preserve result */
134 result = ds->toplevel; 134 result = ds->toplevel;
135 ds->toplevel = NULL; 135 ds->toplevel = NULL;
136 GNUNET_FS_directory_scan_abort (ds); 136 GNUNET_FS_directory_scan_abort (ds);
137 return result; 137 return result;
138} 138}
@@ -149,7 +149,7 @@ static struct GNUNET_FS_ShareTreeItem *
149advance (struct GNUNET_FS_ShareTreeItem *pos) 149advance (struct GNUNET_FS_ShareTreeItem *pos)
150{ 150{
151 int moved; 151 int moved;
152 152
153 GNUNET_assert (NULL != pos); 153 GNUNET_assert (NULL != pos);
154 moved = 0; /* must not terminate, even on file, otherwise "normal" */ 154 moved = 0; /* must not terminate, even on file, otherwise "normal" */
155 while ( (pos->is_directory == GNUNET_YES) || 155 while ( (pos->is_directory == GNUNET_YES) ||
@@ -214,7 +214,7 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
214 if (NULL != parent) 214 if (NULL != parent)
215 GNUNET_CONTAINER_DLL_insert (parent->children_head, 215 GNUNET_CONTAINER_DLL_insert (parent->children_head,
216 parent->children_tail, 216 parent->children_tail,
217 chld); 217 chld);
218 return chld; 218 return chld;
219} 219}
220 220
@@ -237,9 +237,9 @@ finish_scan (void *cls,
237 GNUNET_HELPER_stop (ds->helper, GNUNET_NO); 237 GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
238 ds->helper = NULL; 238 ds->helper = NULL;
239 } 239 }
240 ds->progress_callback (ds->progress_callback_cls, 240 ds->progress_callback (ds->progress_callback_cls,
241 NULL, GNUNET_SYSERR, 241 NULL, GNUNET_SYSERR,
242 GNUNET_FS_DIRSCANNER_FINISHED); 242 GNUNET_FS_DIRSCANNER_FINISHED);
243} 243}
244 244
245 245
@@ -252,7 +252,7 @@ finish_scan (void *cls,
252 * @param msg message from the helper process 252 * @param msg message from the helper process
253 */ 253 */
254static int 254static int
255process_helper_msgs (void *cls, 255process_helper_msgs (void *cls,
256 void *client, 256 void *client,
257 const struct GNUNET_MessageHeader *msg) 257 const struct GNUNET_MessageHeader *msg)
258{ 258{
@@ -275,7 +275,7 @@ process_helper_msgs (void *cls,
275 GNUNET_break (0); 275 GNUNET_break (0);
276 break; 276 break;
277 } 277 }
278 ds->progress_callback (ds->progress_callback_cls, 278 ds->progress_callback (ds->progress_callback_cls,
279 filename, GNUNET_NO, 279 filename, GNUNET_NO,
280 GNUNET_FS_DIRSCANNER_FILE_START); 280 GNUNET_FS_DIRSCANNER_FILE_START);
281 if (NULL == ds->toplevel) 281 if (NULL == ds->toplevel)
@@ -301,7 +301,7 @@ process_helper_msgs (void *cls,
301 ds->pos = ds->pos->parent; 301 ds->pos = ds->pos->parent;
302 return GNUNET_OK; 302 return GNUNET_OK;
303 } 303 }
304 ds->progress_callback (ds->progress_callback_cls, 304 ds->progress_callback (ds->progress_callback_cls,
305 filename, GNUNET_YES, 305 filename, GNUNET_YES,
306 GNUNET_FS_DIRSCANNER_FILE_START); 306 GNUNET_FS_DIRSCANNER_FILE_START);
307 ds->pos = expand_tree (ds->pos, 307 ds->pos = expand_tree (ds->pos,
@@ -314,7 +314,7 @@ process_helper_msgs (void *cls,
314 case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE: 314 case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE:
315 if ('\0' != filename[left-1]) 315 if ('\0' != filename[left-1])
316 break; 316 break;
317 ds->progress_callback (ds->progress_callback_cls, 317 ds->progress_callback (ds->progress_callback_cls,
318 filename, GNUNET_SYSERR, 318 filename, GNUNET_SYSERR,
319 GNUNET_FS_DIRSCANNER_FILE_IGNORED); 319 GNUNET_FS_DIRSCANNER_FILE_IGNORED);
320 return GNUNET_OK; 320 return GNUNET_OK;
@@ -329,7 +329,7 @@ process_helper_msgs (void *cls,
329 GNUNET_break (0); 329 GNUNET_break (0);
330 break; 330 break;
331 } 331 }
332 ds->progress_callback (ds->progress_callback_cls, 332 ds->progress_callback (ds->progress_callback_cls,
333 NULL, GNUNET_SYSERR, 333 NULL, GNUNET_SYSERR,
334 GNUNET_FS_DIRSCANNER_ALL_COUNTED); 334 GNUNET_FS_DIRSCANNER_ALL_COUNTED);
335 ds->pos = ds->toplevel; 335 ds->pos = ds->toplevel;
@@ -340,7 +340,7 @@ process_helper_msgs (void *cls,
340 { 340 {
341 size_t nlen; 341 size_t nlen;
342 const char *end; 342 const char *end;
343 343
344 if (NULL == ds->pos) 344 if (NULL == ds->pos)
345 { 345 {
346 GNUNET_break (0); 346 GNUNET_break (0);
@@ -361,7 +361,7 @@ process_helper_msgs (void *cls,
361 GNUNET_break (0); 361 GNUNET_break (0);
362 break; 362 break;
363 } 363 }
364 ds->progress_callback (ds->progress_callback_cls, 364 ds->progress_callback (ds->progress_callback_cls,
365 filename, GNUNET_YES, 365 filename, GNUNET_YES,
366 GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); 366 GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED);
367 if (0 < left) 367 if (0 < left)
@@ -373,18 +373,18 @@ process_helper_msgs (void *cls,
373 break; 373 break;
374 } 374 }
375 /* having full filenames is too dangerous; always make sure we clean them up */ 375 /* having full filenames is too dangerous; always make sure we clean them up */
376 GNUNET_CONTAINER_meta_data_delete (ds->pos->meta, 376 GNUNET_CONTAINER_meta_data_delete (ds->pos->meta,
377 EXTRACTOR_METATYPE_FILENAME, 377 EXTRACTOR_METATYPE_FILENAME,
378 NULL, 0); 378 NULL, 0);
379 /* instead, put in our 'safer' original filename */ 379 /* instead, put in our 'safer' original filename */
380 GNUNET_CONTAINER_meta_data_insert (ds->pos->meta, "<libgnunetfs>", 380 GNUNET_CONTAINER_meta_data_insert (ds->pos->meta, "<libgnunetfs>",
381 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, 381 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
382 EXTRACTOR_METAFORMAT_UTF8, "text/plain", 382 EXTRACTOR_METAFORMAT_UTF8, "text/plain",
383 ds->pos->short_filename, 383 ds->pos->short_filename,
384 strlen (ds->pos->short_filename) + 1); 384 strlen (ds->pos->short_filename) + 1);
385 } 385 }
386 ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta); 386 ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta);
387 ds->pos = advance (ds->pos); 387 ds->pos = advance (ds->pos);
388 return GNUNET_OK; 388 return GNUNET_OK;
389 } 389 }
390 case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED: 390 case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED:
@@ -397,7 +397,7 @@ process_helper_msgs (void *cls,
397 { 397 {
398 GNUNET_break (0); 398 GNUNET_break (0);
399 break; 399 break;
400 } 400 }
401 if (NULL == ds->toplevel) 401 if (NULL == ds->toplevel)
402 { 402 {
403 GNUNET_break (0); 403 GNUNET_break (0);
@@ -410,7 +410,7 @@ process_helper_msgs (void *cls,
410 GNUNET_break (0); 410 GNUNET_break (0);
411 break; 411 break;
412 } 412 }
413 ds->progress_callback (ds->progress_callback_cls, 413 ds->progress_callback (ds->progress_callback_cls,
414 NULL, GNUNET_SYSERR, 414 NULL, GNUNET_SYSERR,
415 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); 415 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR);
416 return GNUNET_OK; 416 return GNUNET_OK;
@@ -430,9 +430,9 @@ helper_died_cb (void *cls)
430 ds->helper = NULL; 430 ds->helper = NULL;
431 if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) 431 if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
432 return; /* normal death, was finished */ 432 return; /* normal death, was finished */
433 ds->progress_callback (ds->progress_callback_cls, 433 ds->progress_callback (ds->progress_callback_cls,
434 NULL, GNUNET_SYSERR, 434 NULL, GNUNET_SYSERR,
435 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); 435 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR);
436} 436}
437 437
438 438
@@ -449,7 +449,7 @@ helper_died_cb (void *cls)
449struct GNUNET_FS_DirScanner * 449struct GNUNET_FS_DirScanner *
450GNUNET_FS_directory_scan_start (const char *filename, 450GNUNET_FS_directory_scan_start (const char *filename,
451 int disable_extractor, const char *ex, 451 int disable_extractor, const char *ex,
452 GNUNET_FS_DirScannerProgressCallback cb, 452 GNUNET_FS_DirScannerProgressCallback cb,
453 void *cb_cls) 453 void *cb_cls)
454{ 454{
455 struct stat sbuf; 455 struct stat sbuf;
@@ -468,9 +468,9 @@ GNUNET_FS_directory_scan_start (const char *filename,
468 ds->progress_callback = cb; 468 ds->progress_callback = cb;
469 ds->progress_callback_cls = cb_cls; 469 ds->progress_callback_cls = cb_cls;
470 ds->filename_expanded = filename_expanded; 470 ds->filename_expanded = filename_expanded;
471 if (disable_extractor) 471 if (disable_extractor)
472 ds->ex_arg = GNUNET_strdup ("-"); 472 ds->ex_arg = GNUNET_strdup ("-");
473 else 473 else
474 ds->ex_arg = (NULL != ex) ? GNUNET_strdup (ex) : NULL; 474 ds->ex_arg = (NULL != ex) ? GNUNET_strdup (ex) : NULL;
475 ds->args[0] = "gnunet-helper-fs-publish"; 475 ds->args[0] = "gnunet-helper-fs-publish";
476 ds->args[1] = ds->filename_expanded; 476 ds->args[1] = ds->filename_expanded;
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 49c83bdc6..070be0106 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -690,7 +690,7 @@ try_top_down_reconstruction (struct GNUNET_FS_DownloadContext *dc,
690 drc = dr->children[i]; 690 drc = dr->children[i];
691 GNUNET_assert (drc->offset >= dr->offset); 691 GNUNET_assert (drc->offset >= dr->offset);
692 child_block_size = GNUNET_FS_tree_compute_tree_size (drc->depth); 692 child_block_size = GNUNET_FS_tree_compute_tree_size (drc->depth);
693 GNUNET_assert (0 == (drc->offset - dr->offset) % child_block_size); 693 GNUNET_assert (0 == (drc->offset - dr->offset) % child_block_size);
694 if (BRS_INIT == drc->state) 694 if (BRS_INIT == drc->state)
695 { 695 {
696 drc->state = BRS_CHK_SET; 696 drc->state = BRS_CHK_SET;
@@ -1083,7 +1083,7 @@ process_result_with_request (void *cls, const struct GNUNET_HashCode * key,
1083 pi.value.download.specifics.progress.respect_offered = prc->respect_offered; 1083 pi.value.download.specifics.progress.respect_offered = prc->respect_offered;
1084 pi.value.download.specifics.progress.num_transmissions = prc->num_transmissions; 1084 pi.value.download.specifics.progress.num_transmissions = prc->num_transmissions;
1085 if (prc->last_transmission.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) 1085 if (prc->last_transmission.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us)
1086 pi.value.download.specifics.progress.block_download_duration 1086 pi.value.download.specifics.progress.block_download_duration
1087 = GNUNET_TIME_absolute_get_duration (prc->last_transmission); 1087 = GNUNET_TIME_absolute_get_duration (prc->last_transmission);
1088 else 1088 else
1089 pi.value.download.specifics.progress.block_download_duration 1089 pi.value.download.specifics.progress.block_download_duration
@@ -1445,7 +1445,7 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc)
1445 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will try to reconnect in %s\n", 1445 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will try to reconnect in %s\n",
1446 GNUNET_STRINGS_relative_time_to_string (dc->reconnect_backoff, GNUNET_YES)); 1446 GNUNET_STRINGS_relative_time_to_string (dc->reconnect_backoff, GNUNET_YES));
1447 dc->task = 1447 dc->task =
1448 GNUNET_SCHEDULER_add_delayed (dc->reconnect_backoff, 1448 GNUNET_SCHEDULER_add_delayed (dc->reconnect_backoff,
1449 &do_reconnect, 1449 &do_reconnect,
1450 dc); 1450 dc);
1451} 1451}
@@ -1539,7 +1539,7 @@ deactivate_fs_download (void *cls)
1539 * the specified depth 1539 * the specified depth
1540 */ 1540 */
1541static struct DownloadRequest * 1541static struct DownloadRequest *
1542create_download_request (struct DownloadRequest *parent, 1542create_download_request (struct DownloadRequest *parent,
1543 unsigned int chk_idx, 1543 unsigned int chk_idx,
1544 unsigned int depth, 1544 unsigned int depth,
1545 uint64_t dr_offset, uint64_t file_start_offset, 1545 uint64_t dr_offset, uint64_t file_start_offset,
@@ -1558,7 +1558,7 @@ create_download_request (struct DownloadRequest *parent,
1558 if (0 == depth) 1558 if (0 == depth)
1559 return dr; 1559 return dr;
1560 child_block_size = GNUNET_FS_tree_compute_tree_size (depth - 1); 1560 child_block_size = GNUNET_FS_tree_compute_tree_size (depth - 1);
1561 1561
1562 /* calculate how many blocks at this level are not interesting 1562 /* calculate how many blocks at this level are not interesting
1563 * from the start (rounded down), either because of the requested 1563 * from the start (rounded down), either because of the requested
1564 * file offset or because this IBlock is further along */ 1564 * file offset or because this IBlock is further along */
@@ -1570,7 +1570,7 @@ create_download_request (struct DownloadRequest *parent,
1570 { 1570 {
1571 head_skip = 0; 1571 head_skip = 0;
1572 } 1572 }
1573 1573
1574 /* calculate index of last block at this level that is interesting (rounded up) */ 1574 /* calculate index of last block at this level that is interesting (rounded up) */
1575 dr->num_children = (file_start_offset + desired_length - dr_offset) / child_block_size; 1575 dr->num_children = (file_start_offset + desired_length - dr_offset) / child_block_size;
1576 if (dr->num_children * child_block_size < 1576 if (dr->num_children * child_block_size <
@@ -1585,12 +1585,12 @@ create_download_request (struct DownloadRequest *parent,
1585 (unsigned long long) dr_offset, 1585 (unsigned long long) dr_offset,
1586 depth, 1586 depth,
1587 dr->num_children); 1587 dr->num_children);
1588 1588
1589 /* now we can get the total number of *interesting* children for this block */ 1589 /* now we can get the total number of *interesting* children for this block */
1590 1590
1591 /* why else would we have gotten here to begin with? (that'd be a bad logic error) */ 1591 /* why else would we have gotten here to begin with? (that'd be a bad logic error) */
1592 GNUNET_assert (dr->num_children > 0); 1592 GNUNET_assert (dr->num_children > 0);
1593 1593
1594 dr->children = 1594 dr->children =
1595 GNUNET_malloc (dr->num_children * sizeof (struct DownloadRequest *)); 1595 GNUNET_malloc (dr->num_children * sizeof (struct DownloadRequest *));
1596 for (i = 0; i < dr->num_children; i++) 1596 for (i = 0; i < dr->num_children; i++)
@@ -1616,7 +1616,7 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1616{ 1616{
1617 struct GNUNET_FS_DownloadContext *dc = cls; 1617 struct GNUNET_FS_DownloadContext *dc = cls;
1618 1618
1619 /* clean up state from tree encoder */ 1619 /* clean up state from tree encoder */
1620 if (dc->task != GNUNET_SCHEDULER_NO_TASK) 1620 if (dc->task != GNUNET_SCHEDULER_NO_TASK)
1621 { 1621 {
1622 GNUNET_SCHEDULER_cancel (dc->task); 1622 GNUNET_SCHEDULER_cancel (dc->task);
@@ -1965,7 +1965,7 @@ GNUNET_FS_download_start_task_ (void *cls,
1965 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1965 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1966 "Trying bottom-up reconstruction of file `%s'\n", dc->filename); 1966 "Trying bottom-up reconstruction of file `%s'\n", dc->filename);
1967 dc->te = 1967 dc->te =
1968 GNUNET_FS_tree_encoder_create (dc->h, 1968 GNUNET_FS_tree_encoder_create (dc->h,
1969 GNUNET_FS_uri_chk_get_file_size (dc->uri), 1969 GNUNET_FS_uri_chk_get_file_size (dc->uri),
1970 dc, &fh_reader, 1970 dc, &fh_reader,
1971 &reconstruct_cb, NULL, 1971 &reconstruct_cb, NULL,
@@ -2116,7 +2116,7 @@ create_download_context (struct GNUNET_FS_Handle *h,
2116 else 2116 else
2117 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp"); 2117 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp");
2118 } 2118 }
2119 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2119 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2120 "Starting download `%s' of %llu bytes with tree depth %u\n", 2120 "Starting download `%s' of %llu bytes with tree depth %u\n",
2121 filename, 2121 filename,
2122 (unsigned long long) length, 2122 (unsigned long long) length,
@@ -2267,7 +2267,7 @@ GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc)
2267 GNUNET_FS_queue_ (dc->h, &activate_fs_download, &deactivate_fs_download, 2267 GNUNET_FS_queue_ (dc->h, &activate_fs_download, &deactivate_fs_download,
2268 dc, (dc->length + DBLOCK_SIZE - 1) / DBLOCK_SIZE, 2268 dc, (dc->length + DBLOCK_SIZE - 1) / DBLOCK_SIZE,
2269 (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE)) 2269 (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE))
2270 ? GNUNET_FS_QUEUE_PRIORITY_NORMAL 2270 ? GNUNET_FS_QUEUE_PRIORITY_NORMAL
2271 : GNUNET_FS_QUEUE_PRIORITY_PROBE); 2271 : GNUNET_FS_QUEUE_PRIORITY_PROBE);
2272 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2272 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2273 "Download %p put into queue as job %p\n", 2273 "Download %p put into queue as job %p\n",
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 2fe1de7e2..f4cd82978 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -147,9 +147,9 @@ get_update_information_directory (struct GNUNET_FS_Handle *h,
147 GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); 147 GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc);
148 GNUNET_CRYPTO_hash_to_enc (&hc, 148 GNUNET_CRYPTO_hash_to_enc (&hc,
149 &enc); 149 &enc);
150 GNUNET_asprintf (&ret, "%s%s%s", 150 GNUNET_asprintf (&ret, "%s%s%s",
151 dn, 151 dn,
152 DIR_SEPARATOR_STR, 152 DIR_SEPARATOR_STR,
153 (const char *) enc.encoding); 153 (const char *) enc.encoding);
154 GNUNET_free (dn); 154 GNUNET_free (dn);
155 return ret; 155 return ret;
@@ -158,7 +158,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h,
158 158
159/** 159/**
160 * Release memory occupied by UIG datastructure. 160 * Release memory occupied by UIG datastructure.
161 * 161 *
162 * @param uig data structure to free 162 * @param uig data structure to free
163 */ 163 */
164static void 164static void
@@ -317,7 +317,7 @@ read_update_information_graph (struct GNUNET_FS_Handle *h,
317 END: 317 END:
318 if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) 318 if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))
319 { 319 {
320 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to read `%s': %s\n"), 320 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to read `%s': %s\n"),
321 fn, emsg); 321 fn, emsg);
322 GNUNET_free (emsg); 322 GNUNET_free (emsg);
323 } 323 }
@@ -383,7 +383,7 @@ struct GNUNET_FS_PublishSksContext
383 * @param msg error message (or NULL) 383 * @param msg error message (or NULL)
384 */ 384 */
385static void 385static void
386sks_publish_cont (void *cls, 386sks_publish_cont (void *cls,
387 const char *msg) 387 const char *msg)
388{ 388{
389 struct GNUNET_FS_PublishSksContext *psc = cls; 389 struct GNUNET_FS_PublishSksContext *psc = cls;
@@ -405,7 +405,7 @@ sks_publish_cont (void *cls,
405 uig = read_update_information_graph (psc->h, 405 uig = read_update_information_graph (psc->h,
406 &psc->ns); 406 &psc->ns);
407 GNUNET_array_append (uig->update_nodes, 407 GNUNET_array_append (uig->update_nodes,
408 uig->update_node_count, 408 uig->update_node_count,
409 psc->nsn); 409 psc->nsn);
410 psc->nsn = NULL; 410 psc->nsn = NULL;
411 write_update_information_graph (uig); 411 write_update_information_graph (uig);
@@ -549,16 +549,16 @@ struct ProcessUpdateClosure
549 * GNUNET_NO if not. 549 * GNUNET_NO if not.
550 */ 550 */
551static int 551static int
552process_update_node (void *cls, 552process_update_node (void *cls,
553 const struct GNUNET_HashCode *key, 553 const struct GNUNET_HashCode *key,
554 void *value) 554 void *value)
555{ 555{
556 struct ProcessUpdateClosure *pc = cls; 556 struct ProcessUpdateClosure *pc = cls;
557 struct NamespaceUpdateNode *nsn = value; 557 struct NamespaceUpdateNode *nsn = value;
558 558
559 pc->ip (pc->ip_cls, 559 pc->ip (pc->ip_cls,
560 nsn->id, 560 nsn->id,
561 nsn->uri, 561 nsn->uri,
562 nsn->md, 562 nsn->md,
563 nsn->update); 563 nsn->update);
564 return GNUNET_YES; 564 return GNUNET_YES;
@@ -619,7 +619,7 @@ struct FindTreeClosure
619 */ 619 */
620static int 620static int
621find_trees (void *cls, 621find_trees (void *cls,
622 const struct GNUNET_HashCode *key, 622 const struct GNUNET_HashCode *key,
623 void *value) 623 void *value)
624{ 624{
625 struct FindTreeClosure *fc = cls; 625 struct FindTreeClosure *fc = cls;
@@ -780,7 +780,7 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
780 fc.tree_array[fc.id] = nsn; 780 fc.tree_array[fc.id] = nsn;
781 nsn->tree_id = fc.id; 781 nsn->tree_id = fc.id;
782 } 782 }
783 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 783 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
784 "TREE of node `%s' is %u\n", nsn->id, 784 "TREE of node `%s' is %u\n", nsn->id,
785 fc.id); 785 fc.id);
786 } 786 }
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 0d2dae283..387ede6a1 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -112,7 +112,7 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
112 * @param msg error message (or NULL) 112 * @param msg error message (or NULL)
113 */ 113 */
114static void 114static void
115ds_put_cont (void *cls, int success, 115ds_put_cont (void *cls, int success,
116 struct GNUNET_TIME_Absolute min_expiration, 116 struct GNUNET_TIME_Absolute min_expiration,
117 const char *msg) 117 const char *msg)
118{ 118{
@@ -206,14 +206,14 @@ signal_publish_error (struct GNUNET_FS_FileInformation *p,
206 * @param msg error message (typically NULL, not used) 206 * @param msg error message (typically NULL, not used)
207 */ 207 */
208static void 208static void
209finish_release_reserve (void *cls, int success, 209finish_release_reserve (void *cls, int success,
210 struct GNUNET_TIME_Absolute min_expiration, 210 struct GNUNET_TIME_Absolute min_expiration,
211 const char *msg) 211 const char *msg)
212{ 212{
213 struct GNUNET_FS_PublishContext *pc = cls; 213 struct GNUNET_FS_PublishContext *pc = cls;
214 214
215 pc->qre = NULL; 215 pc->qre = NULL;
216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
217 "Releasing reserve done!\n"); 217 "Releasing reserve done!\n");
218 signal_publish_completion (pc->fi, pc); 218 signal_publish_completion (pc->fi, pc);
219 pc->all_done = GNUNET_YES; 219 pc->all_done = GNUNET_YES;
@@ -268,8 +268,8 @@ publish_sblock (struct GNUNET_FS_PublishContext *pc)
268{ 268{
269 if (NULL != pc->ns) 269 if (NULL != pc->ns)
270 pc->sks_pc = GNUNET_FS_publish_sks (pc->h, 270 pc->sks_pc = GNUNET_FS_publish_sks (pc->h,
271 pc->ns, 271 pc->ns,
272 pc->nid, 272 pc->nid,
273 pc->nuid, 273 pc->nuid,
274 pc->fi->meta, 274 pc->fi->meta,
275 pc->fi->chk_uri, 275 pc->fi->chk_uri,
@@ -300,7 +300,7 @@ publish_kblocks_cont (void *cls, const struct GNUNET_FS_Uri *uri,
300 pc->ksk_pc = NULL; 300 pc->ksk_pc = NULL;
301 if (NULL != emsg) 301 if (NULL != emsg)
302 { 302 {
303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
304 "Error uploading KSK blocks: %s\n", 304 "Error uploading KSK blocks: %s\n",
305 emsg); 305 emsg);
306 signal_publish_error (p, pc, emsg); 306 signal_publish_error (p, pc, emsg);
@@ -359,7 +359,7 @@ block_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
359 } 359 }
360 else 360 else
361 { 361 {
362 if (UINT64_MAX == offset) 362 if (UINT64_MAX == offset)
363 { 363 {
364 if (&GNUNET_FS_data_reader_file_ == p->data.file.reader) 364 if (&GNUNET_FS_data_reader_file_ == p->data.file.reader)
365 { 365 {
@@ -408,10 +408,10 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
408 if (NULL != emsg) 408 if (NULL != emsg)
409 { 409 {
410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
411 "Error during tree walk: %s\n", 411 "Error during tree walk: %s\n",
412 emsg); 412 emsg);
413 GNUNET_asprintf (&p->emsg, 413 GNUNET_asprintf (&p->emsg,
414 _("Publishing failed: %s"), 414 _("Publishing failed: %s"),
415 emsg); 415 emsg);
416 GNUNET_free (emsg); 416 GNUNET_free (emsg);
417 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR; 417 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR;
@@ -603,7 +603,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc)
603 GNUNET_FS_file_information_sync_ (p); 603 GNUNET_FS_file_information_sync_ (p);
604 } 604 }
605 size = (GNUNET_YES == p->is_directory) ? p->data.dir.dir_size : p->data.file.file_size; 605 size = (GNUNET_YES == p->is_directory) ? p->data.dir.dir_size : p->data.file.file_size;
606 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 606 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
607 "Creating tree encoder\n"); 607 "Creating tree encoder\n");
608 p->te = 608 p->te =
609 GNUNET_FS_tree_encoder_create (pc->h, size, pc, &block_reader, 609 GNUNET_FS_tree_encoder_create (pc->h, size, pc, &block_reader,
@@ -625,7 +625,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc)
625 * @param msg the response we got 625 * @param msg the response we got
626 */ 626 */
627static void 627static void
628process_index_start_response (void *cls, 628process_index_start_response (void *cls,
629 const struct GNUNET_MessageHeader *msg) 629 const struct GNUNET_MessageHeader *msg)
630{ 630{
631 struct GNUNET_FS_PublishContext *pc = cls; 631 struct GNUNET_FS_PublishContext *pc = cls;
@@ -696,7 +696,7 @@ hash_for_index_cb (void *cls,
696 { 696 {
697 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 697 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
698 _("Can not index file `%s': %s. Will try to insert instead.\n"), 698 _("Can not index file `%s': %s. Will try to insert instead.\n"),
699 p->filename, 699 p->filename,
700 _("failed to compute hash")); 700 _("failed to compute hash"));
701 p->data.file.do_index = GNUNET_NO; 701 p->data.file.do_index = GNUNET_NO;
702 GNUNET_FS_file_information_sync_ (p); 702 GNUNET_FS_file_information_sync_ (p);
@@ -741,7 +741,7 @@ hash_for_index_cb (void *cls,
741 { 741 {
742 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 742 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
743 _("Can not index file `%s': %s. Will try to insert instead.\n"), 743 _("Can not index file `%s': %s. Will try to insert instead.\n"),
744 p->filename, 744 p->filename,
745 _("could not connect to `fs' service")); 745 _("could not connect to `fs' service"));
746 p->data.file.do_index = GNUNET_NO; 746 p->data.file.do_index = GNUNET_NO;
747 publish_content (pc); 747 publish_content (pc);
@@ -810,8 +810,8 @@ GNUNET_FS_publish_main_ (void *cls,
810 return; 810 return;
811 } 811 }
812 /* find starting position */ 812 /* find starting position */
813 while ( (GNUNET_YES == p->is_directory) && 813 while ( (GNUNET_YES == p->is_directory) &&
814 (NULL != p->data.dir.entries) && 814 (NULL != p->data.dir.entries) &&
815 (NULL == p->emsg) && 815 (NULL == p->emsg) &&
816 (NULL == p->data.dir.entries->chk_uri) ) 816 (NULL == p->data.dir.entries->chk_uri) )
817 { 817 {
@@ -822,8 +822,8 @@ GNUNET_FS_publish_main_ (void *cls,
822 /* abort on error */ 822 /* abort on error */
823 if (NULL != p->emsg) 823 if (NULL != p->emsg)
824 { 824 {
825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
826 "Error uploading: %s\n", 826 "Error uploading: %s\n",
827 p->emsg); 827 p->emsg);
828 /* error with current file, abort all 828 /* error with current file, abort all
829 * related files as well! */ 829 * related files as well! */
@@ -928,9 +928,9 @@ fip_signal_start (void *cls,
928 struct GNUNET_FS_FileInformation *fi, 928 struct GNUNET_FS_FileInformation *fi,
929 uint64_t length, 929 uint64_t length,
930 struct GNUNET_CONTAINER_MetaData *meta, 930 struct GNUNET_CONTAINER_MetaData *meta,
931 struct GNUNET_FS_Uri **uri, 931 struct GNUNET_FS_Uri **uri,
932 struct GNUNET_FS_BlockOptions *bo, 932 struct GNUNET_FS_BlockOptions *bo,
933 int *do_index, 933 int *do_index,
934 void **client_info) 934 void **client_info)
935{ 935{
936 struct GNUNET_FS_PublishContext *pc = cls; 936 struct GNUNET_FS_PublishContext *pc = cls;
@@ -1013,7 +1013,7 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi,
1013 GNUNET_FS_publish_sks_cancel (pc->sks_pc); 1013 GNUNET_FS_publish_sks_cancel (pc->sks_pc);
1014 pc->sks_pc = NULL; 1014 pc->sks_pc = NULL;
1015 } 1015 }
1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1017 "Suspending publish operation\n"); 1017 "Suspending publish operation\n");
1018 GNUNET_free_non_null (fi->serialization); 1018 GNUNET_free_non_null (fi->serialization);
1019 fi->serialization = NULL; 1019 fi->serialization = NULL;
@@ -1051,10 +1051,10 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi,
1051static int 1051static int
1052fip_signal_suspend (void *cls, 1052fip_signal_suspend (void *cls,
1053 struct GNUNET_FS_FileInformation *fi, 1053 struct GNUNET_FS_FileInformation *fi,
1054 uint64_t length, 1054 uint64_t length,
1055 struct GNUNET_CONTAINER_MetaData *meta, 1055 struct GNUNET_CONTAINER_MetaData *meta,
1056 struct GNUNET_FS_Uri **uri, 1056 struct GNUNET_FS_Uri **uri,
1057 struct GNUNET_FS_BlockOptions *bo, 1057 struct GNUNET_FS_BlockOptions *bo,
1058 int *do_index, 1058 int *do_index,
1059 void **client_info) 1059 void **client_info)
1060{ 1060{
@@ -1112,7 +1112,7 @@ GNUNET_FS_publish_signal_suspend_ (void *cls)
1112 * @param msg error message on error, otherwise NULL 1112 * @param msg error message on error, otherwise NULL
1113 */ 1113 */
1114static void 1114static void
1115finish_reserve (void *cls, int success, 1115finish_reserve (void *cls, int success,
1116 struct GNUNET_TIME_Absolute min_expiration, 1116 struct GNUNET_TIME_Absolute min_expiration,
1117 const char *msg) 1117 const char *msg)
1118{ 1118{
@@ -1122,7 +1122,7 @@ finish_reserve (void *cls, int success,
1122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", success); 1122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", success);
1123 if ((msg != NULL) || (success <= 0)) 1123 if ((msg != NULL) || (success <= 0))
1124 { 1124 {
1125 GNUNET_asprintf (&pc->fi->emsg, 1125 GNUNET_asprintf (&pc->fi->emsg,
1126 _("Insufficient space for publishing: %s"), 1126 _("Insufficient space for publishing: %s"),
1127 msg); 1127 msg);
1128 signal_publish_error (pc->fi, pc, pc->fi->emsg); 1128 signal_publish_error (pc->fi, pc, pc->fi->emsg);
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index f844217e8..6aac94011 100644
--- a/src/fs/fs_publish_ksk.c
+++ b/src/fs/fs_publish_ksk.c
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file fs/fs_publish_ksk.c 22 * @file fs/fs_publish_ksk.c
23 * @brief publish a URI under a keyword in GNUnet 23 * @brief publish a URI under a keyword in GNUnet
24 * @see https://gnunet.org/encoding and #2564 24 * @see https://gnunet.org/encoding and #2564
25 * @author Krista Bennett 25 * @author Krista Bennett
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 */ 27 */
@@ -93,7 +93,7 @@ struct GNUNET_FS_PublishKskContext
93 93
94 /** 94 /**
95 * Options to use. 95 * Options to use.
96 */ 96 */
97 enum GNUNET_FS_PublishOptions options; 97 enum GNUNET_FS_PublishOptions options;
98 98
99 /** 99 /**
@@ -113,7 +113,7 @@ struct GNUNET_FS_PublishKskContext
113 * @param tc unused 113 * @param tc unused
114 */ 114 */
115static void 115static void
116publish_ksk_cont (void *cls, 116publish_ksk_cont (void *cls,
117 const struct GNUNET_SCHEDULER_TaskContext *tc); 117 const struct GNUNET_SCHEDULER_TaskContext *tc);
118 118
119 119
@@ -133,7 +133,7 @@ kb_put_cont (void *cls,
133 pkc->uc = NULL; 133 pkc->uc = NULL;
134 if (NULL != msg) 134 if (NULL != msg)
135 { 135 {
136 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 136 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
137 "KBlock PUT operation failed: %s\n", msg); 137 "KBlock PUT operation failed: %s\n", msg);
138 pkc->cont (pkc->cont_cls, NULL, msg); 138 pkc->cont (pkc->cont_cls, NULL, msg);
139 GNUNET_FS_publish_ksk_cancel (pkc); 139 GNUNET_FS_publish_ksk_cancel (pkc);
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index c84b21ba8..18f4804d1 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file fs/fs_publish_ublock.c 22 * @file fs/fs_publish_ublock.c
23 * @brief publish a UBLOCK in GNUnet 23 * @brief publish a UBLOCK in GNUnet
24 * @see https://gnunet.org/encoding and #2564 24 * @see https://gnunet.org/encoding and #2564
25 * @author Krista Bennett 25 * @author Krista Bennett
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 */ 27 */
@@ -41,7 +41,7 @@
41 * @param iv where to store the IV 41 * @param iv where to store the IV
42 * @param label label to use for key derivation 42 * @param label label to use for key derivation
43 * @param pub public key to use for key derivation 43 * @param pub public key to use for key derivation
44 */ 44 */
45static void 45static void
46derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, 46derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
47 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, 47 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
@@ -69,7 +69,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
69 * @param ns public key under which the UBlock was stored 69 * @param ns public key under which the UBlock was stored
70 * @param label label under which the UBlock was stored 70 * @param label label under which the UBlock was stored
71 * @param output where to write the result, has input_len bytes 71 * @param output where to write the result, has input_len bytes
72 */ 72 */
73void 73void
74GNUNET_FS_ublock_decrypt_ (const void *input, 74GNUNET_FS_ublock_decrypt_ (const void *input,
75 size_t input_len, 75 size_t input_len,
@@ -124,7 +124,7 @@ struct GNUNET_FS_PublishUblockContext
124 * @param msg NULL on success, otherwise an error message 124 * @param msg NULL on success, otherwise an error message
125 */ 125 */
126static void 126static void
127ublock_put_cont (void *cls, 127ublock_put_cont (void *cls,
128 int32_t success, 128 int32_t success,
129 struct GNUNET_TIME_Absolute min_expiration, 129 struct GNUNET_TIME_Absolute min_expiration,
130 const char *msg) 130 const char *msg)
@@ -221,7 +221,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
221 } 221 }
222 size = sizeof (struct UBlock) + slen + mdsize + ulen; 222 size = sizeof (struct UBlock) + slen + mdsize + ulen;
223 223
224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
225 "Publishing under identifier `%s'\n", 225 "Publishing under identifier `%s'\n",
226 label); 226 label);
227 /* get public key of the namespace */ 227 /* get public key of the namespace */
@@ -232,11 +232,11 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
232 232
233 /* encrypt ublock */ 233 /* encrypt ublock */
234 ub_enc = GNUNET_malloc (size); 234 ub_enc = GNUNET_malloc (size);
235 GNUNET_CRYPTO_symmetric_encrypt (&ub_plain[1], 235 GNUNET_CRYPTO_symmetric_encrypt (&ub_plain[1],
236 ulen + slen + mdsize, 236 ulen + slen + mdsize,
237 &skey, &iv, 237 &skey, &iv,
238 &ub_enc[1]); 238 &ub_enc[1]);
239 ub_enc->purpose.size = htonl (ulen + slen + mdsize + 239 ub_enc->purpose.size = htonl (ulen + slen + mdsize +
240 sizeof (struct UBlock) 240 sizeof (struct UBlock)
241 - sizeof (struct GNUNET_CRYPTO_EccSignature)); 241 - sizeof (struct GNUNET_CRYPTO_EccSignature));
242 ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); 242 ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK);
diff --git a/src/fs/fs_publish_ublock.h b/src/fs/fs_publish_ublock.h
index 1a7d338d2..ed8d599a8 100644
--- a/src/fs/fs_publish_ublock.h
+++ b/src/fs/fs_publish_ublock.h
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file fs/fs_publish_ublock.h 22 * @file fs/fs_publish_ublock.h
23 * @brief publish a UBLOCK in GNUnet 23 * @brief publish a UBLOCK in GNUnet
24 * @see https://gnunet.org/encoding and #2564 24 * @see https://gnunet.org/encoding and #2564
25 * @author Krista Bennett 25 * @author Krista Bennett
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 */ 27 */
@@ -42,7 +42,7 @@
42 * @param ns public key under which the UBlock was stored 42 * @param ns public key under which the UBlock was stored
43 * @param label label under which the UBlock was stored 43 * @param label label under which the UBlock was stored
44 * @param output where to write the result, has input_len bytes 44 * @param output where to write the result, has input_len bytes
45 */ 45 */
46void 46void
47GNUNET_FS_ublock_decrypt_ (const void *input, 47GNUNET_FS_ublock_decrypt_ (const void *input,
48 size_t input_len, 48 size_t input_len,
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 2e09c1e22..7a869b4c5 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -54,11 +54,11 @@ GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
54 pi->value.search.sc = sc; 54 pi->value.search.sc = sc;
55 pi->value.search.cctx = (NULL != sc) ? sc->client_info : NULL; 55 pi->value.search.cctx = (NULL != sc) ? sc->client_info : NULL;
56 pi->value.search.pctx = 56 pi->value.search.pctx =
57 ((NULL == sc) || (NULL == sc->psearch_result)) 57 ((NULL == sc) || (NULL == sc->psearch_result))
58 ? NULL 58 ? NULL
59 : sc->psearch_result->client_info; 59 : sc->psearch_result->client_info;
60 pi->value.search.query = (NULL != sc) ? sc->uri : NULL; 60 pi->value.search.query = (NULL != sc) ? sc->uri : NULL;
61 pi->value.search.duration = (NULL != sc) 61 pi->value.search.duration = (NULL != sc)
62 ? GNUNET_TIME_absolute_get_duration (sc->start_time) 62 ? GNUNET_TIME_absolute_get_duration (sc->start_time)
63 : GNUNET_TIME_UNIT_ZERO; 63 : GNUNET_TIME_UNIT_ZERO;
64 pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0; 64 pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0;
@@ -125,7 +125,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc,
125 struct GNUNET_FS_SearchResult *sr) 125 struct GNUNET_FS_SearchResult *sr)
126{ 126{
127 struct GNUNET_FS_ProgressInfo pi; 127 struct GNUNET_FS_ProgressInfo pi;
128 128
129 pi.status = GNUNET_FS_STATUS_SEARCH_UPDATE; 129 pi.status = GNUNET_FS_STATUS_SEARCH_UPDATE;
130 pi.value.search.specifics.update.cctx = sr->client_info; 130 pi.value.search.specifics.update.cctx = sr->client_info;
131 pi.value.search.specifics.update.meta = sr->meta; 131 pi.value.search.specifics.update.meta = sr->meta;
@@ -135,7 +135,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc,
135 pi.value.search.specifics.update.availability_certainty = 135 pi.value.search.specifics.update.availability_certainty =
136 sr->availability_trials; 136 sr->availability_trials;
137 pi.value.search.specifics.update.applicability_rank = sr->optional_support; 137 pi.value.search.specifics.update.applicability_rank = sr->optional_support;
138 pi.value.search.specifics.update.current_probe_time 138 pi.value.search.specifics.update.current_probe_time
139 = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); 139 = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
140 sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); 140 sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
141} 141}
@@ -194,12 +194,12 @@ signal_probe_result (struct GNUNET_FS_SearchResult *sr)
194 pi.value.search.specifics.update.cctx = sr->client_info; 194 pi.value.search.specifics.update.cctx = sr->client_info;
195 pi.value.search.specifics.update.meta = sr->meta; 195 pi.value.search.specifics.update.meta = sr->meta;
196 pi.value.search.specifics.update.uri = sr->uri; 196 pi.value.search.specifics.update.uri = sr->uri;
197 pi.value.search.specifics.update.availability_rank 197 pi.value.search.specifics.update.availability_rank
198 = 2 * sr->availability_success - sr->availability_trials; 198 = 2 * sr->availability_success - sr->availability_trials;
199 pi.value.search.specifics.update.availability_certainty 199 pi.value.search.specifics.update.availability_certainty
200 = sr->availability_trials; 200 = sr->availability_trials;
201 pi.value.search.specifics.update.applicability_rank = sr->optional_support; 201 pi.value.search.specifics.update.applicability_rank = sr->optional_support;
202 pi.value.search.specifics.update.current_probe_time 202 pi.value.search.specifics.update.current_probe_time
203 = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); 203 = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
204 sr->client_info = GNUNET_FS_search_make_status_ (&pi, sr->h, sr->sc); 204 sr->client_info = GNUNET_FS_search_make_status_ (&pi, sr->h, sr->sc);
205 GNUNET_FS_search_start_probe_ (sr); 205 GNUNET_FS_search_start_probe_ (sr);
@@ -380,7 +380,7 @@ probe_ping_task (void *cls,
380 struct GNUNET_FS_SearchResult *sr = cls; 380 struct GNUNET_FS_SearchResult *sr = cls;
381 381
382 signal_probe_result (sr); 382 signal_probe_result (sr);
383 sr->probe_ping_task 383 sr->probe_ping_task
384 = GNUNET_SCHEDULER_add_delayed (GNUNET_FS_PROBE_UPDATE_FREQUENCY, 384 = GNUNET_SCHEDULER_add_delayed (GNUNET_FS_PROBE_UPDATE_FREQUENCY,
385 &probe_ping_task, 385 &probe_ping_task,
386 sr); 386 sr);
@@ -434,7 +434,7 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr)
434 len, sr->anonymity, 434 len, sr->anonymity,
435 GNUNET_FS_DOWNLOAD_NO_TEMPORARIES | 435 GNUNET_FS_DOWNLOAD_NO_TEMPORARIES |
436 GNUNET_FS_DOWNLOAD_IS_PROBE, sr, NULL); 436 GNUNET_FS_DOWNLOAD_IS_PROBE, sr, NULL);
437 sr->probe_ping_task 437 sr->probe_ping_task
438 = GNUNET_SCHEDULER_add_now (&probe_ping_task, 438 = GNUNET_SCHEDULER_add_now (&probe_ping_task,
439 sr); 439 sr);
440} 440}
@@ -465,7 +465,7 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
465 sr->uri = GNUNET_FS_uri_dup (uri); 465 sr->uri = GNUNET_FS_uri_dup (uri);
466 sr->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); 466 sr->meta = GNUNET_CONTAINER_meta_data_duplicate (meta);
467 sr->client_info = client_info; 467 sr->client_info = client_info;
468 sr->anonymity = anonymity; 468 sr->anonymity = anonymity;
469 GNUNET_FS_search_start_probe_ (sr); 469 GNUNET_FS_search_start_probe_ (sr);
470 return sr; 470 return sr;
471} 471}
@@ -473,8 +473,8 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
473 473
474/** 474/**
475 * Stop probing activity associated with a search result. 475 * Stop probing activity associated with a search result.
476 * 476 *
477 * @param sr search result 477 * @param sr search result
478 */ 478 */
479static void 479static void
480GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr) 480GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr)
@@ -674,7 +674,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update,
674 * @param edata encrypted data 674 * @param edata encrypted data
675 * @param edata_size number of bytes in @a edata (and @a data) 675 * @param edata_size number of bytes in @a edata (and @a data)
676 * @param data where to store the plaintext 676 * @param data where to store the plaintext
677 * @return keyword index on success, #GNUNET_SYSERR on error (no such 677 * @return keyword index on success, #GNUNET_SYSERR on error (no such
678 * keyword, internal error) 678 * keyword, internal error)
679 */ 679 */
680static int 680static int
@@ -683,7 +683,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc,
683 const void *edata, 683 const void *edata,
684 size_t edata_size, 684 size_t edata_size,
685 char *data) 685 char *data)
686{ 686{
687 const struct GNUNET_CRYPTO_EccPrivateKey *anon; 687 const struct GNUNET_CRYPTO_EccPrivateKey *anon;
688 struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; 688 struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
689 unsigned int i; 689 unsigned int i;
@@ -721,7 +721,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc,
721 * @param size size of nb 721 * @param size size of nb
722 */ 722 */
723static void 723static void
724process_kblock (struct GNUNET_FS_SearchContext *sc, 724process_kblock (struct GNUNET_FS_SearchContext *sc,
725 const struct UBlock *ub, 725 const struct UBlock *ub,
726 size_t size) 726 size_t size)
727{ 727{
@@ -749,7 +749,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc,
749 if (NULL == (uri = GNUNET_FS_uri_parse (&pt[1], &emsg))) 749 if (NULL == (uri = GNUNET_FS_uri_parse (&pt[1], &emsg)))
750 { 750 {
751 GNUNET_break_op (0); /* ublock malformed */ 751 GNUNET_break_op (0); /* ublock malformed */
752 GNUNET_free_non_null (emsg); 752 GNUNET_free_non_null (emsg);
753 return; 753 return;
754 } 754 }
755 j = eos - pt + 1; 755 j = eos - pt + 1;
@@ -781,7 +781,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc,
781 * @param size size of sb 781 * @param size size of sb
782 */ 782 */
783static void 783static void
784process_sblock (struct GNUNET_FS_SearchContext *sc, 784process_sblock (struct GNUNET_FS_SearchContext *sc,
785 const struct UBlock *ub, 785 const struct UBlock *ub,
786 size_t size) 786 size_t size)
787{ 787{
@@ -811,8 +811,8 @@ process_sblock (struct GNUNET_FS_SearchContext *sc,
811 } 811 }
812 if (NULL == (uri = GNUNET_FS_uri_parse (uris, &emsg))) 812 if (NULL == (uri = GNUNET_FS_uri_parse (uris, &emsg)))
813 { 813 {
814 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 814 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
815 _("Failed to parse URI `%s': %s\n"), 815 _("Failed to parse URI `%s': %s\n"),
816 uris, emsg); 816 uris, emsg);
817 GNUNET_break_op (0); /* ublock malformed */ 817 GNUNET_break_op (0); /* ublock malformed */
818 GNUNET_free_non_null (emsg); 818 GNUNET_free_non_null (emsg);
@@ -837,9 +837,9 @@ process_sblock (struct GNUNET_FS_SearchContext *sc,
837 * @param size size of data 837 * @param size size of data
838 */ 838 */
839static void 839static void
840process_result (struct GNUNET_FS_SearchContext *sc, 840process_result (struct GNUNET_FS_SearchContext *sc,
841 enum GNUNET_BLOCK_Type type, 841 enum GNUNET_BLOCK_Type type,
842 struct GNUNET_TIME_Absolute expiration, 842 struct GNUNET_TIME_Absolute expiration,
843 const void *data, 843 const void *data,
844 size_t size) 844 size_t size)
845{ 845{
@@ -1108,7 +1108,7 @@ transmit_search_request (void *cls, size_t size, void *buf)
1108 &dpub); 1108 &dpub);
1109 GNUNET_CRYPTO_hash (&dpub, 1109 GNUNET_CRYPTO_hash (&dpub,
1110 sizeof (dpub), 1110 sizeof (dpub),
1111 &sm->query); 1111 &sm->query);
1112 mbc.put_cnt = (size - msize) / sizeof (struct GNUNET_HashCode); 1112 mbc.put_cnt = (size - msize) / sizeof (struct GNUNET_HashCode);
1113 sqms = GNUNET_CONTAINER_multihashmap_size (sc->master_result_map); 1113 sqms = GNUNET_CONTAINER_multihashmap_size (sc->master_result_map);
1114 mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt); 1114 mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt);
@@ -1206,7 +1206,7 @@ try_reconnect (struct GNUNET_FS_SearchContext *sc)
1206 } 1206 }
1207 sc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (sc->reconnect_backoff); 1207 sc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (sc->reconnect_backoff);
1208 sc->task = 1208 sc->task =
1209 GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff, 1209 GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff,
1210 &do_reconnect, 1210 &do_reconnect,
1211 sc); 1211 sc);
1212} 1212}
@@ -1293,8 +1293,8 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc)
1293 keyword, 1293 keyword,
1294 "fs-ublock", 1294 "fs-ublock",
1295 &sre->dpub); 1295 &sre->dpub);
1296 GNUNET_CRYPTO_hash (&sre->dpub, 1296 GNUNET_CRYPTO_hash (&sre->dpub,
1297 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), 1297 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
1298 &sre->uquery); 1298 &sre->uquery);
1299 sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); 1299 sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+');
1300 if (sre->mandatory) 1300 if (sre->mandatory)
diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c
index 954d450a7..c392ba1ef 100644
--- a/src/fs/fs_sharetree.c
+++ b/src/fs/fs_sharetree.c
@@ -174,7 +174,7 @@ add_to_keyword_counter (void *cls, const char *keyword, int is_mandatory)
174 cnt->value = (const char *) &cnt[1]; 174 cnt->value = (const char *) &cnt[1];
175 memcpy (&cnt[1], keyword, klen); 175 memcpy (&cnt[1], keyword, klen);
176 GNUNET_assert (GNUNET_OK == 176 GNUNET_assert (GNUNET_OK ==
177 GNUNET_CONTAINER_multihashmap_put (mcm, 177 GNUNET_CONTAINER_multihashmap_put (mcm,
178 &hc, cnt, 178 &hc, cnt,
179 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 179 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
180 } 180 }
@@ -313,7 +313,7 @@ migrate_and_drop_metadata (void *cls, const struct GNUNET_HashCode * key, void *
313 counter->type, 313 counter->type,
314 counter->format, 314 counter->format,
315 counter->data_mime_type, counter->data, 315 counter->data_mime_type, counter->data,
316 counter->data_size); 316 counter->data_size);
317 } 317 }
318 GNUNET_assert (GNUNET_YES == 318 GNUNET_assert (GNUNET_YES ==
319 GNUNET_CONTAINER_multihashmap_remove (tc->metacounter, 319 GNUNET_CONTAINER_multihashmap_remove (tc->metacounter,
@@ -350,7 +350,7 @@ share_tree_trim (struct TrimContext *tc,
350 if (tree->is_directory == GNUNET_YES) 350 if (tree->is_directory == GNUNET_YES)
351 { 351 {
352 const char *user = getenv ("USER"); 352 const char *user = getenv ("USER");
353 if ( (user == NULL) || 353 if ( (user == NULL) ||
354 (0 != strncasecmp (user, tree->short_filename, strlen(user)))) 354 (0 != strncasecmp (user, tree->short_filename, strlen(user))))
355 { 355 {
356 /* only use filename if it doesn't match $USER */ 356 /* only use filename if it doesn't match $USER */
@@ -366,12 +366,12 @@ share_tree_trim (struct TrimContext *tc,
366 366
367 if (1 >= num_children) 367 if (1 >= num_children)
368 return; /* nothing to trim */ 368 return; /* nothing to trim */
369 369
370 /* now, count keywords and meta data in children */ 370 /* now, count keywords and meta data in children */
371 for (pos = tree->children_head; NULL != pos; pos = pos->next) 371 for (pos = tree->children_head; NULL != pos; pos = pos->next)
372 { 372 {
373 if (NULL != pos->meta) 373 if (NULL != pos->meta)
374 GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter); 374 GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter);
375 if (NULL != pos->ksk_uri) 375 if (NULL != pos->ksk_uri)
376 GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &add_to_keyword_counter, tc->keywordcounter); 376 GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &add_to_keyword_counter, tc->keywordcounter);
377 } 377 }
@@ -393,10 +393,10 @@ share_tree_trim (struct TrimContext *tc,
393 393
394 /* add high-frequency meta data and keywords to parent */ 394 /* add high-frequency meta data and keywords to parent */
395 tc->pos = tree; 395 tc->pos = tree;
396 GNUNET_CONTAINER_multihashmap_iterate (tc->keywordcounter, 396 GNUNET_CONTAINER_multihashmap_iterate (tc->keywordcounter,
397 &migrate_and_drop_keywords, 397 &migrate_and_drop_keywords,
398 tc); 398 tc);
399 GNUNET_CONTAINER_multihashmap_iterate (tc->metacounter, 399 GNUNET_CONTAINER_multihashmap_iterate (tc->metacounter,
400 &migrate_and_drop_metadata, 400 &migrate_and_drop_metadata,
401 tc); 401 tc);
402} 402}
@@ -414,7 +414,7 @@ GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel)
414 struct TrimContext tc; 414 struct TrimContext tc;
415 415
416 if (toplevel == NULL) 416 if (toplevel == NULL)
417 return; 417 return;
418 tc.keywordcounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO); 418 tc.keywordcounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO);
419 tc.metacounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO); 419 tc.metacounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO);
420 share_tree_trim (&tc, toplevel); 420 share_tree_trim (&tc, toplevel);
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 0fc36e7ac..925e36a8e 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -183,16 +183,16 @@ struct TestDownloadOperation
183 * @param tc scheduler context (unused) 183 * @param tc scheduler context (unused)
184 */ 184 */
185static void 185static void
186report_uri (void *cls, 186report_uri (void *cls,
187 const struct GNUNET_SCHEDULER_TaskContext *tc) 187 const struct GNUNET_SCHEDULER_TaskContext *tc)
188{ 188{
189 struct TestPublishOperation *po = cls; 189 struct TestPublishOperation *po = cls;
190 190
191 GNUNET_FS_publish_stop (po->publish_context); 191 GNUNET_FS_publish_stop (po->publish_context);
192 GNUNET_TESTBED_operation_done (po->fs_op); 192 GNUNET_TESTBED_operation_done (po->fs_op);
193 po->publish_cont (po->publish_cont_cls, 193 po->publish_cont (po->publish_cont_cls,
194 po->publish_uri, 194 po->publish_uri,
195 (GNUNET_YES == po->do_index) 195 (GNUNET_YES == po->do_index)
196 ? po->publish_tmp_file 196 ? po->publish_tmp_file
197 : NULL); 197 : NULL);
198 GNUNET_FS_uri_destroy (po->publish_uri); 198 GNUNET_FS_uri_destroy (po->publish_uri);
@@ -272,15 +272,15 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
272 * @param cls pointer to uint32_t with publishing seed 272 * @param cls pointer to uint32_t with publishing seed
273 * @param offset offset to generate data for 273 * @param offset offset to generate data for
274 * @param max maximum number of bytes to generate 274 * @param max maximum number of bytes to generate
275 * @param buf where to write generated data 275 * @param buf where to write generated data
276 * @param emsg where to store error message (unused) 276 * @param emsg where to store error message (unused)
277 * @return number of bytes written to buf 277 * @return number of bytes written to buf
278 */ 278 */
279static size_t 279static size_t
280file_generator (void *cls, 280file_generator (void *cls,
281 uint64_t offset, 281 uint64_t offset,
282 size_t max, 282 size_t max,
283 void *buf, 283 void *buf,
284 char **emsg) 284 char **emsg)
285{ 285{
286 uint32_t *publish_seed = cls; 286 uint32_t *publish_seed = cls;
@@ -307,7 +307,7 @@ file_generator (void *cls,
307 307
308/** 308/**
309 * Connect adapter for publishing operation. 309 * Connect adapter for publishing operation.
310 * 310 *
311 * @param cls the 'struct TestPublishOperation' 311 * @param cls the 'struct TestPublishOperation'
312 * @param cfg configuration of the peer to connect to; will be available until 312 * @param cfg configuration of the peer to connect to; will be available until
313 * GNUNET_TESTBED_operation_done() is called on the operation returned 313 * GNUNET_TESTBED_operation_done() is called on the operation returned
@@ -319,7 +319,7 @@ publish_connect_adapter (void *cls,
319 const struct GNUNET_CONFIGURATION_Handle *cfg) 319 const struct GNUNET_CONFIGURATION_Handle *cfg)
320{ 320{
321 struct TestPublishOperation *po = cls; 321 struct TestPublishOperation *po = cls;
322 322
323 return GNUNET_FS_start (cfg, 323 return GNUNET_FS_start (cfg,
324 "fs-test-publish", 324 "fs-test-publish",
325 &publish_progress_cb, po, 325 &publish_progress_cb, po,
@@ -330,11 +330,11 @@ publish_connect_adapter (void *cls,
330 330
331/** 331/**
332 * Adapter function called to destroy connection to file-sharing service. 332 * Adapter function called to destroy connection to file-sharing service.
333 * 333 *
334 * @param cls the 'struct GNUNET_FS_Handle' 334 * @param cls the 'struct GNUNET_FS_Handle'
335 * @param op_result unused (different for publish/download!) 335 * @param op_result unused (different for publish/download!)
336 */ 336 */
337static void 337static void
338fs_disconnect_adapter (void *cls, 338fs_disconnect_adapter (void *cls,
339 void *op_result) 339 void *op_result)
340{ 340{
@@ -412,8 +412,8 @@ publish_fs_connect_complete_cb (void *cls,
412 else 412 else
413 { 413 {
414 fi = GNUNET_FS_file_information_create_from_reader (po->fs, po, 414 fi = GNUNET_FS_file_information_create_from_reader (po->fs, po,
415 po->size, 415 po->size,
416 &file_generator, &po->publish_seed, 416 &file_generator, &po->publish_seed,
417 NULL, NULL, 417 NULL, NULL,
418 po->do_index, &bo); 418 po->do_index, &bo);
419 } 419 }
@@ -557,7 +557,7 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
557 557
558/** 558/**
559 * Connect adapter for download operation. 559 * Connect adapter for download operation.
560 * 560 *
561 * @param cls the 'struct TestDownloadOperation' 561 * @param cls the 'struct TestDownloadOperation'
562 * @param cfg configuration of the peer to connect to; will be available until 562 * @param cfg configuration of the peer to connect to; will be available until
563 * GNUNET_TESTBED_operation_done() is called on the operation returned 563 * GNUNET_TESTBED_operation_done() is called on the operation returned
@@ -569,7 +569,7 @@ download_connect_adapter (void *cls,
569 const struct GNUNET_CONFIGURATION_Handle *cfg) 569 const struct GNUNET_CONFIGURATION_Handle *cfg)
570{ 570{
571 struct TestPublishOperation *po = cls; 571 struct TestPublishOperation *po = cls;
572 572
573 return GNUNET_FS_start (cfg, 573 return GNUNET_FS_start (cfg,
574 "fs-test-download", 574 "fs-test-download",
575 &download_progress_cb, po, 575 &download_progress_cb, po,
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index ecf14112c..7e189d697 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -322,8 +322,8 @@ unindex_finish (struct GNUNET_FS_UnindexContext *uc)
322 * @param reason kind of progress we are making 322 * @param reason kind of progress we are making
323 */ 323 */
324static void 324static void
325unindex_directory_scan_cb (void *cls, 325unindex_directory_scan_cb (void *cls,
326 const char *filename, 326 const char *filename,
327 int is_directory, 327 int is_directory,
328 enum GNUNET_FS_DirScannerProgressUpdateReason reason) 328 enum GNUNET_FS_DirScannerProgressUpdateReason reason)
329{ 329{
@@ -381,7 +381,7 @@ GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc)
381 ex = NULL; 381 ex = NULL;
382 uc->dscan = GNUNET_FS_directory_scan_start (uc->filename, 382 uc->dscan = GNUNET_FS_directory_scan_start (uc->filename,
383 GNUNET_NO, ex, 383 GNUNET_NO, ex,
384 &unindex_directory_scan_cb, 384 &unindex_directory_scan_cb,
385 uc); 385 uc);
386 GNUNET_free_non_null (ex); 386 GNUNET_free_non_null (ex);
387} 387}
@@ -391,7 +391,7 @@ GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc)
391 * Continuation called to notify client about result of the remove 391 * Continuation called to notify client about result of the remove
392 * operation for the UBlock. 392 * operation for the UBlock.
393 * 393 *
394 * @param cls the 'struct GNUNET_FS_UnindexContext *' 394 * @param cls the 'struct GNUNET_FS_UnindexContext *'
395 * @param success GNUNET_SYSERR on failure (including timeout/queue drop) 395 * @param success GNUNET_SYSERR on failure (including timeout/queue drop)
396 * GNUNET_NO if content was already there 396 * GNUNET_NO if content was already there
397 * GNUNET_YES (or other positive value) on success 397 * GNUNET_YES (or other positive value) on success
@@ -409,10 +409,10 @@ continue_after_remove (void *cls,
409 struct GNUNET_FS_UnindexContext *uc = cls; 409 struct GNUNET_FS_UnindexContext *uc = cls;
410 410
411 uc->dqe = NULL; 411 uc->dqe = NULL;
412 if (success != GNUNET_YES) 412 if (success != GNUNET_YES)
413 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 413 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
414 _("Failed to remove UBlock: %s\n"), 414 _("Failed to remove UBlock: %s\n"),
415 msg); 415 msg);
416 uc->ksk_offset++; 416 uc->ksk_offset++;
417 GNUNET_FS_unindex_do_remove_kblocks_ (uc); 417 GNUNET_FS_unindex_do_remove_kblocks_ (uc);
418} 418}
@@ -464,14 +464,14 @@ process_kblock_for_unindex (void *cls,
464 if (0 == uc->first_uid) 464 if (0 == uc->first_uid)
465 { 465 {
466 /* remember UID of first result to detect cycles */ 466 /* remember UID of first result to detect cycles */
467 uc->first_uid = uid; 467 uc->first_uid = uid;
468 } 468 }
469 else if (uid == uc->first_uid) 469 else if (uid == uc->first_uid)
470 { 470 {
471 /* no more additional results */ 471 /* no more additional results */
472 uc->ksk_offset++; 472 uc->ksk_offset++;
473 GNUNET_FS_unindex_do_remove_kblocks_ (uc); 473 GNUNET_FS_unindex_do_remove_kblocks_ (uc);
474 return; 474 return;
475 } 475 }
476 GNUNET_assert (GNUNET_BLOCK_TYPE_FS_UBLOCK == type); 476 GNUNET_assert (GNUNET_BLOCK_TYPE_FS_UBLOCK == type);
477 if (size < sizeof (struct UBlock)) 477 if (size < sizeof (struct UBlock))
@@ -489,10 +489,10 @@ process_kblock_for_unindex (void *cls,
489 goto get_next; 489 goto get_next;
490 } 490 }
491 { 491 {
492 char pt[size - sizeof (struct UBlock)]; 492 char pt[size - sizeof (struct UBlock)];
493 struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; 493 struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
494 const char *keyword; 494 const char *keyword;
495 495
496 GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), 496 GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (),
497 &anon_pub); 497 &anon_pub);
498 keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; 498 keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
@@ -757,7 +757,7 @@ GNUNET_FS_unindex_signal_suspend_ (void *cls)
757 * @return NULL on error, otherwise handle 757 * @return NULL on error, otherwise handle
758 */ 758 */
759struct GNUNET_FS_UnindexContext * 759struct GNUNET_FS_UnindexContext *
760GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, 760GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
761 const char *filename, 761 const char *filename,
762 void *cctx) 762 void *cctx)
763{ 763{
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 4b25e91ea..90c211415 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -98,7 +98,7 @@
98 * @param key where to store the unique key 98 * @param key where to store the unique key
99 */ 99 */
100void 100void
101GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, 101GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
102 struct GNUNET_HashCode *key) 102 struct GNUNET_HashCode *key)
103{ 103{
104 switch (uri->type) 104 switch (uri->type)
@@ -368,7 +368,7 @@ uri_sks_parse (const char *s, char **emsg)
368 end = strchr (&s[pos], '/'); 368 end = strchr (&s[pos], '/');
369 if ( (NULL == end) || 369 if ( (NULL == end) ||
370 (GNUNET_OK != 370 (GNUNET_OK !=
371 GNUNET_STRINGS_string_to_data (&s[pos], 371 GNUNET_STRINGS_string_to_data (&s[pos],
372 end - &s[pos], 372 end - &s[pos],
373 &ns, 373 &ns,
374 sizeof (ns))) ) 374 sizeof (ns))) )
@@ -526,12 +526,12 @@ struct LocUriAssembly
526 526
527 /** 527 /**
528 * File being offered. 528 * File being offered.
529 */ 529 */
530 struct FileIdentifier fi; 530 struct FileIdentifier fi;
531 531
532 /** 532 /**
533 * Peer offering the file. 533 * Peer offering the file.
534 */ 534 */
535 struct GNUNET_PeerIdentity peer; 535 struct GNUNET_PeerIdentity peer;
536 536
537}; 537};
@@ -947,7 +947,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
947 * @return an FS URI for the given namespace and identifier 947 * @return an FS URI for the given namespace and identifier
948 */ 948 */
949struct GNUNET_FS_Uri * 949struct GNUNET_FS_Uri *
950GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, 950GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
951 const char *id) 951 const char *id)
952{ 952{
953 struct GNUNET_FS_Uri *ns_uri; 953 struct GNUNET_FS_Uri *ns_uri;
@@ -1424,7 +1424,7 @@ GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri)
1424 * Add a keyword as non-mandatory (with ' '-prefix) to the 1424 * Add a keyword as non-mandatory (with ' '-prefix) to the
1425 * given keyword list at offset 'index'. The array is 1425 * given keyword list at offset 'index'. The array is
1426 * guaranteed to be long enough. 1426 * guaranteed to be long enough.
1427 * 1427 *
1428 * @param s keyword to add 1428 * @param s keyword to add
1429 * @param array array to add the keyword to 1429 * @param array array to add the keyword to
1430 * @param index offset where to add the keyword 1430 * @param index offset where to add the keyword
@@ -1439,14 +1439,14 @@ insert_non_mandatory_keyword (const char *s, char **array, int index)
1439 1439
1440 1440
1441/** 1441/**
1442 * Test if the given keyword 's' is already present in the 1442 * Test if the given keyword 's' is already present in the
1443 * given array, ignoring the '+'-mandatory prefix in the array. 1443 * given array, ignoring the '+'-mandatory prefix in the array.
1444 * 1444 *
1445 * @param s keyword to test 1445 * @param s keyword to test
1446 * @param array keywords to test against, with ' ' or '+' prefix to ignore 1446 * @param array keywords to test against, with ' ' or '+' prefix to ignore
1447 * @param array_length length of the array 1447 * @param array_length length of the array
1448 * @return GNUNET_YES if the keyword exists, GNUNET_NO if not 1448 * @return GNUNET_YES if the keyword exists, GNUNET_NO if not
1449 */ 1449 */
1450static int 1450static int
1451find_duplicate (const char *s, const char **array, int array_length) 1451find_duplicate (const char *s, const char **array, int array_length)
1452{ 1452{
@@ -1535,7 +1535,7 @@ u8_strcount (const uint8_t *s)
1535 * to it are used to check for duplicates). ignored if array == NULL. 1535 * to it are used to check for duplicates). ignored if array == NULL.
1536 * @return number of tokens counted (including duplicates), or number of 1536 * @return number of tokens counted (including duplicates), or number of
1537 * tokens extracted (excluding duplicates). 0 if there are no 1537 * tokens extracted (excluding duplicates). 0 if there are no
1538 * matching parens in the string (when counting), or when all tokens 1538 * matching parens in the string (when counting), or when all tokens
1539 * were duplicates (when extracting). 1539 * were duplicates (when extracting).
1540 */ 1540 */
1541static int 1541static int
@@ -1612,7 +1612,7 @@ get_keywords_from_parens (const char *s, char **array, int index)
1612 else 1612 else
1613 count++; 1613 count++;
1614 close_paren[0] = tmp; 1614 close_paren[0] = tmp;
1615 } 1615 }
1616 } 1616 }
1617 GNUNET_free (ss); 1617 GNUNET_free (ss);
1618 return count; 1618 return count;
@@ -1900,7 +1900,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
1900 GNUNET_assert (NULL != ret); 1900 GNUNET_assert (NULL != ret);
1901 ret[0] = '\0'; 1901 ret[0] = '\0';
1902 GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX, 1902 GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX,
1903 GNUNET_FS_URI_SKS_INFIX, buf, 1903 GNUNET_FS_URI_SKS_INFIX, buf,
1904 uri->data.sks.identifier); 1904 uri->data.sks.identifier);
1905 return ret; 1905 return ret;
1906} 1906}
@@ -2003,7 +2003,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri)
2003 peerSig = 2003 peerSig =
2004 bin2enc (&uri->data.loc.contentSignature, 2004 bin2enc (&uri->data.loc.contentSignature,
2005 sizeof (struct GNUNET_CRYPTO_EccSignature)); 2005 sizeof (struct GNUNET_CRYPTO_EccSignature));
2006 GNUNET_asprintf (&ret, 2006 GNUNET_asprintf (&ret,
2007 "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, 2007 "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX,
2008 GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, 2008 GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash,
2009 (const char *) &queryhash, 2009 (const char *) &queryhash,
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 86cab5593..b001cb58c 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -21,7 +21,7 @@
21 * @file fs/gnunet-auto-share.c 21 * @file fs/gnunet-auto-share.c
22 * @brief automatically publish files on GNUnet 22 * @brief automatically publish files on GNUnet
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * 24 *
25 * TODO: 25 * TODO:
26 * - support loading meta data / keywords from resource file 26 * - support loading meta data / keywords from resource file
27 * - add stability timer (a la buildbot) 27 * - add stability timer (a la buildbot)
@@ -204,7 +204,7 @@ load_state ()
204 while (n-- > 0) 204 while (n-- > 0)
205 { 205 {
206 if ( (GNUNET_OK != 206 if ( (GNUNET_OK !=
207 GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) || 207 GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) ||
208 (GNUNET_OK != 208 (GNUNET_OK !=
209 GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) 209 GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) )
210 goto error; 210 goto error;
@@ -224,7 +224,7 @@ load_state ()
224 wi, 224 wi,
225 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 225 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
226 } 226 }
227 if (GNUNET_OK == 227 if (GNUNET_OK ==
228 GNUNET_BIO_read_close (rh, &emsg)) 228 GNUNET_BIO_read_close (rh, &emsg))
229 return; 229 return;
230 rh = NULL; 230 rh = NULL;
@@ -259,7 +259,7 @@ write_item (void *cls,
259 "Saving serialization ID of file `%s' with value `%s'\n", 259 "Saving serialization ID of file `%s' with value `%s'\n",
260 wi->filename, 260 wi->filename,
261 GNUNET_h2s (&wi->id)); 261 GNUNET_h2s (&wi->id));
262 if ( (GNUNET_OK != 262 if ( (GNUNET_OK !=
263 GNUNET_BIO_write_string (wh, wi->filename)) || 263 GNUNET_BIO_write_string (wh, wi->filename)) ||
264 (GNUNET_OK != 264 (GNUNET_OK !=
265 GNUNET_BIO_write (wh, 265 GNUNET_BIO_write (wh,
@@ -381,7 +381,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
381 { 381 {
382 GNUNET_break (0); 382 GNUNET_break (0);
383 GNUNET_OS_process_kill (publish_proc, SIGKILL); 383 GNUNET_OS_process_kill (publish_proc, SIGKILL);
384 type = GNUNET_OS_PROCESS_SIGNALED; 384 type = GNUNET_OS_PROCESS_SIGNALED;
385 } 385 }
386 GNUNET_OS_process_destroy (publish_proc); 386 GNUNET_OS_process_destroy (publish_proc);
387 publish_proc = NULL; 387 publish_proc = NULL;
@@ -415,7 +415,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
415 wi); 415 wi);
416 } 416 }
417 save_state (); 417 save_state ();
418 schedule_next_task (); 418 schedule_next_task ();
419} 419}
420 420
421 421
@@ -452,7 +452,7 @@ work (void *cls,
452 static char content_prio[20]; 452 static char content_prio[20];
453 static char repl_level[20]; 453 static char repl_level[20];
454 struct WorkItem *wi; 454 struct WorkItem *wi;
455 const struct GNUNET_DISK_FileHandle *pr; 455 const struct GNUNET_DISK_FileHandle *pr;
456 int argc; 456 int argc;
457 457
458 run_task = GNUNET_SCHEDULER_NO_TASK; 458 run_task = GNUNET_SCHEDULER_NO_TASK;
@@ -553,7 +553,7 @@ determine_id (void *cls,
553 /* use hash here to make hierarchical structure distinct from 553 /* use hash here to make hierarchical structure distinct from
554 all files on the same level */ 554 all files on the same level */
555 GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft); 555 GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft);
556 /* use XOR here so that order of the files in the directory 556 /* use XOR here so that order of the files in the directory
557 does not matter! */ 557 does not matter! */
558 GNUNET_CRYPTO_hash_xor (&ft, id, id); 558 GNUNET_CRYPTO_hash_xor (&ft, id, id);
559 return GNUNET_OK; 559 return GNUNET_OK;
@@ -613,7 +613,7 @@ add_file (void *cls,
613 work_tail, 613 work_tail,
614 wi); 614 wi);
615 if (GNUNET_YES == do_shutdown) 615 if (GNUNET_YES == do_shutdown)
616 return GNUNET_SYSERR; 616 return GNUNET_SYSERR;
617 return GNUNET_OK; 617 return GNUNET_OK;
618} 618}
619 619
@@ -645,7 +645,7 @@ schedule_next_task ()
645 struct GNUNET_TIME_Relative delay; 645 struct GNUNET_TIME_Relative delay;
646 646
647 if (GNUNET_YES == do_shutdown) 647 if (GNUNET_YES == do_shutdown)
648 return; 648 return;
649 if (NULL == work_head) 649 if (NULL == work_head)
650 { 650 {
651 /* delay by at most 4h, at least 1s, and otherwise in between depending 651 /* delay by at most 4h, at least 1s, and otherwise in between depending
@@ -694,7 +694,7 @@ run (void *cls, char *const *args, const char *cfgfile,
694 load_state (); 694 load_state ();
695 run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, 695 run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE,
696 &scan, NULL); 696 &scan, NULL);
697 697
698 kill_task = 698 kill_task =
699 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task, 699 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task,
700 NULL); 700 NULL);
@@ -707,7 +707,7 @@ run (void *cls, char *const *args, const char *cfgfile,
707 * @param cls NULL (unused) 707 * @param cls NULL (unused)
708 * @param key key of the item in the map (unused) 708 * @param key key of the item in the map (unused)
709 * @param value the 'struct WorkItem' to free 709 * @param value the 'struct WorkItem' to free
710 * @return GNUNET_OK to continue to iterate 710 * @return GNUNET_OK to continue to iterate
711 */ 711 */
712static int 712static int
713free_item (void *cls, 713free_item (void *cls,
@@ -731,7 +731,7 @@ free_item (void *cls,
731 */ 731 */
732int 732int
733main (int argc, char *const *argv) 733main (int argc, char *const *argv)
734{ 734{
735 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 735 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
736 {'a', "anonymity", "LEVEL", 736 {'a', "anonymity", "LEVEL",
737 gettext_noop ("set the desired LEVEL of sender-anonymity"), 737 gettext_noop ("set the desired LEVEL of sender-anonymity"),
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index a19fa1ef6..d4c2b1c02 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -164,7 +164,7 @@ static struct Pattern *download_tail;
164 164
165 165
166/** 166/**
167 * Parse a pattern string and store the corresponding 167 * Parse a pattern string and store the corresponding
168 * 'struct Pattern' in the given head/tail. 168 * 'struct Pattern' in the given head/tail.
169 * 169 *
170 * @param head where to store the head 170 * @param head where to store the head
@@ -243,7 +243,7 @@ make_file (uint64_t length,
243 return NULL; 243 return NULL;
244 /* initialize data with 'unique' data only depending on 'kval' and 'size', 244 /* initialize data with 'unique' data only depending on 'kval' and 'size',
245 making sure that blocks do not repeat */ 245 making sure that blocks do not repeat */
246 for (i=0;i<length; i+=8) 246 for (i=0;i<length; i+=8)
247 { 247 {
248 xor = length ^ kval ^ (uint64_t) (i / 32 / 1024); 248 xor = length ^ kval ^ (uint64_t) (i / 32 / 1024);
249 memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t))); 249 memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t)));
@@ -396,8 +396,8 @@ progress_cb (void *cls,
396 case GNUNET_FS_STATUS_PUBLISH_COMPLETED: 396 case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
397 p = info->value.publish.cctx; 397 p = info->value.publish.cctx;
398 GNUNET_STATISTICS_update (stats_handle, 398 GNUNET_STATISTICS_update (stats_handle,
399 "# publishing time (ms)", 399 "# publishing time (ms)",
400 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, 400 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL,
401 GNUNET_NO); 401 GNUNET_NO);
402 p->task = GNUNET_SCHEDULER_add_now (&publish_stop_task, p); 402 p->task = GNUNET_SCHEDULER_add_now (&publish_stop_task, p);
403 return p; 403 return p;
@@ -424,9 +424,9 @@ progress_cb (void *cls,
424 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: 424 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
425 p = info->value.download.cctx; 425 p = info->value.download.cctx;
426 GNUNET_STATISTICS_update (stats_handle, 426 GNUNET_STATISTICS_update (stats_handle,
427 "# download time (ms)", 427 "# download time (ms)",
428 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, 428 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL,
429 GNUNET_NO); 429 GNUNET_NO);
430 p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p); 430 p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p);
431 return p; 431 return p;
432 case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: 432 case GNUNET_FS_STATUS_DOWNLOAD_STOPPED:
@@ -450,12 +450,12 @@ progress_cb (void *cls,
450 if (p->y != GNUNET_FS_uri_chk_get_file_size (uri)) 450 if (p->y != GNUNET_FS_uri_chk_get_file_size (uri))
451 return NULL; /* not what we want */ 451 return NULL; /* not what we want */
452 GNUNET_STATISTICS_update (stats_handle, 452 GNUNET_STATISTICS_update (stats_handle,
453 "# search time (ms)", 453 "# search time (ms)",
454 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, 454 (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL,
455 GNUNET_NO); 455 GNUNET_NO);
456 p->start_time = GNUNET_TIME_absolute_get (); 456 p->start_time = GNUNET_TIME_absolute_get ();
457 p->ctx = GNUNET_FS_download_start (fs_handle, uri, 457 p->ctx = GNUNET_FS_download_start (fs_handle, uri,
458 NULL, NULL, NULL, 458 NULL, NULL, NULL,
459 0, GNUNET_FS_uri_chk_get_file_size (uri), 459 0, GNUNET_FS_uri_chk_get_file_size (uri),
460 anonymity_level, 460 anonymity_level,
461 GNUNET_FS_DOWNLOAD_NO_TEMPORARIES, 461 GNUNET_FS_DOWNLOAD_NO_TEMPORARIES,
@@ -483,7 +483,7 @@ progress_cb (void *cls,
483 GNUNET_free (p); 483 GNUNET_free (p);
484 } 484 }
485 return NULL; 485 return NULL;
486 default: 486 default:
487 /* unexpected event during profiling */ 487 /* unexpected event during profiling */
488 GNUNET_break (0); 488 GNUNET_break (0);
489 return NULL; 489 return NULL;
@@ -497,7 +497,7 @@ progress_cb (void *cls,
497 * @param cls the 'struct Pattern' specifying the operation to perform 497 * @param cls the 'struct Pattern' specifying the operation to perform
498 * @param tc scheduler context 498 * @param tc scheduler context
499 */ 499 */
500static void 500static void
501start_publish (void *cls, 501start_publish (void *cls,
502 const struct GNUNET_SCHEDULER_TaskContext *tc) 502 const struct GNUNET_SCHEDULER_TaskContext *tc)
503{ 503{
@@ -522,7 +522,7 @@ start_publish (void *cls,
522 * @param cls the 'struct Pattern' specifying the operation to perform 522 * @param cls the 'struct Pattern' specifying the operation to perform
523 * @param tc scheduler context 523 * @param tc scheduler context
524 */ 524 */
525static void 525static void
526start_download (void *cls, 526start_download (void *cls,
527 const struct GNUNET_SCHEDULER_TaskContext *tc) 527 const struct GNUNET_SCHEDULER_TaskContext *tc)
528{ 528{
@@ -563,7 +563,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
563 NULL); 563 NULL);
564 564
565 if (GNUNET_OK != 565 if (GNUNET_OK !=
566 GNUNET_CONFIGURATION_get_value_number (cfg, 566 GNUNET_CONFIGURATION_get_value_number (cfg,
567 "TESTBED", "PEERID", 567 "TESTBED", "PEERID",
568 &my_peerid)) 568 &my_peerid))
569 { 569 {
@@ -574,28 +574,28 @@ run (void *cls, char *const *args GNUNET_UNUSED,
574 return; 574 return;
575 } 575 }
576 if (GNUNET_OK != 576 if (GNUNET_OK !=
577 GNUNET_CONFIGURATION_get_value_number (cfg, 577 GNUNET_CONFIGURATION_get_value_number (cfg,
578 "FSPROFILER", "ANONYMITY_LEVEL", 578 "FSPROFILER", "ANONYMITY_LEVEL",
579 &anonymity_level)) 579 &anonymity_level))
580 anonymity_level = 1; 580 anonymity_level = 1;
581 if (GNUNET_OK != 581 if (GNUNET_OK !=
582 GNUNET_CONFIGURATION_get_value_number (cfg, 582 GNUNET_CONFIGURATION_get_value_number (cfg,
583 "FSPROFILER", "REPLICATION_LEVEL", 583 "FSPROFILER", "REPLICATION_LEVEL",
584 &replication_level)) 584 &replication_level))
585 replication_level = 1; 585 replication_level = 1;
586 GNUNET_snprintf (myoptname, sizeof (myoptname), 586 GNUNET_snprintf (myoptname, sizeof (myoptname),
587 "DOWNLOAD-PATTERN-%u", my_peerid); 587 "DOWNLOAD-PATTERN-%u", my_peerid);
588 if (GNUNET_OK != 588 if (GNUNET_OK !=
589 GNUNET_CONFIGURATION_get_value_string (cfg, 589 GNUNET_CONFIGURATION_get_value_string (cfg,
590 "FSPROFILER", myoptname, 590 "FSPROFILER", myoptname,
591 &download_pattern)) 591 &download_pattern))
592 download_pattern = GNUNET_strdup (""); 592 download_pattern = GNUNET_strdup ("");
593 GNUNET_snprintf (myoptname, sizeof (myoptname), 593 GNUNET_snprintf (myoptname, sizeof (myoptname),
594 "PUBLISH-PATTERN-%u", my_peerid); 594 "PUBLISH-PATTERN-%u", my_peerid);
595 if (GNUNET_OK != 595 if (GNUNET_OK !=
596 GNUNET_CONFIGURATION_get_value_string (cfg, 596 GNUNET_CONFIGURATION_get_value_string (cfg,
597 "FSPROFILER", myoptname, 597 "FSPROFILER", myoptname,
598 &publish_pattern)) 598 &publish_pattern))
599 publish_pattern = GNUNET_strdup (""); 599 publish_pattern = GNUNET_strdup ("");
600 if ( (GNUNET_OK != 600 if ( (GNUNET_OK !=
601 parse_pattern (&download_head, 601 parse_pattern (&download_head,
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index 5001d4c34..0938e8316 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -79,9 +79,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
79 * @param n total size of the download 79 * @param n total size of the download
80 * @param w desired number of steps in the progress bar 80 * @param w desired number of steps in the progress bar
81 */ 81 */
82static void 82static void
83display_bar (unsigned long long x, 83display_bar (unsigned long long x,
84 unsigned long long n, 84 unsigned long long n,
85 unsigned int w) 85 unsigned int w)
86{ 86{
87 char buf[w + 20]; 87 char buf[w + 20];
@@ -142,7 +142,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
142 { 142 {
143 s = GNUNET_strdup (GNUNET_STRINGS_relative_time_to_string (info->value.download.eta, 143 s = GNUNET_strdup (GNUNET_STRINGS_relative_time_to_string (info->value.download.eta,
144 GNUNET_YES)); 144 GNUNET_YES));
145 if (info->value.download.specifics.progress.block_download_duration.rel_value_us 145 if (info->value.download.specifics.progress.block_download_duration.rel_value_us
146 == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) 146 == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
147 s2 = _("<unknown time>"); 147 s2 = _("<unknown time>");
148 else 148 else
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index 33b293055..56a3084cc 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @file fs/gnunet-fs-profiler.c 22 * @file fs/gnunet-fs-profiler.c
23 * @brief tool to benchmark/profile file-sharing 23 * @brief tool to benchmark/profile file-sharing
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
@@ -137,7 +137,7 @@ terminate_task (void *cls,
137 * failed 137 * failed
138 */ 138 */
139static void 139static void
140test_master (void *cls, 140test_master (void *cls,
141 struct GNUNET_TESTBED_RunHandle *h, 141 struct GNUNET_TESTBED_RunHandle *h,
142 unsigned int num_peers, 142 unsigned int num_peers,
143 struct GNUNET_TESTBED_Peer **peers, 143 struct GNUNET_TESTBED_Peer **peers,
@@ -152,7 +152,7 @@ test_master (void *cls,
152 terminate_taskid = GNUNET_SCHEDULER_add_delayed (timeout, 152 terminate_taskid = GNUNET_SCHEDULER_add_delayed (timeout,
153 &terminate_task, NULL); 153 &terminate_task, NULL);
154 else 154 else
155 terminate_taskid = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 155 terminate_taskid = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
156 &terminate_task, 156 &terminate_task,
157 NULL); 157 NULL);
158} 158}
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index cc58f62b5..214650b0f 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -125,8 +125,8 @@ add_to_md (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
125 memcpy (zdata, data, data_len); 125 memcpy (zdata, data, data_len);
126 zdata[data_len] = '\0'; 126 zdata[data_len] = '\0';
127 (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format, 127 (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format,
128 data_mime_type, zdata, data_len + 1); 128 data_mime_type, zdata, data_len + 1);
129 } 129 }
130 else 130 else
131 { 131 {
132 (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format, 132 (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format,
@@ -141,7 +141,7 @@ add_to_md (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
141 * 141 *
142 * @param tree tree to free 142 * @param tree tree to free
143 */ 143 */
144static void 144static void
145free_tree (struct ScanTreeNode *tree) 145free_tree (struct ScanTreeNode *tree)
146{ 146{
147 struct ScanTreeNode *pos; 147 struct ScanTreeNode *pos;
@@ -151,7 +151,7 @@ free_tree (struct ScanTreeNode *tree)
151 if (NULL != tree->parent) 151 if (NULL != tree->parent)
152 GNUNET_CONTAINER_DLL_remove (tree->parent->children_head, 152 GNUNET_CONTAINER_DLL_remove (tree->parent->children_head,
153 tree->parent->children_tail, 153 tree->parent->children_tail,
154 tree); 154 tree);
155 GNUNET_free (tree->filename); 155 GNUNET_free (tree->filename);
156 GNUNET_free (tree); 156 GNUNET_free (tree);
157} 157}
@@ -205,7 +205,7 @@ write_message (uint16_t message_type,
205 struct GNUNET_MessageHeader hdr; 205 struct GNUNET_MessageHeader hdr;
206 206
207#if 0 207#if 0
208 fprintf (stderr, 208 fprintf (stderr,
209 "Helper sends %u-byte message of type %u\n", 209 "Helper sends %u-byte message of type %u\n",
210 (unsigned int) (sizeof (struct GNUNET_MessageHeader) + data_length), 210 (unsigned int) (sizeof (struct GNUNET_MessageHeader) + data_length),
211 (unsigned int) message_type); 211 (unsigned int) message_type);
@@ -295,7 +295,7 @@ scan_callback (void *cls,
295 * 295 *
296 * @param filename file or directory to scan 296 * @param filename file or directory to scan
297 * @param dst where to store the resulting share tree item; 297 * @param dst where to store the resulting share tree item;
298 * NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is returned) 298 * NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is returned)
299 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 299 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
300 */ 300 */
301static int 301static int
@@ -323,7 +323,7 @@ preprocess_file (const char *filename,
323 323
324 /* Report the progress */ 324 /* Report the progress */
325 if (GNUNET_OK != 325 if (GNUNET_OK !=
326 write_message (S_ISDIR (sbuf.st_mode) 326 write_message (S_ISDIR (sbuf.st_mode)
327 ? GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY 327 ? GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY
328 : GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE, 328 : GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE,
329 filename, strlen (filename) + 1)) 329 filename, strlen (filename) + 1))
@@ -338,9 +338,9 @@ preprocess_file (const char *filename,
338 338
339 rc.parent = item; 339 rc.parent = item;
340 rc.stop = GNUNET_NO; 340 rc.stop = GNUNET_NO;
341 GNUNET_DISK_directory_scan (filename, 341 GNUNET_DISK_directory_scan (filename,
342 &scan_callback, 342 &scan_callback,
343 &rc); 343 &rc);
344 if ( (GNUNET_YES == rc.stop) || 344 if ( (GNUNET_YES == rc.stop) ||
345 (GNUNET_OK != 345 (GNUNET_OK !=
346 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY, 346 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY,
@@ -363,7 +363,7 @@ preprocess_file (const char *filename,
363 */ 363 */
364static int 364static int
365extract_files (struct ScanTreeNode *item) 365extract_files (struct ScanTreeNode *item)
366{ 366{
367 struct GNUNET_CONTAINER_MetaData *meta; 367 struct GNUNET_CONTAINER_MetaData *meta;
368 ssize_t size; 368 ssize_t size;
369 size_t slen; 369 size_t slen;
@@ -380,7 +380,7 @@ extract_files (struct ScanTreeNode *item)
380 return GNUNET_SYSERR; 380 return GNUNET_SYSERR;
381 return GNUNET_OK; 381 return GNUNET_OK;
382 } 382 }
383 383
384 /* this is the expensive operation, *afterwards* we'll check for aborts */ 384 /* this is the expensive operation, *afterwards* we'll check for aborts */
385 meta = GNUNET_CONTAINER_meta_data_create (); 385 meta = GNUNET_CONTAINER_meta_data_create ();
386 EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta); 386 EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta);
@@ -393,7 +393,7 @@ extract_files (struct ScanTreeNode *item)
393 if (GNUNET_OK != 393 if (GNUNET_OK !=
394 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA, 394 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA,
395 item->filename, slen)) 395 item->filename, slen))
396 return GNUNET_SYSERR; 396 return GNUNET_SYSERR;
397 return GNUNET_OK; 397 return GNUNET_OK;
398 } 398 }
399 else if (size > (UINT16_MAX - sizeof (struct GNUNET_MessageHeader) - slen)) 399 else if (size > (UINT16_MAX - sizeof (struct GNUNET_MessageHeader) - slen))
@@ -404,7 +404,7 @@ extract_files (struct ScanTreeNode *item)
404 { 404 {
405 char buf[size + slen]; 405 char buf[size + slen];
406 char *dst = &buf[slen]; 406 char *dst = &buf[slen];
407 407
408 memcpy (buf, item->filename, slen); 408 memcpy (buf, item->filename, slen);
409 size = GNUNET_CONTAINER_meta_data_serialize (meta, 409 size = GNUNET_CONTAINER_meta_data_serialize (meta,
410 &dst, size, 410 &dst, size,
@@ -417,7 +417,7 @@ extract_files (struct ScanTreeNode *item)
417 GNUNET_CONTAINER_meta_data_destroy (meta); 417 GNUNET_CONTAINER_meta_data_destroy (meta);
418 if (GNUNET_OK != 418 if (GNUNET_OK !=
419 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA, 419 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA,
420 buf, 420 buf,
421 slen + size)) 421 slen + size))
422 return GNUNET_SYSERR; 422 return GNUNET_SYSERR;
423 } 423 }
@@ -456,7 +456,7 @@ ignore_sigpipe ()
456 * @param flags flags to use (O_RDONLY or O_WRONLY) 456 * @param flags flags to use (O_RDONLY or O_WRONLY)
457 */ 457 */
458static void 458static void
459make_dev_zero (int fd, 459make_dev_zero (int fd,
460 int flags) 460 int flags)
461{ 461{
462 int z; 462 int z;
@@ -483,7 +483,7 @@ make_dev_zero (int fd,
483 * otherwise custom plugins to load from LE 483 * otherwise custom plugins to load from LE
484 * @return 0 on success 484 * @return 0 on success
485 */ 485 */
486int 486int
487main (int argc, 487main (int argc,
488 char *const *argv) 488 char *const *argv)
489{ 489{
@@ -502,7 +502,7 @@ main (int argc,
502 output_stream = 1; /* stdout */ 502 output_stream = 1; /* stdout */
503#else 503#else
504 ignore_sigpipe (); 504 ignore_sigpipe ();
505 /* move stdout to some other FD for IPC, bind 505 /* move stdout to some other FD for IPC, bind
506 stdout/stderr to /dev/null */ 506 stdout/stderr to /dev/null */
507 output_stream = dup (1); 507 output_stream = dup (1);
508 make_dev_zero (1, O_WRONLY); 508 make_dev_zero (1, O_WRONLY);
@@ -512,7 +512,7 @@ main (int argc,
512 /* parse command line */ 512 /* parse command line */
513 if ( (3 != argc) && (2 != argc) ) 513 if ( (3 != argc) && (2 != argc) )
514 { 514 {
515 FPRINTF (stderr, 515 FPRINTF (stderr,
516 "%s", 516 "%s",
517 "gnunet-helper-fs-publish needs exactly one or two arguments\n"); 517 "gnunet-helper-fs-publish needs exactly one or two arguments\n");
518#if WINDOWS 518#if WINDOWS
@@ -532,7 +532,7 @@ main (int argc,
532 } 532 }
533 533
534 /* scan tree to find out how much work there is to be done */ 534 /* scan tree to find out how much work there is to be done */
535 if (GNUNET_OK != preprocess_file (filename_expanded, 535 if (GNUNET_OK != preprocess_file (filename_expanded,
536 &root)) 536 &root))
537 { 537 {
538 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); 538 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0);
@@ -542,7 +542,7 @@ main (int argc,
542#endif 542#endif
543 return 2; 543 return 2;
544 } 544 }
545 /* signal that we're done counting files, so that a percentage of 545 /* signal that we're done counting files, so that a percentage of
546 progress can now be calculated */ 546 progress can now be calculated */
547 if (GNUNET_OK != 547 if (GNUNET_OK !=
548 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) 548 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0))
@@ -551,7 +551,7 @@ main (int argc,
551#if WINDOWS 551#if WINDOWS
552 GNUNET_free ((void*) argv); 552 GNUNET_free ((void*) argv);
553#endif 553#endif
554 return 3; 554 return 3;
555 } 555 }
556 if (NULL != root) 556 if (NULL != root)
557 { 557 {
@@ -572,7 +572,7 @@ main (int argc,
572 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); 572 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0);
573 EXTRACTOR_plugin_remove_all (plugins); 573 EXTRACTOR_plugin_remove_all (plugins);
574#if WINDOWS 574#if WINDOWS
575 GNUNET_free ((void*) argv); 575 GNUNET_free ((void*) argv);
576#endif 576#endif
577 return 0; 577 return 0;
578} 578}
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index f960503c2..83dd45a28 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -169,7 +169,7 @@ do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169 { 169 {
170 GNUNET_CONTAINER_meta_data_destroy (meta); 170 GNUNET_CONTAINER_meta_data_destroy (meta);
171 meta = NULL; 171 meta = NULL;
172 } 172 }
173} 173}
174 174
175 175
@@ -187,7 +187,7 @@ stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
187 { 187 {
188 GNUNET_FS_directory_scan_abort (ds); 188 GNUNET_FS_directory_scan_abort (ds);
189 ds = NULL; 189 ds = NULL;
190 } 190 }
191 if (NULL != identity) 191 if (NULL != identity)
192 { 192 {
193 GNUNET_IDENTITY_disconnect (identity); 193 GNUNET_IDENTITY_disconnect (identity);
@@ -477,7 +477,7 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item)
477 if (GNUNET_YES == item->is_directory) 477 if (GNUNET_YES == item->is_directory)
478 { 478 {
479 GNUNET_CONTAINER_meta_data_delete (item->meta, 479 GNUNET_CONTAINER_meta_data_delete (item->meta,
480 EXTRACTOR_METATYPE_MIMETYPE, 480 EXTRACTOR_METATYPE_MIMETYPE,
481 NULL, 0); 481 NULL, 0);
482 GNUNET_FS_meta_data_make_directory (item->meta); 482 GNUNET_FS_meta_data_make_directory (item->meta);
483 if (NULL == item->ksk_uri) 483 if (NULL == item->ksk_uri)
@@ -488,9 +488,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item)
488 else 488 else
489 GNUNET_FS_uri_ksk_add_keyword (item->ksk_uri, GNUNET_FS_DIRECTORY_MIME, 489 GNUNET_FS_uri_ksk_add_keyword (item->ksk_uri, GNUNET_FS_DIRECTORY_MIME,
490 GNUNET_NO); 490 GNUNET_NO);
491 fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL, 491 fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL,
492 item->ksk_uri, 492 item->ksk_uri,
493 item->meta, 493 item->meta,
494 &bo, item->filename); 494 &bo, item->filename);
495 for (child = item->children_head; child; child = child->next) 495 for (child = item->children_head; child; child = child->next)
496 { 496 {
@@ -500,9 +500,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item)
500 } 500 }
501 else 501 else
502 { 502 {
503 fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, 503 fi = GNUNET_FS_file_information_create_from_file (ctx, NULL,
504 item->filename, 504 item->filename,
505 item->ksk_uri, item->meta, 505 item->ksk_uri, item->meta,
506 !do_insert, 506 !do_insert,
507 &bo); 507 &bo);
508 } 508 }
@@ -542,7 +542,7 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result)
542 priv = NULL; 542 priv = NULL;
543 else 543 else
544 priv = GNUNET_IDENTITY_ego_get_private_key (namespace); 544 priv = GNUNET_IDENTITY_ego_get_private_key (namespace);
545 pc = GNUNET_FS_publish_start (ctx, fi, 545 pc = GNUNET_FS_publish_start (ctx, fi,
546 priv, this_id, next_id, 546 priv, this_id, next_id,
547 (do_simulate) ? 547 (do_simulate) ?
548 GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY : 548 GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY :
@@ -569,8 +569,8 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result)
569 * @param reason kind of progress we are making 569 * @param reason kind of progress we are making
570 */ 570 */
571static void 571static void
572directory_scan_cb (void *cls, 572directory_scan_cb (void *cls,
573 const char *filename, 573 const char *filename,
574 int is_directory, 574 int is_directory,
575 enum GNUNET_FS_DirScannerProgressUpdateReason reason) 575 enum GNUNET_FS_DirScannerProgressUpdateReason reason)
576{ 576{
@@ -584,21 +584,21 @@ directory_scan_cb (void *cls,
584 if (is_directory == GNUNET_YES) 584 if (is_directory == GNUNET_YES)
585 FPRINTF (stdout, _("Scanning directory `%s'.\n"), filename); 585 FPRINTF (stdout, _("Scanning directory `%s'.\n"), filename);
586 else 586 else
587 FPRINTF (stdout, _("Scanning file `%s'.\n"), filename); 587 FPRINTF (stdout, _("Scanning file `%s'.\n"), filename);
588 } 588 }
589 break; 589 break;
590 case GNUNET_FS_DIRSCANNER_FILE_IGNORED: 590 case GNUNET_FS_DIRSCANNER_FILE_IGNORED:
591 FPRINTF (stderr, 591 FPRINTF (stderr,
592 _("There was trouble processing file `%s', skipping it.\n"), 592 _("There was trouble processing file `%s', skipping it.\n"),
593 filename); 593 filename);
594 break; 594 break;
595 case GNUNET_FS_DIRSCANNER_ALL_COUNTED: 595 case GNUNET_FS_DIRSCANNER_ALL_COUNTED:
596 if (verbose) 596 if (verbose)
597 FPRINTF (stdout, "%s", _("Preprocessing complete.\n")); 597 FPRINTF (stdout, "%s", _("Preprocessing complete.\n"));
598 break; 598 break;
599 case GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED: 599 case GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED:
600 if (verbose > 2) 600 if (verbose > 2)
601 FPRINTF (stdout, _("Extracting meta data from file `%s' complete.\n"), filename); 601 FPRINTF (stdout, _("Extracting meta data from file `%s' complete.\n"), filename);
602 break; 602 break;
603 case GNUNET_FS_DIRSCANNER_FINISHED: 603 case GNUNET_FS_DIRSCANNER_FINISHED:
604 if (verbose > 1) 604 if (verbose > 1)
@@ -630,7 +630,7 @@ directory_scan_cb (void *cls,
630 * has been initialized. 630 * has been initialized.
631 * 631 *
632 * @param args0 filename to publish 632 * @param args0 filename to publish
633 */ 633 */
634static void 634static void
635identity_continuation (const char *args0) 635identity_continuation (const char *args0)
636{ 636{
@@ -673,8 +673,8 @@ identity_continuation (const char *args0)
673 return; 673 return;
674 } 674 }
675 ds = GNUNET_FS_directory_scan_start (args0, 675 ds = GNUNET_FS_directory_scan_start (args0,
676 disable_extractor, 676 disable_extractor,
677 ex, 677 ex,
678 &directory_scan_cb, NULL); 678 &directory_scan_cb, NULL);
679 if (NULL == ds) 679 if (NULL == ds)
680 { 680 {
@@ -706,7 +706,7 @@ identity_cb (void *cls,
706{ 706{
707 const char *args0 = cls; 707 const char *args0 = cls;
708 708
709 if (NULL == ego) 709 if (NULL == ego)
710 { 710 {
711 identity_continuation (args0); 711 identity_continuation (args0);
712 return; 712 return;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 8ecb6bb67..0e38d0dc9 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -248,7 +248,7 @@ update_latencies (void *cls,
248 int active, 248 int active,
249 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 249 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
250 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 250 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
251 const struct GNUNET_ATS_Information *ats, 251 const struct GNUNET_ATS_Information *ats,
252 uint32_t ats_count) 252 uint32_t ats_count)
253{ 253{
254 unsigned int i; 254 unsigned int i;
@@ -270,7 +270,7 @@ update_latencies (void *cls,
270 gettext_noop 270 gettext_noop
271 ("# running average P2P latency (ms)"), 271 ("# running average P2P latency (ms)"),
272 GSF_avg_latency.rel_value_us / 1000LL, GNUNET_NO); 272 GSF_avg_latency.rel_value_us / 1000LL, GNUNET_NO);
273 break; 273 break;
274 } 274 }
275} 275}
276 276
@@ -416,7 +416,7 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr,
416 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 416 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
417 "Considering mesh-based download for block\n"); 417 "Considering mesh-based download for block\n");
418 GSF_mesh_lookup_ (pr); 418 GSF_mesh_lookup_ (pr);
419 break; 419 break;
420 case GNUNET_BLOCK_TYPE_FS_UBLOCK: 420 case GNUNET_BLOCK_TYPE_FS_UBLOCK:
421 /* the above block types are in the DHT */ 421 /* the above block types are in the DHT */
422 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 422 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -625,7 +625,7 @@ main_init (struct GNUNET_SERVER_Handle *server,
625 anon_p2p_off = (GNUNET_YES == 625 anon_p2p_off = (GNUNET_YES ==
626 GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, 626 GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg,
627 "fs", 627 "fs",
628 "DISABLE_ANON_TRANSFER")); 628 "DISABLE_ANON_TRANSFER"));
629 GSF_core = 629 GSF_core =
630 GNUNET_CORE_connect (GSF_cfg, NULL, &peer_init_handler, 630 GNUNET_CORE_connect (GSF_cfg, NULL, &peer_init_handler,
631 &peer_connect_handler, &GSF_peer_disconnect_handler_, 631 &peer_connect_handler, &GSF_peer_disconnect_handler_,
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index a9e950363..593250e2c 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -328,9 +328,9 @@ get_respect_filename (const struct GNUNET_PeerIdentity *id)
328{ 328{
329 char *fn; 329 char *fn;
330 330
331 GNUNET_asprintf (&fn, 331 GNUNET_asprintf (&fn,
332 "%s%s%s", 332 "%s%s%s",
333 respectDirectory, 333 respectDirectory,
334 DIR_SEPARATOR_STR, 334 DIR_SEPARATOR_STR,
335 GNUNET_i2s_full (id)); 335 GNUNET_i2s_full (id));
336 return fn; 336 return fn;
@@ -542,7 +542,7 @@ ats_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
542 542
543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
544 "Reserved %d bytes / need to wait %s for reservation\n", 544 "Reserved %d bytes / need to wait %s for reservation\n",
545 (int) amount, 545 (int) amount,
546 GNUNET_STRINGS_relative_time_to_string (res_delay, GNUNET_YES)); 546 GNUNET_STRINGS_relative_time_to_string (res_delay, GNUNET_YES));
547 cp->rc = NULL; 547 cp->rc = NULL;
548 if (0 == amount) 548 if (0 == amount)
@@ -597,7 +597,7 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer)
597 GNUNET_free (fn); 597 GNUNET_free (fn);
598 cp->request_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); 598 cp->request_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO);
599 GNUNET_break (GNUNET_OK == 599 GNUNET_break (GNUNET_OK ==
600 GNUNET_CONTAINER_multipeermap_put (cp_map, 600 GNUNET_CONTAINER_multipeermap_put (cp_map,
601 GSF_connected_peer_get_identity2_ (cp), 601 GSF_connected_peer_get_identity2_ (cp),
602 cp, 602 cp,
603 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 603 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
@@ -682,7 +682,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
682 bt = GNUNET_TIME_relative_ntoh (msm->duration); 682 bt = GNUNET_TIME_relative_ntoh (msm->duration);
683 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 683 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
684 _("Migration of content to peer `%s' blocked for %s\n"), 684 _("Migration of content to peer `%s' blocked for %s\n"),
685 GNUNET_i2s (other), 685 GNUNET_i2s (other),
686 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES)); 686 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES));
687 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt); 687 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt);
688 if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task) 688 if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task)
@@ -1254,7 +1254,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1254 { 1254 {
1255 pr = peerreq->pr; 1255 pr = peerreq->pr;
1256 prd = GSF_pending_request_get_data_ (pr); 1256 prd = GSF_pending_request_get_data_ (pr);
1257 if (prd->type == type) 1257 if (prd->type == type)
1258 { 1258 {
1259 if (prd->ttl.abs_value_us >= GNUNET_TIME_absolute_get ().abs_value_us + ttl * 1000LL) 1259 if (prd->ttl.abs_value_us >= GNUNET_TIME_absolute_get ().abs_value_us + ttl * 1000LL)
1260 { 1260 {
@@ -1278,7 +1278,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1278 1278
1279 peerreq = GNUNET_new (struct PeerRequest); 1279 peerreq = GNUNET_new (struct PeerRequest);
1280 peerreq->cp = cp; 1280 peerreq->cp = cp;
1281 pr = GSF_pending_request_create_ (options, type, &gm->query, 1281 pr = GSF_pending_request_create_ (options, type, &gm->query,
1282 target, 1282 target,
1283 (bfsize > 1283 (bfsize >
1284 0) ? (const char *) &opt[bits] : NULL, 1284 0) ? (const char *) &opt[bits] : NULL,
@@ -1813,8 +1813,8 @@ GSF_connected_peer_init_ ()
1813 * @return #GNUNET_YES (we should continue to iterate) 1813 * @return #GNUNET_YES (we should continue to iterate)
1814 */ 1814 */
1815static int 1815static int
1816clean_peer (void *cls, 1816clean_peer (void *cls,
1817 const struct GNUNET_PeerIdentity *key, 1817 const struct GNUNET_PeerIdentity *key,
1818 void *value) 1818 void *value)
1819{ 1819{
1820 GSF_peer_disconnect_handler_ (NULL, key); 1820 GSF_peer_disconnect_handler_ (NULL, key);
@@ -1846,8 +1846,8 @@ GSF_connected_peer_done_ ()
1846 * @return #GNUNET_YES (we should continue to iterate) 1846 * @return #GNUNET_YES (we should continue to iterate)
1847 */ 1847 */
1848static int 1848static int
1849clean_local_client (void *cls, 1849clean_local_client (void *cls,
1850 const struct GNUNET_PeerIdentity *key, 1850 const struct GNUNET_PeerIdentity *key,
1851 void *value) 1851 void *value)
1852{ 1852{
1853 const struct GSF_LocalClient *lc = cls; 1853 const struct GSF_LocalClient *lc = cls;
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index c8e9d636e..4f5b547ae 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -236,7 +236,7 @@ signal_index_ok (struct IndexInfo *ii)
236 _ 236 _
237 ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), 237 ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"),
238 ii->filename, 238 ii->filename,
239 ir->filename); 239 ir->filename);
240 GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, 240 GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0,
241 GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); 241 GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
242 GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); 242 GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES);
@@ -468,7 +468,7 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
468 * @param msg error message 468 * @param msg error message
469 */ 469 */
470static void 470static void
471remove_cont (void *cls, int success, 471remove_cont (void *cls, int success,
472 struct GNUNET_TIME_Absolute min_expiration, 472 struct GNUNET_TIME_Absolute min_expiration,
473 const char *msg) 473 const char *msg)
474{ 474{
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 8066b264a..6d62085e6 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -375,7 +375,7 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
375 if (0 != (SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY & ntohl (sm->options))) 375 if (0 != (SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY & ntohl (sm->options)))
376 options |= GSF_PRO_LOCAL_ONLY; 376 options |= GSF_PRO_LOCAL_ONLY;
377 cr->pr = GSF_pending_request_create_ (options, type, 377 cr->pr = GSF_pending_request_create_ (options, type,
378 &sm->query, 378 &sm->query,
379 (0 != 379 (0 !=
380 memcmp (&sm->target, &all_zeros, 380 memcmp (&sm->target, &all_zeros,
381 sizeof (struct GNUNET_HashCode))) 381 sizeof (struct GNUNET_HashCode)))
diff --git a/src/fs/gnunet-service-fs_mesh.h b/src/fs/gnunet-service-fs_mesh.h
index f136940aa..5decb242a 100644
--- a/src/fs/gnunet-service-fs_mesh.h
+++ b/src/fs/gnunet-service-fs_mesh.h
@@ -34,7 +34,7 @@ struct GSF_MeshRequest;
34 34
35/** 35/**
36 * Function called with a reply from the mesh. 36 * Function called with a reply from the mesh.
37 * 37 *
38 * @param cls closure 38 * @param cls closure
39 * @param type type of the block, ANY on error 39 * @param type type of the block, ANY on error
40 * @param expiration expiration time for the block 40 * @param expiration expiration time for the block
diff --git a/src/fs/gnunet-service-fs_mesh_client.c b/src/fs/gnunet-service-fs_mesh_client.c
index ffc3c6179..73ab6bb5d 100644
--- a/src/fs/gnunet-service-fs_mesh_client.c
+++ b/src/fs/gnunet-service-fs_mesh_client.c
@@ -44,7 +44,7 @@
44#define CLIENT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 44#define CLIENT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
45 45
46 46
47/** 47/**
48 * Handle for a mesh to another peer. 48 * Handle for a mesh to another peer.
49 */ 49 */
50struct MeshHandle; 50struct MeshHandle;
@@ -99,7 +99,7 @@ struct GSF_MeshRequest
99}; 99};
100 100
101 101
102/** 102/**
103 * Handle for a mesh to another peer. 103 * Handle for a mesh to another peer.
104 */ 104 */
105struct MeshHandle 105struct MeshHandle
@@ -127,12 +127,12 @@ struct MeshHandle
127 127
128 /** 128 /**
129 * Handle for active write operation, or NULL. 129 * Handle for active write operation, or NULL.
130 */ 130 */
131 struct GNUNET_MESH_TransmitHandle *wh; 131 struct GNUNET_MESH_TransmitHandle *wh;
132 132
133 /** 133 /**
134 * Which peer does this mesh go to? 134 * Which peer does this mesh go to?
135 */ 135 */
136 struct GNUNET_PeerIdentity target; 136 struct GNUNET_PeerIdentity target;
137 137
138 /** 138 /**
@@ -177,7 +177,7 @@ transmit_pending (struct MeshHandle *mh);
177 177
178 178
179/** 179/**
180 * Iterator called on each entry in a waiting map to 180 * Iterator called on each entry in a waiting map to
181 * move it back to the pending list. 181 * move it back to the pending list.
182 * 182 *
183 * @param cls the 'struct MeshHandle' 183 * @param cls the 'struct MeshHandle'
@@ -192,7 +192,7 @@ move_to_pending (void *cls,
192{ 192{
193 struct MeshHandle *mh = cls; 193 struct MeshHandle *mh = cls;
194 struct GSF_MeshRequest *sr = value; 194 struct GSF_MeshRequest *sr = value;
195 195
196 GNUNET_assert (GNUNET_YES == 196 GNUNET_assert (GNUNET_YES ==
197 GNUNET_CONTAINER_multihashmap_remove (mh->waiting_map, 197 GNUNET_CONTAINER_multihashmap_remove (mh->waiting_map,
198 key, 198 key,
@@ -342,7 +342,7 @@ transmit_sqm (void *cls,
342 transmit_pending (mh); 342 transmit_pending (mh);
343 return sizeof (sqm); 343 return sizeof (sqm);
344} 344}
345 345
346 346
347/** 347/**
348 * Transmit pending requests via the mesh. 348 * Transmit pending requests via the mesh.
@@ -371,7 +371,7 @@ struct HandleReplyClosure
371 371
372 /** 372 /**
373 * Reply payload. 373 * Reply payload.
374 */ 374 */
375 const void *data; 375 const void *data;
376 376
377 /** 377 /**
@@ -384,11 +384,11 @@ struct HandleReplyClosure
384 */ 384 */
385 size_t data_size; 385 size_t data_size;
386 386
387 /** 387 /**
388 * Type of the block. 388 * Type of the block.
389 */ 389 */
390 enum GNUNET_BLOCK_Type type; 390 enum GNUNET_BLOCK_Type type;
391 391
392 /** 392 /**
393 * Did we have a matching query? 393 * Did we have a matching query?
394 */ 394 */
@@ -397,7 +397,7 @@ struct HandleReplyClosure
397 397
398 398
399/** 399/**
400 * Iterator called on each entry in a waiting map to 400 * Iterator called on each entry in a waiting map to
401 * process a result. 401 * process a result.
402 * 402 *
403 * @param cls the 'struct HandleReplyClosure' 403 * @param cls the 'struct HandleReplyClosure'
@@ -412,7 +412,7 @@ handle_reply (void *cls,
412{ 412{
413 struct HandleReplyClosure *hrc = cls; 413 struct HandleReplyClosure *hrc = cls;
414 struct GSF_MeshRequest *sr = value; 414 struct GSF_MeshRequest *sr = value;
415 415
416 sr->proc (sr->proc_cls, 416 sr->proc (sr->proc_cls,
417 hrc->type, 417 hrc->type,
418 hrc->expiration, 418 hrc->expiration,
@@ -462,7 +462,7 @@ reply_cb (void *cls,
462 type, 462 type,
463 &srm[1], msize, &query)) 463 &srm[1], msize, &query))
464 { 464 {
465 GNUNET_break_op (0); 465 GNUNET_break_op (0);
466 reset_mesh_async (mh); 466 reset_mesh_async (mh);
467 return GNUNET_SYSERR; 467 return GNUNET_SYSERR;
468 } 468 }
@@ -611,7 +611,7 @@ GSF_mesh_query_cancel (struct GSF_MeshRequest *sr)
611 611
612 612
613/** 613/**
614 * Iterator called on each entry in a waiting map to 614 * Iterator called on each entry in a waiting map to
615 * call the 'proc' continuation and release associated 615 * call the 'proc' continuation and release associated
616 * resources. 616 * resources.
617 * 617 *
@@ -641,7 +641,7 @@ free_waiting_entry (void *cls,
641 * 641 *
642 * @param cls NULL 642 * @param cls NULL
643 * @param tunnel tunnel of the disconnecting client 643 * @param tunnel tunnel of the disconnecting client
644 * @param tunnel_ctx our 'struct MeshClient' 644 * @param tunnel_ctx our 'struct MeshClient'
645 */ 645 */
646static void 646static void
647cleaner_cb (void *cls, 647cleaner_cb (void *cls,
diff --git a/src/fs/gnunet-service-fs_mesh_server.c b/src/fs/gnunet-service-fs_mesh_server.c
index 206ff6e75..e732da990 100644
--- a/src/fs/gnunet-service-fs_mesh_server.c
+++ b/src/fs/gnunet-service-fs_mesh_server.c
@@ -72,22 +72,22 @@ struct MeshClient
72{ 72{
73 /** 73 /**
74 * DLL 74 * DLL
75 */ 75 */
76 struct MeshClient *next; 76 struct MeshClient *next;
77 77
78 /** 78 /**
79 * DLL 79 * DLL
80 */ 80 */
81 struct MeshClient *prev; 81 struct MeshClient *prev;
82 82
83 /** 83 /**
84 * Tunnel for communication. 84 * Tunnel for communication.
85 */ 85 */
86 struct GNUNET_MESH_Tunnel *tunnel; 86 struct GNUNET_MESH_Tunnel *tunnel;
87 87
88 /** 88 /**
89 * Handle for active write operation, or NULL. 89 * Handle for active write operation, or NULL.
90 */ 90 */
91 struct GNUNET_MESH_TransmitHandle *wh; 91 struct GNUNET_MESH_TransmitHandle *wh;
92 92
93 /** 93 /**
@@ -99,7 +99,7 @@ struct MeshClient
99 * Tail of write queue. 99 * Tail of write queue.
100 */ 100 */
101 struct WriteQueueItem *wqi_tail; 101 struct WriteQueueItem *wqi_tail;
102 102
103 /** 103 /**
104 * Current active request to the datastore, if we have one pending. 104 * Current active request to the datastore, if we have one pending.
105 */ 105 */
@@ -117,7 +117,7 @@ struct MeshClient
117 117
118 /** 118 /**
119 * Size of the last write that was initiated. 119 * Size of the last write that was initiated.
120 */ 120 */
121 size_t reply_size; 121 size_t reply_size;
122 122
123}; 123};
@@ -130,12 +130,12 @@ static struct GNUNET_MESH_Handle *listen_tunnel;
130 130
131/** 131/**
132 * Head of DLL of mesh clients. 132 * Head of DLL of mesh clients.
133 */ 133 */
134static struct MeshClient *sc_head; 134static struct MeshClient *sc_head;
135 135
136/** 136/**
137 * Tail of DLL of mesh clients. 137 * Tail of DLL of mesh clients.
138 */ 138 */
139static struct MeshClient *sc_tail; 139static struct MeshClient *sc_tail;
140 140
141/** 141/**
@@ -155,7 +155,7 @@ static unsigned long long sc_count_max;
155 * 155 *
156 * @param cls the 'struct MeshClient' 156 * @param cls the 'struct MeshClient'
157 * @param tc scheduler context 157 * @param tc scheduler context
158 */ 158 */
159static void 159static void
160timeout_mesh_task (void *cls, 160timeout_mesh_task (void *cls,
161 const struct GNUNET_SCHEDULER_TaskContext *tc) 161 const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -182,7 +182,7 @@ static void
182refresh_timeout_task (struct MeshClient *sc) 182refresh_timeout_task (struct MeshClient *sc)
183{ 183{
184 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) 184 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
185 GNUNET_SCHEDULER_cancel (sc->timeout_task); 185 GNUNET_SCHEDULER_cancel (sc->timeout_task);
186 sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT, 186 sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
187 &timeout_mesh_task, 187 &timeout_mesh_task,
188 sc); 188 sc);
@@ -291,7 +291,7 @@ continue_writing (struct MeshClient *sc)
291 } 291 }
292 sc->wh = GNUNET_MESH_notify_transmit_ready (sc->tunnel, GNUNET_NO, 292 sc->wh = GNUNET_MESH_notify_transmit_ready (sc->tunnel, GNUNET_NO,
293 GNUNET_TIME_UNIT_FOREVER_REL, 293 GNUNET_TIME_UNIT_FOREVER_REL,
294 wqi->msize, 294 wqi->msize,
295 &write_continuation, 295 &write_continuation,
296 sc); 296 sc);
297 if (NULL == sc->wh) 297 if (NULL == sc->wh)
@@ -320,7 +320,7 @@ continue_writing (struct MeshClient *sc)
320 * @param uid unique identifier for the datum; 320 * @param uid unique identifier for the datum;
321 * maybe 0 if no unique identifier is available 321 * maybe 0 if no unique identifier is available
322 */ 322 */
323static void 323static void
324handle_datastore_reply (void *cls, 324handle_datastore_reply (void *cls,
325 const struct GNUNET_HashCode *key, 325 const struct GNUNET_HashCode *key,
326 size_t size, const void *data, 326 size_t size, const void *data,
@@ -416,7 +416,7 @@ request_cb (void *cls,
416 0, 416 0,
417 &sqm->query, 417 &sqm->query,
418 ntohl (sqm->type), 418 ntohl (sqm->type),
419 0 /* priority */, 419 0 /* priority */,
420 GSF_datastore_queue_size, 420 GSF_datastore_queue_size,
421 GNUNET_TIME_UNIT_FOREVER_REL, 421 GNUNET_TIME_UNIT_FOREVER_REL,
422 &handle_datastore_reply, sc); 422 &handle_datastore_reply, sc);
@@ -481,7 +481,7 @@ accept_cb (void *cls,
481 * 481 *
482 * @param cls NULL 482 * @param cls NULL
483 * @param tunnel tunnel of the disconnecting client 483 * @param tunnel tunnel of the disconnecting client
484 * @param tunnel_ctx our 'struct MeshClient' 484 * @param tunnel_ctx our 'struct MeshClient'
485 */ 485 */
486static void 486static void
487cleaner_cb (void *cls, 487cleaner_cb (void *cls,
@@ -501,9 +501,9 @@ cleaner_cb (void *cls,
501 gettext_noop ("# mesh connections active"), -1, 501 gettext_noop ("# mesh connections active"), -1,
502 GNUNET_NO); 502 GNUNET_NO);
503 if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task) 503 if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task)
504 GNUNET_SCHEDULER_cancel (sc->terminate_task); 504 GNUNET_SCHEDULER_cancel (sc->terminate_task);
505 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) 505 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
506 GNUNET_SCHEDULER_cancel (sc->timeout_task); 506 GNUNET_SCHEDULER_cancel (sc->timeout_task);
507 if (NULL != sc->wh) 507 if (NULL != sc->wh)
508 GNUNET_MESH_notify_transmit_ready_cancel (sc->wh); 508 GNUNET_MESH_notify_transmit_ready_cancel (sc->wh);
509 if (NULL != sc->qe) 509 if (NULL != sc->qe)
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 9e92be2ed..607eb6122 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -57,7 +57,7 @@ struct PeerPlan;
57 * are stored in a 'struct GSF_RequestPlan'. (We need 57 * are stored in a 'struct GSF_RequestPlan'. (We need
58 * to be able to lookup all pending requests corresponding 58 * to be able to lookup all pending requests corresponding
59 * to a given plan entry.) 59 * to a given plan entry.)
60 * 60 *
61 * Similarly head and tail of the "PR" MDLL are stored 61 * Similarly head and tail of the "PR" MDLL are stored
62 * with the 'struct GSF_PendingRequest'. (We need 62 * with the 'struct GSF_PendingRequest'. (We need
63 * to be able to lookup all plan entries corresponding 63 * to be able to lookup all plan entries corresponding
@@ -360,7 +360,7 @@ get_latest (const struct GSF_RequestPlan *rp)
360 if (NULL == bi) 360 if (NULL == bi)
361 return NULL; /* should never happen */ 361 return NULL; /* should never happen */
362 ret = bi->pr; 362 ret = bi->pr;
363 bi = bi->next_PE; 363 bi = bi->next_PE;
364 while (NULL != bi) 364 while (NULL != bi)
365 { 365 {
366 if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us > 366 if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us >
@@ -594,7 +594,7 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr)
594 pp->delay_heap = 594 pp->delay_heap =
595 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); 595 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
596 pp->cp = cp; 596 pp->cp = cp;
597 GNUNET_CONTAINER_multipeermap_put (plans, 597 GNUNET_CONTAINER_multipeermap_put (plans,
598 id, pp, 598 id, pp,
599 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 599 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
600 } 600 }
diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h
index d1362675c..22b760922 100644
--- a/src/fs/gnunet-service-fs_pe.h
+++ b/src/fs/gnunet-service-fs_pe.h
@@ -68,7 +68,7 @@ GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr);
68 * @return GNUNET_YES if 'result' was changed, GNUNET_NO otherwise. 68 * @return GNUNET_YES if 'result' was changed, GNUNET_NO otherwise.
69 */ 69 */
70int 70int
71GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head, 71GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head,
72 struct GSF_ConnectedPeer *sender, 72 struct GSF_ConnectedPeer *sender,
73 struct GNUNET_TIME_Absolute *result); 73 struct GNUNET_TIME_Absolute *result);
74 74
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index b624f536c..9171bfc2a 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -367,7 +367,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
367 { 367 {
368 refresh_bloomfilter (pr); 368 refresh_bloomfilter (pr);
369 } 369 }
370 GNUNET_CONTAINER_multihashmap_put (pr_map, 370 GNUNET_CONTAINER_multihashmap_put (pr_map,
371 &pr->public_data.query, pr, 371 &pr->public_data.query, pr,
372 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 372 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
373 if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES)) 373 if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES))
@@ -482,7 +482,7 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
482 } 482 }
483 } 483 }
484 } 484 }
485 if (NULL != pr->gh) 485 if (NULL != pr->gh)
486 GNUNET_DHT_get_filter_known_results (pr->gh, 486 GNUNET_DHT_get_filter_known_results (pr->gh,
487 replies_seen_count, 487 replies_seen_count,
488 replies_seen); 488 replies_seen);
@@ -828,8 +828,8 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
828 GNUNET_TIME_absolute_get_duration (pr-> 828 GNUNET_TIME_absolute_get_duration (pr->
829 public_data.start_time).rel_value_us); 829 public_data.start_time).rel_value_us);
830 if (GNUNET_YES != 830 if (GNUNET_YES !=
831 GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, 831 GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head,
832 prq->sender, 832 prq->sender,
833 &last_transmission)) 833 &last_transmission))
834 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; 834 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
835 /* pass on to other peers / local clients */ 835 /* pass on to other peers / local clients */
@@ -890,10 +890,10 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
890 prq->request_found = GNUNET_YES; 890 prq->request_found = GNUNET_YES;
891 /* finally, pass on to other peer / local client */ 891 /* finally, pass on to other peer / local client */
892 if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, 892 if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head,
893 prq->sender, 893 prq->sender,
894 &last_transmission)) 894 &last_transmission))
895 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; 895 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
896 pr->rh (pr->rh_cls, prq->eval, pr, 896 pr->rh (pr->rh_cls, prq->eval, pr,
897 prq->anonymity_level, prq->expiration, 897 prq->anonymity_level, prq->expiration,
898 last_transmission, prq->type, prq->data, prq->size); 898 last_transmission, prq->type, prq->data, prq->size);
899 return GNUNET_YES; 899 return GNUNET_YES;
@@ -934,7 +934,7 @@ struct PutMigrationContext
934 * @param msg NULL on success, otherwise an error message 934 * @param msg NULL on success, otherwise an error message
935 */ 935 */
936static void 936static void
937put_migration_continuation (void *cls, int success, 937put_migration_continuation (void *cls, int success,
938 struct GNUNET_TIME_Absolute min_expiration, 938 struct GNUNET_TIME_Absolute min_expiration,
939 const char *msg) 939 const char *msg)
940{ 940{
@@ -947,13 +947,13 @@ put_migration_continuation (void *cls, int success,
947 { 947 {
948 if (GNUNET_SYSERR != success) 948 if (GNUNET_SYSERR != success)
949 { 949 {
950 GNUNET_LOAD_update (datastore_put_load, 950 GNUNET_LOAD_update (datastore_put_load,
951 GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us); 951 GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us);
952 } 952 }
953 else 953 else
954 { 954 {
955 /* on queue failure / timeout, increase the put load dramatically */ 955 /* on queue failure / timeout, increase the put load dramatically */
956 GNUNET_LOAD_update (datastore_put_load, 956 GNUNET_LOAD_update (datastore_put_load,
957 GNUNET_TIME_UNIT_MINUTES.rel_value_us); 957 GNUNET_TIME_UNIT_MINUTES.rel_value_us);
958 } 958 }
959 } 959 }
@@ -968,17 +968,17 @@ put_migration_continuation (void *cls, int success,
968 GNUNET_free (pmc); 968 GNUNET_free (pmc);
969 return; 969 return;
970 } 970 }
971 if ( (GNUNET_NO == success) && 971 if ( (GNUNET_NO == success) &&
972 (GNUNET_NO == pmc->requested) && 972 (GNUNET_NO == pmc->requested) &&
973 (NULL != cp) ) 973 (NULL != cp) )
974 { 974 {
975 ppd = GSF_get_peer_performance_data_ (cp); 975 ppd = GSF_get_peer_performance_data_ (cp);
976 if (min_expiration.abs_value_us > 0) 976 if (min_expiration.abs_value_us > 0)
977 { 977 {
978 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 978 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
979 "Asking to stop migration for %s because datastore is full\n", 979 "Asking to stop migration for %s because datastore is full\n",
980 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_expiration), GNUNET_YES)); 980 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_expiration), GNUNET_YES));
981 GSF_block_peer_migration_ (cp, min_expiration); 981 GSF_block_peer_migration_ (cp, min_expiration);
982 } 982 }
983 else 983 else
984 { 984 {
@@ -989,7 +989,7 @@ put_migration_continuation (void *cls, int success,
989 mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 989 mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
990 ppd->migration_delay.rel_value_us); 990 ppd->migration_delay.rel_value_us);
991 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); 991 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2);
992 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 992 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
993 "Replicated content already exists locally, asking to stop migration for %s\n", 993 "Replicated content already exists locally, asking to stop migration for %s\n",
994 GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES)); 994 GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES));
995 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause)); 995 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause));
@@ -1123,12 +1123,12 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr)
1123 xquery_size += sizeof (struct GNUNET_PeerIdentity); 1123 xquery_size += sizeof (struct GNUNET_PeerIdentity);
1124 } 1124 }
1125 pr->gh = 1125 pr->gh =
1126 GNUNET_DHT_get_start (GSF_dht, 1126 GNUNET_DHT_get_start (GSF_dht,
1127 pr->public_data.type, &pr->public_data.query, 1127 pr->public_data.type, &pr->public_data.query,
1128 DHT_GET_REPLICATION, 1128 DHT_GET_REPLICATION,
1129 GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, 1129 GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE,
1130 xquery, xquery_size, &handle_dht_reply, pr); 1130 xquery, xquery_size, &handle_dht_reply, pr);
1131 if ( (NULL != pr->gh) && 1131 if ( (NULL != pr->gh) &&
1132 (0 != pr->replies_seen_count) ) 1132 (0 != pr->replies_seen_count) )
1133 GNUNET_DHT_get_filter_known_results (pr->gh, 1133 GNUNET_DHT_get_filter_known_results (pr->gh,
1134 pr->replies_seen_count, 1134 pr->replies_seen_count,
@@ -1138,7 +1138,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr)
1138 1138
1139/** 1139/**
1140 * Function called with a reply from the mesh. 1140 * Function called with a reply from the mesh.
1141 * 1141 *
1142 * @param cls the pending request struct 1142 * @param cls the pending request struct
1143 * @param type type of the block, ANY on error 1143 * @param type type of the block, ANY on error
1144 * @param expiration expiration time for the block 1144 * @param expiration expiration time for the block
@@ -1698,7 +1698,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1698 test_put_load_too_high (prq.priority)); 1698 test_put_load_too_high (prq.priority));
1699 } 1699 }
1700 putl = GNUNET_LOAD_get_load (datastore_put_load); 1700 putl = GNUNET_LOAD_get_load (datastore_put_load);
1701 if ( (NULL != cp) && 1701 if ( (NULL != cp) &&
1702 (GNUNET_NO == prq.request_found) && 1702 (GNUNET_NO == prq.request_found) &&
1703 ( (GNUNET_YES != active_to_migration) || 1703 ( (GNUNET_YES != active_to_migration) ||
1704 (putl > 2.5 * (1 + prq.priority)) ) ) 1704 (putl > 2.5 * (1 + prq.priority)) ) )
@@ -1711,7 +1711,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1711 GNUNET_CRYPTO_random_u32 1711 GNUNET_CRYPTO_random_u32
1712 (GNUNET_CRYPTO_QUALITY_WEAK, 1712 (GNUNET_CRYPTO_QUALITY_WEAK,
1713 (unsigned int) (60000 * putl * putl))); 1713 (unsigned int) (60000 * putl * putl)));
1714 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1714 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1715 "Asking to stop migration for %s because of load %f and events %d/%d\n", 1715 "Asking to stop migration for %s because of load %f and events %d/%d\n",
1716 GNUNET_STRINGS_relative_time_to_string (block_time, 1716 GNUNET_STRINGS_relative_time_to_string (block_time,
1717 GNUNET_YES), 1717 GNUNET_YES),
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index ef796f559..8e9d70f72 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -178,10 +178,10 @@ delay_dht_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
178 * maybe 0 if no unique identifier is available 178 * maybe 0 if no unique identifier is available
179 */ 179 */
180static void 180static void
181process_dht_put_content (void *cls, 181process_dht_put_content (void *cls,
182 const struct GNUNET_HashCode * key, 182 const struct GNUNET_HashCode * key,
183 size_t size, 183 size_t size,
184 const void *data, 184 const void *data,
185 enum GNUNET_BLOCK_Type type, 185 enum GNUNET_BLOCK_Type type,
186 uint32_t priority, uint32_t anonymity, 186 uint32_t priority, uint32_t anonymity,
187 struct GNUNET_TIME_Absolute expiration, uint64_t uid) 187 struct GNUNET_TIME_Absolute expiration, uint64_t uid)
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c
index 61356a644..2462bb3f2 100644
--- a/src/fs/perf_gnunet_service_fs_p2p.c
+++ b/src/fs/perf_gnunet_service_fs_p2p.c
@@ -124,7 +124,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
124 * Function that gathers stats from all daemons. 124 * Function that gathers stats from all daemons.
125 */ 125 */
126static void 126static void
127stat_run (void *cls, 127stat_run (void *cls,
128 struct GNUNET_TESTBED_Operation *op, 128 struct GNUNET_TESTBED_Operation *op,
129 void *ca_result, 129 void *ca_result,
130 const char *emsg); 130 const char *emsg);
@@ -147,7 +147,7 @@ get_done (void *cls, int success)
147/** 147/**
148 * Adapter function called to establish a connection to 148 * Adapter function called to establish a connection to
149 * statistics service. 149 * statistics service.
150 * 150 *
151 * @param cls closure 151 * @param cls closure
152 * @param cfg configuration of the peer to connect to; will be available until 152 * @param cfg configuration of the peer to connect to; will be available until
153 * GNUNET_TESTBED_operation_done() is called on the operation returned 153 * GNUNET_TESTBED_operation_done() is called on the operation returned
@@ -166,11 +166,11 @@ statistics_connect_adapter (void *cls,
166/** 166/**
167 * Adapter function called to destroy a connection to 167 * Adapter function called to destroy a connection to
168 * statistics service. 168 * statistics service.
169 * 169 *
170 * @param cls closure 170 * @param cls closure
171 * @param op_result service handle returned from the connect adapter 171 * @param op_result service handle returned from the connect adapter
172 */ 172 */
173static void 173static void
174statistics_disconnect_adapter (void *cls, 174statistics_disconnect_adapter (void *cls,
175 void *op_result) 175 void *op_result)
176{ 176{
@@ -182,7 +182,7 @@ statistics_disconnect_adapter (void *cls,
182 * Function that gathers stats from all daemons. 182 * Function that gathers stats from all daemons.
183 */ 183 */
184static void 184static void
185stat_run (void *cls, 185stat_run (void *cls,
186 struct GNUNET_TESTBED_Operation *op, 186 struct GNUNET_TESTBED_Operation *op,
187 void *ca_result, 187 void *ca_result,
188 const char *emsg) 188 const char *emsg)
@@ -244,12 +244,12 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
244 GNUNET_DISK_directory_remove (fn); 244 GNUNET_DISK_directory_remove (fn);
245 GNUNET_free (fn); 245 GNUNET_free (fn);
246 } 246 }
247 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) 247 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT))
248 { 248 {
249 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 249 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
250 "Timeout during download, shutting down with error\n"); 250 "Timeout during download, shutting down with error\n");
251 ok = 1; 251 ok = 1;
252 GNUNET_SCHEDULER_shutdown (); 252 GNUNET_SCHEDULER_shutdown ();
253 return; 253 return;
254 } 254 }
255 255
@@ -276,7 +276,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276 276
277 277
278static void 278static void
279do_download (void *cls, 279do_download (void *cls,
280 const struct GNUNET_FS_Uri *uri, 280 const struct GNUNET_FS_Uri *uri,
281 const char *fn) 281 const char *fn)
282{ 282{
@@ -298,7 +298,7 @@ do_download (void *cls,
298 else 298 else
299 anonymity = 1; 299 anonymity = 1;
300 GNUNET_FS_TEST_download (daemons[0], TIMEOUT, anonymity, SEED, uri, VERBOSE, 300 GNUNET_FS_TEST_download (daemons[0], TIMEOUT, anonymity, SEED, uri, VERBOSE,
301 &do_report, 301 &do_report,
302 (NULL == fn) ? NULL : GNUNET_strdup (fn)); 302 (NULL == fn) ? NULL : GNUNET_strdup (fn));
303} 303}
304 304
@@ -314,7 +314,7 @@ do_publish (void *cls,
314 unsigned int i; 314 unsigned int i;
315 int do_index; 315 int do_index;
316 int anonymity; 316 int anonymity;
317 317
318 GNUNET_assert (NUM_DAEMONS == num_peers); 318 GNUNET_assert (NUM_DAEMONS == num_peers);
319 for (i=0;i<num_peers;i++) 319 for (i=0;i<num_peers;i++)
320 daemons[i] = peers[i]; 320 daemons[i] = peers[i];
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c
index 8790dcc75..b2471a8b4 100644
--- a/src/fs/perf_gnunet_service_fs_p2p_respect.c
+++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c
@@ -178,7 +178,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
178 * Function that gathers stats from all daemons. 178 * Function that gathers stats from all daemons.
179 */ 179 */
180static void 180static void
181stat_run (void *cls, 181stat_run (void *cls,
182 struct GNUNET_TESTBED_Operation *op, 182 struct GNUNET_TESTBED_Operation *op,
183 void *ca_result, 183 void *ca_result,
184 const char *emsg); 184 const char *emsg);
@@ -202,7 +202,7 @@ get_done (void *cls, int success)
202/** 202/**
203 * Adapter function called to establish a connection to 203 * Adapter function called to establish a connection to
204 * statistics service. 204 * statistics service.
205 * 205 *
206 * @param cls closure 206 * @param cls closure
207 * @param cfg configuration of the peer to connect to; will be available until 207 * @param cfg configuration of the peer to connect to; will be available until
208 * GNUNET_TESTBED_operation_done() is called on the operation returned 208 * GNUNET_TESTBED_operation_done() is called on the operation returned
@@ -221,11 +221,11 @@ statistics_connect_adapter (void *cls,
221/** 221/**
222 * Adapter function called to destroy a connection to 222 * Adapter function called to destroy a connection to
223 * statistics service. 223 * statistics service.
224 * 224 *
225 * @param cls closure 225 * @param cls closure
226 * @param op_result service handle returned from the connect adapter 226 * @param op_result service handle returned from the connect adapter
227 */ 227 */
228static void 228static void
229statistics_disconnect_adapter (void *cls, 229statistics_disconnect_adapter (void *cls,
230 void *op_result) 230 void *op_result)
231{ 231{
@@ -237,7 +237,7 @@ statistics_disconnect_adapter (void *cls,
237 * Function that gathers stats from all daemons. 237 * Function that gathers stats from all daemons.
238 */ 238 */
239static void 239static void
240stat_run (void *cls, 240stat_run (void *cls,
241 struct GNUNET_TESTBED_Operation *op, 241 struct GNUNET_TESTBED_Operation *op,
242 void *ca_result, 242 void *ca_result,
243 const char *emsg) 243 const char *emsg)
@@ -362,7 +362,7 @@ do_downloads (void *cls, const struct GNUNET_FS_Uri *u2,
362 362
363 363
364static void 364static void
365do_publish2 (void *cls, 365do_publish2 (void *cls,
366 const struct GNUNET_FS_Uri *u1, 366 const struct GNUNET_FS_Uri *u1,
367 const char *fn) 367 const char *fn)
368{ 368{
@@ -398,7 +398,7 @@ do_publish2 (void *cls,
398 398
399 399
400static void 400static void
401do_publish1 (void *cls, 401do_publish1 (void *cls,
402 struct GNUNET_TESTBED_Operation *op, 402 struct GNUNET_TESTBED_Operation *op,
403 const char *emsg) 403 const char *emsg)
404{ 404{
@@ -433,7 +433,7 @@ do_publish1 (void *cls,
433 433
434 434
435static void 435static void
436do_connect (void *cls, 436do_connect (void *cls,
437 struct GNUNET_TESTBED_RunHandle *h, 437 struct GNUNET_TESTBED_RunHandle *h,
438 unsigned int num_peers, 438 unsigned int num_peers,
439 struct GNUNET_TESTBED_Peer **peers, 439 struct GNUNET_TESTBED_Peer **peers,
@@ -443,7 +443,7 @@ do_connect (void *cls,
443 static unsigned int coco; 443 static unsigned int coco;
444 unsigned int i; 444 unsigned int i;
445 unsigned int j; 445 unsigned int j;
446 446
447 GNUNET_assert (NUM_DAEMONS == num_peers); 447 GNUNET_assert (NUM_DAEMONS == num_peers);
448 for (i=0;i<num_peers;i++) 448 for (i=0;i<num_peers;i++)
449 daemons[i] = peers[i]; 449 daemons[i] = peers[i];
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index c069875cf..52652dbd3 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -146,8 +146,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
146 (1 + 146 (1 +
147 GNUNET_TIME_absolute_get_duration 147 GNUNET_TIME_absolute_get_duration
148 (start).rel_value_us) / 1024LL)); 148 (start).rel_value_us) / 1024LL));
149 GAUGER ("FS", 149 GAUGER ("FS",
150 (GNUNET_YES == indexed) 150 (GNUNET_YES == indexed)
151 ? "Publishing speed (indexing)" 151 ? "Publishing speed (indexing)"
152 : "Publishing speed (insertion)", 152 : "Publishing speed (insertion)",
153 (unsigned long long) (FILESIZE * 1000000LL / 153 (unsigned long long) (FILESIZE * 1000000LL /
@@ -160,7 +160,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
160 GNUNET_FS_download_start (fs, 160 GNUNET_FS_download_start (fs,
161 event->value.publish.specifics. 161 event->value.publish.specifics.
162 completed.chk_uri, NULL, fn, NULL, 0, 162 completed.chk_uri, NULL, fn, NULL, 0,
163 FILESIZE, anonymity_level, 163 FILESIZE, anonymity_level,
164 GNUNET_FS_DOWNLOAD_OPTION_NONE, 164 GNUNET_FS_DOWNLOAD_OPTION_NONE,
165 "download", NULL); 165 "download", NULL);
166 GNUNET_assert (download != NULL); 166 GNUNET_assert (download != NULL);
@@ -173,8 +173,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
173 GNUNET_TIME_absolute_get_duration 173 GNUNET_TIME_absolute_get_duration
174 (start).rel_value_us) / 1024LL)); 174 (start).rel_value_us) / 1024LL));
175 GAUGER ("FS", 175 GAUGER ("FS",
176 (GNUNET_YES == indexed) 176 (GNUNET_YES == indexed)
177 ? "Local download speed (indexed)" 177 ? "Local download speed (indexed)"
178 : "Local download speed (inserted)", 178 : "Local download speed (inserted)",
179 (unsigned long long) (FILESIZE * 1000000LL / 179 (unsigned long long) (FILESIZE * 1000000LL /
180 (1 + 180 (1 +
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index b380fd4af..7c9c8c227 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -276,7 +276,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
276 276
277 277
278static void 278static void
279run (void *cls, 279run (void *cls,
280 const struct GNUNET_CONFIGURATION_Handle *c, 280 const struct GNUNET_CONFIGURATION_Handle *c,
281 struct GNUNET_TESTING_Peer *peer) 281 struct GNUNET_TESTING_Peer *peer)
282{ 282{
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index 11c611e04..b0358e809 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -281,8 +281,8 @@ testNamespace ()
281 bo.expiration_time = 281 bo.expiration_time =
282 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); 282 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
283 sks_uri = GNUNET_FS_uri_sks_create (&nsid, "root"); 283 sks_uri = GNUNET_FS_uri_sks_create (&nsid, "root");
284 GNUNET_FS_publish_ksk (fs, 284 GNUNET_FS_publish_ksk (fs,
285 ksk_uri, meta, sks_uri, 285 ksk_uri, meta, sks_uri,
286 &bo, GNUNET_FS_PUBLISH_OPTION_NONE, 286 &bo, GNUNET_FS_PUBLISH_OPTION_NONE,
287 &adv_cont, NULL); 287 &adv_cont, NULL);
288 GNUNET_FS_uri_destroy (sks_uri); 288 GNUNET_FS_uri_destroy (sks_uri);
@@ -296,7 +296,7 @@ testNamespace ()
296 296
297 297
298static void 298static void
299run (void *cls, 299run (void *cls,
300 const struct GNUNET_CONFIGURATION_Handle *cfg, 300 const struct GNUNET_CONFIGURATION_Handle *cfg,
301 struct GNUNET_TESTING_Peer *peer) 301 struct GNUNET_TESTING_Peer *peer)
302{ 302{
diff --git a/src/fs/test_fs_namespace_list_updateable.c b/src/fs/test_fs_namespace_list_updateable.c
index d42dfb7f4..69fc6542c 100644
--- a/src/fs/test_fs_namespace_list_updateable.c
+++ b/src/fs/test_fs_namespace_list_updateable.c
@@ -150,7 +150,7 @@ testNamespace ()
150 150
151 151
152static void 152static void
153run (void *cls, 153run (void *cls,
154 const struct GNUNET_CONFIGURATION_Handle *cfg, 154 const struct GNUNET_CONFIGURATION_Handle *cfg,
155 struct GNUNET_TESTING_Peer *peer) 155 struct GNUNET_TESTING_Peer *peer)
156{ 156{
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index 7ff9c9202..41b4abd26 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -153,7 +153,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
153 153
154 154
155static void 155static void
156run (void *cls, 156run (void *cls,
157 const struct GNUNET_CONFIGURATION_Handle *cfg, 157 const struct GNUNET_CONFIGURATION_Handle *cfg,
158 struct GNUNET_TESTING_Peer *peer) 158 struct GNUNET_TESTING_Peer *peer)
159{ 159{
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index e3bbc77a1..5beb1b7e5 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -93,7 +93,7 @@ restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
93{ 93{
94 rtask = GNUNET_SCHEDULER_NO_TASK; 94 rtask = GNUNET_SCHEDULER_NO_TASK;
95 GNUNET_FS_stop (fs); 95 GNUNET_FS_stop (fs);
96 fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", 96 fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence",
97 &progress_cb, NULL, 97 &progress_cb, NULL,
98 GNUNET_FS_FLAGS_PERSISTENCE, 98 GNUNET_FS_FLAGS_PERSISTENCE,
99 GNUNET_FS_OPTIONS_END); 99 GNUNET_FS_OPTIONS_END);
@@ -223,7 +223,7 @@ progress_cb (void *cls,
223 223
224 224
225static void 225static void
226run (void *cls, 226run (void *cls,
227 const struct GNUNET_CONFIGURATION_Handle *c, 227 const struct GNUNET_CONFIGURATION_Handle *c,
228 struct GNUNET_TESTING_Peer *peer) 228 struct GNUNET_TESTING_Peer *peer)
229{ 229{
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 5c1644d4a..faf8727a6 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -59,7 +59,7 @@ static int err;
59 59
60static void 60static void
61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
62{ 62{
63 if (NULL != publish) 63 if (NULL != publish)
64 { 64 {
65 GNUNET_FS_publish_stop (publish); 65 GNUNET_FS_publish_stop (publish);
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index 380c857aa..969c525c6 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -203,7 +203,7 @@ run (void *cls,
203 size_t i; 203 size_t i;
204 204
205 fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL, 205 fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL,
206 GNUNET_FS_FLAGS_DO_PROBES, 206 GNUNET_FS_FLAGS_DO_PROBES,
207 GNUNET_FS_OPTIONS_END); 207 GNUNET_FS_OPTIONS_END);
208 GNUNET_assert (NULL != fs); 208 GNUNET_assert (NULL != fs);
209 buf = GNUNET_malloc (FILESIZE); 209 buf = GNUNET_malloc (FILESIZE);
diff --git a/src/fs/test_fs_start_stop.c b/src/fs/test_fs_start_stop.c
index 463274e48..52c54b752 100644
--- a/src/fs/test_fs_start_stop.c
+++ b/src/fs/test_fs_start_stop.c
@@ -37,7 +37,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
37 37
38 38
39static void 39static void
40run (void *cls, 40run (void *cls,
41 const struct GNUNET_CONFIGURATION_Handle *cfg, 41 const struct GNUNET_CONFIGURATION_Handle *cfg,
42 struct GNUNET_TESTING_Peer *peer) 42 struct GNUNET_TESTING_Peer *peer)
43{ 43{
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 689456aa4..80b7dcf7c 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -90,7 +90,7 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri,
90 90
91 91
92static void 92static void
93do_publish (void *cls, 93do_publish (void *cls,
94 struct GNUNET_TESTBED_Operation *op, 94 struct GNUNET_TESTBED_Operation *op,
95 const char *emsg) 95 const char *emsg)
96{ 96{
@@ -113,7 +113,7 @@ do_publish (void *cls,
113 113
114/** 114/**
115 * Actual main function for the test. 115 * Actual main function for the test.
116 * 116 *
117 * @param cls closure 117 * @param cls closure
118 * @param h the run handle 118 * @param h the run handle
119 * @param num_peers number of peers in 'peers' 119 * @param num_peers number of peers in 'peers'
@@ -124,7 +124,7 @@ do_publish (void *cls,
124 * failed 124 * failed
125 */ 125 */
126static void 126static void
127run (void *cls, 127run (void *cls,
128 struct GNUNET_TESTBED_RunHandle *h, 128 struct GNUNET_TESTBED_RunHandle *h,
129 unsigned int num_peers, 129 unsigned int num_peers,
130 struct GNUNET_TESTBED_Peer **peers, 130 struct GNUNET_TESTBED_Peer **peers,
@@ -132,7 +132,7 @@ run (void *cls,
132 unsigned int links_failed) 132 unsigned int links_failed)
133{ 133{
134 unsigned int i; 134 unsigned int i;
135 135
136 GNUNET_assert (NUM_DAEMONS == num_peers); 136 GNUNET_assert (NUM_DAEMONS == num_peers);
137 for (i=0;i<num_peers;i++) 137 for (i=0;i<num_peers;i++)
138 the_peers[i] = peers[i]; 138 the_peers[i] = peers[i];
@@ -147,7 +147,7 @@ run (void *cls,
147/** 147/**
148 * Main function that initializes the testbed. 148 * Main function that initializes the testbed.
149 * 149 *
150 * @param argc ignored 150 * @param argc ignored
151 * @param argv ignored 151 * @param argv ignored
152 * @return 0 on success 152 * @return 0 on success
153 */ 153 */
@@ -157,7 +157,7 @@ main (int argc, char *argv[])
157 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 157 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
158 (void) GNUNET_TESTBED_test_run ("test_fs_test_lib", 158 (void) GNUNET_TESTBED_test_run ("test_fs_test_lib",
159 "fs_test_lib_data.conf", 159 "fs_test_lib_data.conf",
160 NUM_DAEMONS, 160 NUM_DAEMONS,
161 0, NULL, NULL, 161 0, NULL, NULL,
162 &run, NULL); 162 &run, NULL);
163 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 163 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index ef143ecef..f90a01a79 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -231,7 +231,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
231 231
232 232
233static void 233static void
234run (void *cls, 234run (void *cls,
235 const struct GNUNET_CONFIGURATION_Handle *c, 235 const struct GNUNET_CONFIGURATION_Handle *c,
236 struct GNUNET_TESTING_Peer *peer) 236 struct GNUNET_TESTING_Peer *peer)
237{ 237{
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index 436b8f66d..770c212ba 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -93,7 +93,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
93 93
94 94
95static void 95static void
96do_download (void *cls, 96do_download (void *cls,
97 const char *emsg) 97 const char *emsg)
98{ 98{
99 struct DownloadContext *dc = cls; 99 struct DownloadContext *dc = cls;
@@ -160,7 +160,7 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri,
160 160
161 161
162static void 162static void
163do_publish (void *cls, 163do_publish (void *cls,
164 struct GNUNET_TESTBED_RunHandle *h, 164 struct GNUNET_TESTBED_RunHandle *h,
165 unsigned int num_peers, 165 unsigned int num_peers,
166 struct GNUNET_TESTBED_Peer **peers, 166 struct GNUNET_TESTBED_Peer **peers,
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index 9c01695b5..034bb7b0e 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -103,10 +103,10 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri,
103 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", 103 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
104 (unsigned long long) FILESIZE); 104 (unsigned long long) FILESIZE);
105 start_time = GNUNET_TIME_absolute_get (); 105 start_time = GNUNET_TIME_absolute_get ();
106 GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 106 GNUNET_FS_TEST_download (daemons[0], TIMEOUT,
107 anonymity_level, SEED, uri, 107 anonymity_level, SEED, uri,
108 VERBOSE, &do_stop, 108 VERBOSE, &do_stop,
109 (NULL == fn) 109 (NULL == fn)
110 ? NULL 110 ? NULL
111 : GNUNET_strdup (fn)); 111 : GNUNET_strdup (fn));
112} 112}
@@ -121,7 +121,7 @@ do_publish (void *cls,
121 unsigned int links_failed) 121 unsigned int links_failed)
122{ 122{
123 unsigned int i; 123 unsigned int i;
124 124
125 if (NULL != strstr (progname, "mesh")) 125 if (NULL != strstr (progname, "mesh"))
126 anonymity_level = 0; 126 anonymity_level = 0;
127 else 127 else
@@ -131,8 +131,8 @@ do_publish (void *cls,
131 daemons[i] = peers[i]; 131 daemons[i] = peers[i];
132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", 132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n",
133 (unsigned long long) FILESIZE); 133 (unsigned long long) FILESIZE);
134 GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 134 GNUNET_FS_TEST_publish (daemons[1], TIMEOUT,
135 anonymity_level, GNUNET_NO, 135 anonymity_level, GNUNET_NO,
136 FILESIZE, SEED, 136 FILESIZE, SEED,
137 VERBOSE, &do_download, NULL); 137 VERBOSE, &do_download, NULL);
138} 138}