From 61c39c60565b386e0e12ea669556b030e8cd7180 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 6 Oct 2013 20:55:28 +0000 Subject: -remove trailing whitespace --- src/fs/fs_api.c | 34 +++++++++---------- src/fs/fs_api.h | 14 ++++---- src/fs/fs_dirmetascan.c | 52 ++++++++++++++--------------- src/fs/fs_download.c | 24 ++++++------- src/fs/fs_namespace.c | 26 +++++++-------- src/fs/fs_publish.c | 48 +++++++++++++------------- src/fs/fs_publish_ksk.c | 8 ++--- src/fs/fs_publish_ublock.c | 14 ++++---- src/fs/fs_publish_ublock.h | 4 +-- src/fs/fs_search.c | 52 ++++++++++++++--------------- src/fs/fs_sharetree.c | 16 ++++----- src/fs/fs_test_lib.c | 30 ++++++++--------- src/fs/fs_unindex.c | 22 ++++++------ src/fs/fs_uri.c | 24 ++++++------- src/fs/gnunet-auto-share.c | 26 +++++++-------- src/fs/gnunet-daemon-fsprofiler.c | 42 +++++++++++------------ src/fs/gnunet-download.c | 8 ++--- src/fs/gnunet-fs-profiler.c | 6 ++-- src/fs/gnunet-helper-fs-publish.c | 46 ++++++++++++------------- src/fs/gnunet-publish.c | 36 ++++++++++---------- src/fs/gnunet-service-fs.c | 8 ++--- src/fs/gnunet-service-fs_cp.c | 24 ++++++------- src/fs/gnunet-service-fs_indexing.c | 4 +-- src/fs/gnunet-service-fs_lc.c | 2 +- src/fs/gnunet-service-fs_mesh.h | 2 +- src/fs/gnunet-service-fs_mesh_client.c | 30 ++++++++--------- src/fs/gnunet-service-fs_mesh_server.c | 32 +++++++++--------- src/fs/gnunet-service-fs_pe.c | 6 ++-- src/fs/gnunet-service-fs_pe.h | 2 +- src/fs/gnunet-service-fs_pr.c | 38 ++++++++++----------- src/fs/gnunet-service-fs_put.c | 6 ++-- src/fs/perf_gnunet_service_fs_p2p.c | 20 +++++------ src/fs/perf_gnunet_service_fs_p2p_respect.c | 18 +++++----- src/fs/test_fs_download.c | 10 +++--- src/fs/test_fs_download_persistence.c | 2 +- src/fs/test_fs_namespace.c | 6 ++-- src/fs/test_fs_namespace_list_updateable.c | 2 +- src/fs/test_fs_publish.c | 2 +- src/fs/test_fs_publish_persistence.c | 4 +-- src/fs/test_fs_search.c | 2 +- src/fs/test_fs_search_probes.c | 2 +- src/fs/test_fs_start_stop.c | 2 +- src/fs/test_fs_test_lib.c | 12 +++---- src/fs/test_fs_unindex_persistence.c | 2 +- src/fs/test_gnunet_service_fs_migration.c | 4 +-- src/fs/test_gnunet_service_fs_p2p.c | 12 +++---- 46 files changed, 393 insertions(+), 393 deletions(-) (limited to 'src/fs') 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) /* stop probes if possible */ num_probes_change = - num_probes_active; num_downloads_change = h->max_parallel_requests - h->active_downloads; - } - else + } + else { /* start all downloads */ num_downloads_change = num_downloads_waiting; @@ -220,7 +220,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) num_probes_change = GNUNET_MIN (num_probes_waiting, h->max_parallel_requests - (h->active_downloads + num_downloads_waiting)); } - + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Changing %d probes and %d downloads\n", num_probes_change, @@ -232,7 +232,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) next = qe->next; if (GNUNET_FS_QUEUE_PRIORITY_PROBE != qe->priority) continue; - if (num_probes_change < 0) + if (num_probes_change < 0) { stop_job (qe); num_probes_change++; @@ -266,7 +266,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ( (qe->blocks + h->active_blocks <= h->max_parallel_requests) || ( (qe->blocks > h->max_parallel_requests) && (0 == h->active_downloads) ) ) ) - { + { start_job (qe); num_downloads_change--; } @@ -284,7 +284,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "AD: %u, MP: %u; %d probes and %d downloads to start, will run again in %s\n", h->active_downloads, - h->max_parallel_requests, + h->max_parallel_requests, num_probes_change, num_downloads_change, 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, return 0; } } - if ( (GNUNET_SYSERR == + if ( (GNUNET_SYSERR == GNUNET_DISK_file_seek (fi->fd, offset, GNUNET_DISK_SEEK_SET)) || (-1 == (ret = GNUNET_DISK_file_read (fi->fd, buf, max))) ) { @@ -1398,7 +1398,7 @@ cleanup: * @return NULL if srch was not found in this subtree */ static struct GNUNET_FS_FileInformation * -find_file_position (struct GNUNET_FS_FileInformation *pos, +find_file_position (struct GNUNET_FS_FileInformation *pos, const char *srch) { struct GNUNET_FS_FileInformation *r; @@ -1409,7 +1409,7 @@ find_file_position (struct GNUNET_FS_FileInformation *pos, return pos; if ( (GNUNET_YES == pos->is_directory) && (NULL != (r = find_file_position (pos->data.dir.entries, srch))) ) - return r; + return r; pos = pos->next; } return NULL; @@ -1556,7 +1556,7 @@ deserialize_publish_file (void *cls, const char *filename) GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); pc->upload_task = GNUNET_SCHEDULER_add_with_priority - (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, + (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, pc); } if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) @@ -2031,8 +2031,8 @@ cleanup: if (NULL != wh) (void) GNUNET_BIO_write_close (wh); remove_sync_file_in_dir (sr->h, - (NULL == sr->sc->psearch_result) - ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH + (NULL == sr->sc->psearch_result) + ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, sr->sc->serialization, sr->serialization); GNUNET_free (sr->serialization); @@ -2057,8 +2057,8 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc) const char *category; category = - (NULL == sc->psearch_result) - ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH + (NULL == sc->psearch_result) + ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH : GNUNET_FS_SYNC_PATH_CHILD_SEARCH; if (NULL == sc->serialization) sc->serialization = make_serialization_file_name (sc->h, category); @@ -2163,7 +2163,7 @@ deserialize_unindex_file (void *cls, const char *filename) { GNUNET_break (0); goto cleanup; - } + } uc->state = (enum UnindexState) state; switch (state) { @@ -2316,8 +2316,8 @@ deserialize_search_result (void *cls, const char *filename) if (NULL != ser) { remove_sync_file_in_dir (sc->h, - (NULL == sc->psearch_result) - ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH + (NULL == sc->psearch_result) + ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, sc->serialization, ser); 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); /** * Priorities for the queue. - */ + */ enum GNUNET_FS_QueuePriority { /** @@ -1259,7 +1259,7 @@ struct GNUNET_FS_PublishContext * Set to GNUNET_YES if all processing has completed. */ int all_done; - + /** * Flag set to GNUNET_YES if the next callback from * GNUNET_FS_file_information_inspect should be skipped because it @@ -1284,7 +1284,7 @@ enum UnindexState * the respective DBlocks and IBlocks. */ UNINDEX_STATE_DS_REMOVE = 1, - + /** * Find out which keywords apply. */ @@ -1300,12 +1300,12 @@ enum UnindexState * the unindexing. */ UNINDEX_STATE_FS_NOTIFY = 4, - + /** * We're done. */ UNINDEX_STATE_COMPLETE = 5, - + /** * We've encountered a fatal error. */ @@ -1323,7 +1323,7 @@ struct GNUNET_FS_UnindexContext * The content hash key of the last block we processed, will in the * end be set to the CHK from the URI. Used to remove the KBlocks. */ - struct ContentHashKey chk; + struct ContentHashKey chk; /** * Global FS context. @@ -1460,7 +1460,7 @@ struct SearchRequestEntry /** * Derived public key, hashes to 'uquery'. - */ + */ struct GNUNET_CRYPTO_EccPublicSignKey dpub; /** 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 * Second argument to helper process. */ char *ex_arg; - + /** * The function that will be called every time there's a progress * message. */ GNUNET_FS_DirScannerProgressCallback progress_callback; - + /** * A closure for progress_callback. */ @@ -68,7 +68,7 @@ struct GNUNET_FS_DirScanner /** * After the scan is finished, it will contain a pointer to the * top-level directory entry in the directory tree built by the - * scanner. + * scanner. */ struct GNUNET_FS_ShareTreeItem *toplevel; @@ -103,7 +103,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds) /* terminate helper */ if (NULL != ds->helper) GNUNET_HELPER_stop (ds->helper, GNUNET_NO); - + /* free resources */ if (NULL != ds->toplevel) GNUNET_FS_share_tree_free (ds->toplevel); @@ -132,7 +132,7 @@ GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds) GNUNET_assert (NULL == ds->helper); /* preserve result */ result = ds->toplevel; - ds->toplevel = NULL; + ds->toplevel = NULL; GNUNET_FS_directory_scan_abort (ds); return result; } @@ -149,7 +149,7 @@ static struct GNUNET_FS_ShareTreeItem * advance (struct GNUNET_FS_ShareTreeItem *pos) { int moved; - + GNUNET_assert (NULL != pos); moved = 0; /* must not terminate, even on file, otherwise "normal" */ while ( (pos->is_directory == GNUNET_YES) || @@ -214,7 +214,7 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent, if (NULL != parent) GNUNET_CONTAINER_DLL_insert (parent->children_head, parent->children_tail, - chld); + chld); return chld; } @@ -237,9 +237,9 @@ finish_scan (void *cls, GNUNET_HELPER_stop (ds->helper, GNUNET_NO); ds->helper = NULL; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, NULL, GNUNET_SYSERR, - GNUNET_FS_DIRSCANNER_FINISHED); + GNUNET_FS_DIRSCANNER_FINISHED); } @@ -252,7 +252,7 @@ finish_scan (void *cls, * @param msg message from the helper process */ static int -process_helper_msgs (void *cls, +process_helper_msgs (void *cls, void *client, const struct GNUNET_MessageHeader *msg) { @@ -275,7 +275,7 @@ process_helper_msgs (void *cls, GNUNET_break (0); break; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, filename, GNUNET_NO, GNUNET_FS_DIRSCANNER_FILE_START); if (NULL == ds->toplevel) @@ -301,7 +301,7 @@ process_helper_msgs (void *cls, ds->pos = ds->pos->parent; return GNUNET_OK; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, filename, GNUNET_YES, GNUNET_FS_DIRSCANNER_FILE_START); ds->pos = expand_tree (ds->pos, @@ -314,7 +314,7 @@ process_helper_msgs (void *cls, case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE: if ('\0' != filename[left-1]) break; - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, filename, GNUNET_SYSERR, GNUNET_FS_DIRSCANNER_FILE_IGNORED); return GNUNET_OK; @@ -329,7 +329,7 @@ process_helper_msgs (void *cls, GNUNET_break (0); break; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, NULL, GNUNET_SYSERR, GNUNET_FS_DIRSCANNER_ALL_COUNTED); ds->pos = ds->toplevel; @@ -340,7 +340,7 @@ process_helper_msgs (void *cls, { size_t nlen; const char *end; - + if (NULL == ds->pos) { GNUNET_break (0); @@ -361,7 +361,7 @@ process_helper_msgs (void *cls, GNUNET_break (0); break; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, filename, GNUNET_YES, GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); if (0 < left) @@ -373,18 +373,18 @@ process_helper_msgs (void *cls, break; } /* having full filenames is too dangerous; always make sure we clean them up */ - GNUNET_CONTAINER_meta_data_delete (ds->pos->meta, + GNUNET_CONTAINER_meta_data_delete (ds->pos->meta, EXTRACTOR_METATYPE_FILENAME, NULL, 0); /* instead, put in our 'safer' original filename */ GNUNET_CONTAINER_meta_data_insert (ds->pos->meta, "", EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, EXTRACTOR_METAFORMAT_UTF8, "text/plain", - ds->pos->short_filename, + ds->pos->short_filename, strlen (ds->pos->short_filename) + 1); } ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta); - ds->pos = advance (ds->pos); + ds->pos = advance (ds->pos); return GNUNET_OK; } case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED: @@ -397,7 +397,7 @@ process_helper_msgs (void *cls, { GNUNET_break (0); break; - } + } if (NULL == ds->toplevel) { GNUNET_break (0); @@ -410,7 +410,7 @@ process_helper_msgs (void *cls, GNUNET_break (0); break; } - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, NULL, GNUNET_SYSERR, GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); return GNUNET_OK; @@ -430,9 +430,9 @@ helper_died_cb (void *cls) ds->helper = NULL; if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) return; /* normal death, was finished */ - ds->progress_callback (ds->progress_callback_cls, + ds->progress_callback (ds->progress_callback_cls, NULL, GNUNET_SYSERR, - GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); + GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); } @@ -449,7 +449,7 @@ helper_died_cb (void *cls) struct GNUNET_FS_DirScanner * GNUNET_FS_directory_scan_start (const char *filename, int disable_extractor, const char *ex, - GNUNET_FS_DirScannerProgressCallback cb, + GNUNET_FS_DirScannerProgressCallback cb, void *cb_cls) { struct stat sbuf; @@ -468,9 +468,9 @@ GNUNET_FS_directory_scan_start (const char *filename, ds->progress_callback = cb; ds->progress_callback_cls = cb_cls; ds->filename_expanded = filename_expanded; - if (disable_extractor) + if (disable_extractor) ds->ex_arg = GNUNET_strdup ("-"); - else + else ds->ex_arg = (NULL != ex) ? GNUNET_strdup (ex) : NULL; ds->args[0] = "gnunet-helper-fs-publish"; 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, drc = dr->children[i]; GNUNET_assert (drc->offset >= dr->offset); child_block_size = GNUNET_FS_tree_compute_tree_size (drc->depth); - GNUNET_assert (0 == (drc->offset - dr->offset) % child_block_size); + GNUNET_assert (0 == (drc->offset - dr->offset) % child_block_size); if (BRS_INIT == drc->state) { drc->state = BRS_CHK_SET; @@ -1083,7 +1083,7 @@ process_result_with_request (void *cls, const struct GNUNET_HashCode * key, pi.value.download.specifics.progress.respect_offered = prc->respect_offered; pi.value.download.specifics.progress.num_transmissions = prc->num_transmissions; if (prc->last_transmission.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) - pi.value.download.specifics.progress.block_download_duration + pi.value.download.specifics.progress.block_download_duration = GNUNET_TIME_absolute_get_duration (prc->last_transmission); else pi.value.download.specifics.progress.block_download_duration @@ -1445,7 +1445,7 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will try to reconnect in %s\n", GNUNET_STRINGS_relative_time_to_string (dc->reconnect_backoff, GNUNET_YES)); dc->task = - GNUNET_SCHEDULER_add_delayed (dc->reconnect_backoff, + GNUNET_SCHEDULER_add_delayed (dc->reconnect_backoff, &do_reconnect, dc); } @@ -1539,7 +1539,7 @@ deactivate_fs_download (void *cls) * the specified depth */ static struct DownloadRequest * -create_download_request (struct DownloadRequest *parent, +create_download_request (struct DownloadRequest *parent, unsigned int chk_idx, unsigned int depth, uint64_t dr_offset, uint64_t file_start_offset, @@ -1558,7 +1558,7 @@ create_download_request (struct DownloadRequest *parent, if (0 == depth) return dr; child_block_size = GNUNET_FS_tree_compute_tree_size (depth - 1); - + /* calculate how many blocks at this level are not interesting * from the start (rounded down), either because of the requested * file offset or because this IBlock is further along */ @@ -1570,7 +1570,7 @@ create_download_request (struct DownloadRequest *parent, { head_skip = 0; } - + /* calculate index of last block at this level that is interesting (rounded up) */ dr->num_children = (file_start_offset + desired_length - dr_offset) / child_block_size; if (dr->num_children * child_block_size < @@ -1585,12 +1585,12 @@ create_download_request (struct DownloadRequest *parent, (unsigned long long) dr_offset, depth, dr->num_children); - + /* now we can get the total number of *interesting* children for this block */ /* why else would we have gotten here to begin with? (that'd be a bad logic error) */ GNUNET_assert (dr->num_children > 0); - + dr->children = GNUNET_malloc (dr->num_children * sizeof (struct DownloadRequest *)); for (i = 0; i < dr->num_children; i++) @@ -1616,7 +1616,7 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_FS_DownloadContext *dc = cls; - /* clean up state from tree encoder */ + /* clean up state from tree encoder */ if (dc->task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel (dc->task); @@ -1965,7 +1965,7 @@ GNUNET_FS_download_start_task_ (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying bottom-up reconstruction of file `%s'\n", dc->filename); dc->te = - GNUNET_FS_tree_encoder_create (dc->h, + GNUNET_FS_tree_encoder_create (dc->h, GNUNET_FS_uri_chk_get_file_size (dc->uri), dc, &fh_reader, &reconstruct_cb, NULL, @@ -2116,7 +2116,7 @@ create_download_context (struct GNUNET_FS_Handle *h, else dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp"); } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting download `%s' of %llu bytes with tree depth %u\n", filename, (unsigned long long) length, @@ -2267,7 +2267,7 @@ GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc) GNUNET_FS_queue_ (dc->h, &activate_fs_download, &deactivate_fs_download, dc, (dc->length + DBLOCK_SIZE - 1) / DBLOCK_SIZE, (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE)) - ? GNUNET_FS_QUEUE_PRIORITY_NORMAL + ? GNUNET_FS_QUEUE_PRIORITY_NORMAL : GNUNET_FS_QUEUE_PRIORITY_PROBE); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "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, GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); GNUNET_CRYPTO_hash_to_enc (&hc, &enc); - GNUNET_asprintf (&ret, "%s%s%s", - dn, - DIR_SEPARATOR_STR, + GNUNET_asprintf (&ret, "%s%s%s", + dn, + DIR_SEPARATOR_STR, (const char *) enc.encoding); GNUNET_free (dn); return ret; @@ -158,7 +158,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h, /** * Release memory occupied by UIG datastructure. - * + * * @param uig data structure to free */ static void @@ -317,7 +317,7 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, END: if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to read `%s': %s\n"), + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to read `%s': %s\n"), fn, emsg); GNUNET_free (emsg); } @@ -383,7 +383,7 @@ struct GNUNET_FS_PublishSksContext * @param msg error message (or NULL) */ static void -sks_publish_cont (void *cls, +sks_publish_cont (void *cls, const char *msg) { struct GNUNET_FS_PublishSksContext *psc = cls; @@ -405,7 +405,7 @@ sks_publish_cont (void *cls, uig = read_update_information_graph (psc->h, &psc->ns); GNUNET_array_append (uig->update_nodes, - uig->update_node_count, + uig->update_node_count, psc->nsn); psc->nsn = NULL; write_update_information_graph (uig); @@ -549,16 +549,16 @@ struct ProcessUpdateClosure * GNUNET_NO if not. */ static int -process_update_node (void *cls, - const struct GNUNET_HashCode *key, +process_update_node (void *cls, + const struct GNUNET_HashCode *key, void *value) { struct ProcessUpdateClosure *pc = cls; struct NamespaceUpdateNode *nsn = value; pc->ip (pc->ip_cls, - nsn->id, - nsn->uri, + nsn->id, + nsn->uri, nsn->md, nsn->update); return GNUNET_YES; @@ -619,7 +619,7 @@ struct FindTreeClosure */ static int find_trees (void *cls, - const struct GNUNET_HashCode *key, + const struct GNUNET_HashCode *key, void *value) { struct FindTreeClosure *fc = cls; @@ -780,7 +780,7 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, fc.tree_array[fc.id] = nsn; nsn->tree_id = fc.id; } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TREE of node `%s' is %u\n", nsn->id, fc.id); } 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) * @param msg error message (or NULL) */ static void -ds_put_cont (void *cls, int success, +ds_put_cont (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) { @@ -206,14 +206,14 @@ signal_publish_error (struct GNUNET_FS_FileInformation *p, * @param msg error message (typically NULL, not used) */ static void -finish_release_reserve (void *cls, int success, +finish_release_reserve (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) { struct GNUNET_FS_PublishContext *pc = cls; pc->qre = NULL; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Releasing reserve done!\n"); signal_publish_completion (pc->fi, pc); pc->all_done = GNUNET_YES; @@ -268,8 +268,8 @@ publish_sblock (struct GNUNET_FS_PublishContext *pc) { if (NULL != pc->ns) pc->sks_pc = GNUNET_FS_publish_sks (pc->h, - pc->ns, - pc->nid, + pc->ns, + pc->nid, pc->nuid, pc->fi->meta, pc->fi->chk_uri, @@ -300,7 +300,7 @@ publish_kblocks_cont (void *cls, const struct GNUNET_FS_Uri *uri, pc->ksk_pc = NULL; if (NULL != emsg) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error uploading KSK blocks: %s\n", emsg); signal_publish_error (p, pc, emsg); @@ -359,7 +359,7 @@ block_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg) } else { - if (UINT64_MAX == offset) + if (UINT64_MAX == offset) { if (&GNUNET_FS_data_reader_file_ == p->data.file.reader) { @@ -408,10 +408,10 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != emsg) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Error during tree walk: %s\n", + "Error during tree walk: %s\n", emsg); GNUNET_asprintf (&p->emsg, - _("Publishing failed: %s"), + _("Publishing failed: %s"), emsg); GNUNET_free (emsg); pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR; @@ -603,7 +603,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc) GNUNET_FS_file_information_sync_ (p); } size = (GNUNET_YES == p->is_directory) ? p->data.dir.dir_size : p->data.file.file_size; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating tree encoder\n"); p->te = GNUNET_FS_tree_encoder_create (pc->h, size, pc, &block_reader, @@ -625,7 +625,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc) * @param msg the response we got */ static void -process_index_start_response (void *cls, +process_index_start_response (void *cls, const struct GNUNET_MessageHeader *msg) { struct GNUNET_FS_PublishContext *pc = cls; @@ -696,7 +696,7 @@ hash_for_index_cb (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Can not index file `%s': %s. Will try to insert instead.\n"), - p->filename, + p->filename, _("failed to compute hash")); p->data.file.do_index = GNUNET_NO; GNUNET_FS_file_information_sync_ (p); @@ -741,7 +741,7 @@ hash_for_index_cb (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Can not index file `%s': %s. Will try to insert instead.\n"), - p->filename, + p->filename, _("could not connect to `fs' service")); p->data.file.do_index = GNUNET_NO; publish_content (pc); @@ -810,8 +810,8 @@ GNUNET_FS_publish_main_ (void *cls, return; } /* find starting position */ - while ( (GNUNET_YES == p->is_directory) && - (NULL != p->data.dir.entries) && + while ( (GNUNET_YES == p->is_directory) && + (NULL != p->data.dir.entries) && (NULL == p->emsg) && (NULL == p->data.dir.entries->chk_uri) ) { @@ -822,8 +822,8 @@ GNUNET_FS_publish_main_ (void *cls, /* abort on error */ if (NULL != p->emsg) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Error uploading: %s\n", + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Error uploading: %s\n", p->emsg); /* error with current file, abort all * related files as well! */ @@ -928,9 +928,9 @@ fip_signal_start (void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, - struct GNUNET_FS_Uri **uri, + struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, - int *do_index, + int *do_index, void **client_info) { struct GNUNET_FS_PublishContext *pc = cls; @@ -1013,7 +1013,7 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi, GNUNET_FS_publish_sks_cancel (pc->sks_pc); pc->sks_pc = NULL; } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Suspending publish operation\n"); GNUNET_free_non_null (fi->serialization); fi->serialization = NULL; @@ -1051,10 +1051,10 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi, static int fip_signal_suspend (void *cls, struct GNUNET_FS_FileInformation *fi, - uint64_t length, + uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, - struct GNUNET_FS_BlockOptions *bo, + struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info) { @@ -1112,7 +1112,7 @@ GNUNET_FS_publish_signal_suspend_ (void *cls) * @param msg error message on error, otherwise NULL */ static void -finish_reserve (void *cls, int success, +finish_reserve (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) { @@ -1122,7 +1122,7 @@ finish_reserve (void *cls, int success, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", success); if ((msg != NULL) || (success <= 0)) { - GNUNET_asprintf (&pc->fi->emsg, + GNUNET_asprintf (&pc->fi->emsg, _("Insufficient space for publishing: %s"), msg); 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 @@ /** * @file fs/fs_publish_ksk.c * @brief publish a URI under a keyword in GNUnet - * @see https://gnunet.org/encoding and #2564 + * @see https://gnunet.org/encoding and #2564 * @author Krista Bennett * @author Christian Grothoff */ @@ -93,7 +93,7 @@ struct GNUNET_FS_PublishKskContext /** * Options to use. - */ + */ enum GNUNET_FS_PublishOptions options; /** @@ -113,7 +113,7 @@ struct GNUNET_FS_PublishKskContext * @param tc unused */ static void -publish_ksk_cont (void *cls, +publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); @@ -133,7 +133,7 @@ kb_put_cont (void *cls, pkc->uc = NULL; if (NULL != msg) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "KBlock PUT operation failed: %s\n", msg); pkc->cont (pkc->cont_cls, NULL, msg); 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 @@ /** * @file fs/fs_publish_ublock.c * @brief publish a UBLOCK in GNUnet - * @see https://gnunet.org/encoding and #2564 + * @see https://gnunet.org/encoding and #2564 * @author Krista Bennett * @author Christian Grothoff */ @@ -41,7 +41,7 @@ * @param iv where to store the IV * @param label label to use for key derivation * @param pub public key to use for key derivation - */ + */ static void derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, @@ -69,7 +69,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, * @param ns public key under which the UBlock was stored * @param label label under which the UBlock was stored * @param output where to write the result, has input_len bytes - */ + */ void GNUNET_FS_ublock_decrypt_ (const void *input, size_t input_len, @@ -124,7 +124,7 @@ struct GNUNET_FS_PublishUblockContext * @param msg NULL on success, otherwise an error message */ static void -ublock_put_cont (void *cls, +ublock_put_cont (void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) @@ -221,7 +221,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, } size = sizeof (struct UBlock) + slen + mdsize + ulen; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing under identifier `%s'\n", label); /* get public key of the namespace */ @@ -232,11 +232,11 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, /* encrypt ublock */ ub_enc = GNUNET_malloc (size); - GNUNET_CRYPTO_symmetric_encrypt (&ub_plain[1], + GNUNET_CRYPTO_symmetric_encrypt (&ub_plain[1], ulen + slen + mdsize, &skey, &iv, &ub_enc[1]); - ub_enc->purpose.size = htonl (ulen + slen + mdsize + + ub_enc->purpose.size = htonl (ulen + slen + mdsize + sizeof (struct UBlock) - sizeof (struct GNUNET_CRYPTO_EccSignature)); 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 @@ /** * @file fs/fs_publish_ublock.h * @brief publish a UBLOCK in GNUnet - * @see https://gnunet.org/encoding and #2564 + * @see https://gnunet.org/encoding and #2564 * @author Krista Bennett * @author Christian Grothoff */ @@ -42,7 +42,7 @@ * @param ns public key under which the UBlock was stored * @param label label under which the UBlock was stored * @param output where to write the result, has input_len bytes - */ + */ void GNUNET_FS_ublock_decrypt_ (const void *input, 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, pi->value.search.sc = sc; pi->value.search.cctx = (NULL != sc) ? sc->client_info : NULL; pi->value.search.pctx = - ((NULL == sc) || (NULL == sc->psearch_result)) - ? NULL + ((NULL == sc) || (NULL == sc->psearch_result)) + ? NULL : sc->psearch_result->client_info; pi->value.search.query = (NULL != sc) ? sc->uri : NULL; - pi->value.search.duration = (NULL != sc) + pi->value.search.duration = (NULL != sc) ? GNUNET_TIME_absolute_get_duration (sc->start_time) : GNUNET_TIME_UNIT_ZERO; pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0; @@ -125,7 +125,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc, struct GNUNET_FS_SearchResult *sr) { struct GNUNET_FS_ProgressInfo pi; - + pi.status = GNUNET_FS_STATUS_SEARCH_UPDATE; pi.value.search.specifics.update.cctx = sr->client_info; pi.value.search.specifics.update.meta = sr->meta; @@ -135,7 +135,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc, pi.value.search.specifics.update.availability_certainty = sr->availability_trials; pi.value.search.specifics.update.applicability_rank = sr->optional_support; - pi.value.search.specifics.update.current_probe_time + pi.value.search.specifics.update.current_probe_time = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); } @@ -194,12 +194,12 @@ signal_probe_result (struct GNUNET_FS_SearchResult *sr) pi.value.search.specifics.update.cctx = sr->client_info; pi.value.search.specifics.update.meta = sr->meta; pi.value.search.specifics.update.uri = sr->uri; - pi.value.search.specifics.update.availability_rank + pi.value.search.specifics.update.availability_rank = 2 * sr->availability_success - sr->availability_trials; - pi.value.search.specifics.update.availability_certainty + pi.value.search.specifics.update.availability_certainty = sr->availability_trials; pi.value.search.specifics.update.applicability_rank = sr->optional_support; - pi.value.search.specifics.update.current_probe_time + pi.value.search.specifics.update.current_probe_time = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); sr->client_info = GNUNET_FS_search_make_status_ (&pi, sr->h, sr->sc); GNUNET_FS_search_start_probe_ (sr); @@ -380,7 +380,7 @@ probe_ping_task (void *cls, struct GNUNET_FS_SearchResult *sr = cls; signal_probe_result (sr); - sr->probe_ping_task + sr->probe_ping_task = GNUNET_SCHEDULER_add_delayed (GNUNET_FS_PROBE_UPDATE_FREQUENCY, &probe_ping_task, sr); @@ -434,7 +434,7 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr) len, sr->anonymity, GNUNET_FS_DOWNLOAD_NO_TEMPORARIES | GNUNET_FS_DOWNLOAD_IS_PROBE, sr, NULL); - sr->probe_ping_task + sr->probe_ping_task = GNUNET_SCHEDULER_add_now (&probe_ping_task, sr); } @@ -465,7 +465,7 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h, sr->uri = GNUNET_FS_uri_dup (uri); sr->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); sr->client_info = client_info; - sr->anonymity = anonymity; + sr->anonymity = anonymity; GNUNET_FS_search_start_probe_ (sr); return sr; } @@ -473,8 +473,8 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h, /** * Stop probing activity associated with a search result. - * - * @param sr search result + * + * @param sr search result */ static void GNUNET_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, * @param edata encrypted data * @param edata_size number of bytes in @a edata (and @a data) * @param data where to store the plaintext - * @return keyword index on success, #GNUNET_SYSERR on error (no such + * @return keyword index on success, #GNUNET_SYSERR on error (no such * keyword, internal error) */ static int @@ -683,7 +683,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, const void *edata, size_t edata_size, char *data) -{ +{ const struct GNUNET_CRYPTO_EccPrivateKey *anon; struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; unsigned int i; @@ -721,7 +721,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, * @param size size of nb */ static void -process_kblock (struct GNUNET_FS_SearchContext *sc, +process_kblock (struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size) { @@ -749,7 +749,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc, if (NULL == (uri = GNUNET_FS_uri_parse (&pt[1], &emsg))) { GNUNET_break_op (0); /* ublock malformed */ - GNUNET_free_non_null (emsg); + GNUNET_free_non_null (emsg); return; } j = eos - pt + 1; @@ -781,7 +781,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc, * @param size size of sb */ static void -process_sblock (struct GNUNET_FS_SearchContext *sc, +process_sblock (struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size) { @@ -811,8 +811,8 @@ process_sblock (struct GNUNET_FS_SearchContext *sc, } if (NULL == (uri = GNUNET_FS_uri_parse (uris, &emsg))) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("Failed to parse URI `%s': %s\n"), + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _("Failed to parse URI `%s': %s\n"), uris, emsg); GNUNET_break_op (0); /* ublock malformed */ GNUNET_free_non_null (emsg); @@ -837,9 +837,9 @@ process_sblock (struct GNUNET_FS_SearchContext *sc, * @param size size of data */ static void -process_result (struct GNUNET_FS_SearchContext *sc, +process_result (struct GNUNET_FS_SearchContext *sc, enum GNUNET_BLOCK_Type type, - struct GNUNET_TIME_Absolute expiration, + struct GNUNET_TIME_Absolute expiration, const void *data, size_t size) { @@ -1108,7 +1108,7 @@ transmit_search_request (void *cls, size_t size, void *buf) &dpub); GNUNET_CRYPTO_hash (&dpub, sizeof (dpub), - &sm->query); + &sm->query); mbc.put_cnt = (size - msize) / sizeof (struct GNUNET_HashCode); sqms = GNUNET_CONTAINER_multihashmap_size (sc->master_result_map); mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt); @@ -1206,7 +1206,7 @@ try_reconnect (struct GNUNET_FS_SearchContext *sc) } sc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (sc->reconnect_backoff); sc->task = - GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff, + GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff, &do_reconnect, sc); } @@ -1293,8 +1293,8 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) keyword, "fs-ublock", &sre->dpub); - GNUNET_CRYPTO_hash (&sre->dpub, - sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), + GNUNET_CRYPTO_hash (&sre->dpub, + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &sre->uquery); sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); 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) cnt->value = (const char *) &cnt[1]; memcpy (&cnt[1], keyword, klen); GNUNET_assert (GNUNET_OK == - GNUNET_CONTAINER_multihashmap_put (mcm, + GNUNET_CONTAINER_multihashmap_put (mcm, &hc, cnt, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); } @@ -313,7 +313,7 @@ migrate_and_drop_metadata (void *cls, const struct GNUNET_HashCode * key, void * counter->type, counter->format, counter->data_mime_type, counter->data, - counter->data_size); + counter->data_size); } GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (tc->metacounter, @@ -350,7 +350,7 @@ share_tree_trim (struct TrimContext *tc, if (tree->is_directory == GNUNET_YES) { const char *user = getenv ("USER"); - if ( (user == NULL) || + if ( (user == NULL) || (0 != strncasecmp (user, tree->short_filename, strlen(user)))) { /* only use filename if it doesn't match $USER */ @@ -366,12 +366,12 @@ share_tree_trim (struct TrimContext *tc, if (1 >= num_children) return; /* nothing to trim */ - + /* now, count keywords and meta data in children */ for (pos = tree->children_head; NULL != pos; pos = pos->next) { if (NULL != pos->meta) - GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter); + GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter); if (NULL != pos->ksk_uri) GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &add_to_keyword_counter, tc->keywordcounter); } @@ -393,10 +393,10 @@ share_tree_trim (struct TrimContext *tc, /* add high-frequency meta data and keywords to parent */ tc->pos = tree; - GNUNET_CONTAINER_multihashmap_iterate (tc->keywordcounter, + GNUNET_CONTAINER_multihashmap_iterate (tc->keywordcounter, &migrate_and_drop_keywords, tc); - GNUNET_CONTAINER_multihashmap_iterate (tc->metacounter, + GNUNET_CONTAINER_multihashmap_iterate (tc->metacounter, &migrate_and_drop_metadata, tc); } @@ -414,7 +414,7 @@ GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel) struct TrimContext tc; if (toplevel == NULL) - return; + return; tc.keywordcounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO); tc.metacounter = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_NO); 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 * @param tc scheduler context (unused) */ static void -report_uri (void *cls, +report_uri (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct TestPublishOperation *po = cls; GNUNET_FS_publish_stop (po->publish_context); GNUNET_TESTBED_operation_done (po->fs_op); - po->publish_cont (po->publish_cont_cls, + po->publish_cont (po->publish_cont_cls, po->publish_uri, - (GNUNET_YES == po->do_index) + (GNUNET_YES == po->do_index) ? po->publish_tmp_file : NULL); GNUNET_FS_uri_destroy (po->publish_uri); @@ -272,15 +272,15 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) * @param cls pointer to uint32_t with publishing seed * @param offset offset to generate data for * @param max maximum number of bytes to generate - * @param buf where to write generated data + * @param buf where to write generated data * @param emsg where to store error message (unused) * @return number of bytes written to buf */ static size_t -file_generator (void *cls, +file_generator (void *cls, uint64_t offset, - size_t max, - void *buf, + size_t max, + void *buf, char **emsg) { uint32_t *publish_seed = cls; @@ -307,7 +307,7 @@ file_generator (void *cls, /** * Connect adapter for publishing operation. - * + * * @param cls the 'struct TestPublishOperation' * @param cfg configuration of the peer to connect to; will be available until * GNUNET_TESTBED_operation_done() is called on the operation returned @@ -319,7 +319,7 @@ publish_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct TestPublishOperation *po = cls; - + return GNUNET_FS_start (cfg, "fs-test-publish", &publish_progress_cb, po, @@ -330,11 +330,11 @@ publish_connect_adapter (void *cls, /** * Adapter function called to destroy connection to file-sharing service. - * + * * @param cls the 'struct GNUNET_FS_Handle' * @param op_result unused (different for publish/download!) */ -static void +static void fs_disconnect_adapter (void *cls, void *op_result) { @@ -412,8 +412,8 @@ publish_fs_connect_complete_cb (void *cls, else { fi = GNUNET_FS_file_information_create_from_reader (po->fs, po, - po->size, - &file_generator, &po->publish_seed, + po->size, + &file_generator, &po->publish_seed, NULL, NULL, po->do_index, &bo); } @@ -557,7 +557,7 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) /** * Connect adapter for download operation. - * + * * @param cls the 'struct TestDownloadOperation' * @param cfg configuration of the peer to connect to; will be available until * GNUNET_TESTBED_operation_done() is called on the operation returned @@ -569,7 +569,7 @@ download_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct TestPublishOperation *po = cls; - + return GNUNET_FS_start (cfg, "fs-test-download", &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) * @param reason kind of progress we are making */ static void -unindex_directory_scan_cb (void *cls, - const char *filename, +unindex_directory_scan_cb (void *cls, + const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason) { @@ -381,7 +381,7 @@ GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc) ex = NULL; uc->dscan = GNUNET_FS_directory_scan_start (uc->filename, GNUNET_NO, ex, - &unindex_directory_scan_cb, + &unindex_directory_scan_cb, uc); GNUNET_free_non_null (ex); } @@ -391,7 +391,7 @@ GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc) * Continuation called to notify client about result of the remove * operation for the UBlock. * - * @param cls the 'struct GNUNET_FS_UnindexContext *' + * @param cls the 'struct GNUNET_FS_UnindexContext *' * @param success GNUNET_SYSERR on failure (including timeout/queue drop) * GNUNET_NO if content was already there * GNUNET_YES (or other positive value) on success @@ -409,10 +409,10 @@ continue_after_remove (void *cls, struct GNUNET_FS_UnindexContext *uc = cls; uc->dqe = NULL; - if (success != GNUNET_YES) + if (success != GNUNET_YES) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to remove UBlock: %s\n"), - msg); + msg); uc->ksk_offset++; GNUNET_FS_unindex_do_remove_kblocks_ (uc); } @@ -464,14 +464,14 @@ process_kblock_for_unindex (void *cls, if (0 == uc->first_uid) { /* remember UID of first result to detect cycles */ - uc->first_uid = uid; + uc->first_uid = uid; } else if (uid == uc->first_uid) { /* no more additional results */ uc->ksk_offset++; GNUNET_FS_unindex_do_remove_kblocks_ (uc); - return; + return; } GNUNET_assert (GNUNET_BLOCK_TYPE_FS_UBLOCK == type); if (size < sizeof (struct UBlock)) @@ -489,10 +489,10 @@ process_kblock_for_unindex (void *cls, goto get_next; } { - char pt[size - sizeof (struct UBlock)]; + char pt[size - sizeof (struct UBlock)]; struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; const char *keyword; - + GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), &anon_pub); keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; @@ -757,7 +757,7 @@ GNUNET_FS_unindex_signal_suspend_ (void *cls) * @return NULL on error, otherwise handle */ struct GNUNET_FS_UnindexContext * -GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, +GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, void *cctx) { 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 @@ * @param key where to store the unique key */ void -GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, +GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *key) { switch (uri->type) @@ -368,7 +368,7 @@ uri_sks_parse (const char *s, char **emsg) end = strchr (&s[pos], '/'); if ( (NULL == end) || (GNUNET_OK != - GNUNET_STRINGS_string_to_data (&s[pos], + GNUNET_STRINGS_string_to_data (&s[pos], end - &s[pos], &ns, sizeof (ns))) ) @@ -526,12 +526,12 @@ struct LocUriAssembly /** * File being offered. - */ + */ struct FileIdentifier fi; /** * Peer offering the file. - */ + */ struct GNUNET_PeerIdentity peer; }; @@ -947,7 +947,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, * @return an FS URI for the given namespace and identifier */ struct GNUNET_FS_Uri * -GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, +GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, const char *id) { struct GNUNET_FS_Uri *ns_uri; @@ -1424,7 +1424,7 @@ GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri) * Add a keyword as non-mandatory (with ' '-prefix) to the * given keyword list at offset 'index'. The array is * guaranteed to be long enough. - * + * * @param s keyword to add * @param array array to add the keyword to * @param index offset where to add the keyword @@ -1439,14 +1439,14 @@ insert_non_mandatory_keyword (const char *s, char **array, int index) /** - * Test if the given keyword 's' is already present in the + * Test if the given keyword 's' is already present in the * given array, ignoring the '+'-mandatory prefix in the array. * * @param s keyword to test * @param array keywords to test against, with ' ' or '+' prefix to ignore * @param array_length length of the array * @return GNUNET_YES if the keyword exists, GNUNET_NO if not - */ + */ static int find_duplicate (const char *s, const char **array, int array_length) { @@ -1535,7 +1535,7 @@ u8_strcount (const uint8_t *s) * to it are used to check for duplicates). ignored if array == NULL. * @return number of tokens counted (including duplicates), or number of * tokens extracted (excluding duplicates). 0 if there are no - * matching parens in the string (when counting), or when all tokens + * matching parens in the string (when counting), or when all tokens * were duplicates (when extracting). */ static int @@ -1612,7 +1612,7 @@ get_keywords_from_parens (const char *s, char **array, int index) else count++; close_paren[0] = tmp; - } + } } GNUNET_free (ss); return count; @@ -1900,7 +1900,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri) GNUNET_assert (NULL != ret); ret[0] = '\0'; GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX, - GNUNET_FS_URI_SKS_INFIX, buf, + GNUNET_FS_URI_SKS_INFIX, buf, uri->data.sks.identifier); return ret; } @@ -2003,7 +2003,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) peerSig = bin2enc (&uri->data.loc.contentSignature, sizeof (struct GNUNET_CRYPTO_EccSignature)); - GNUNET_asprintf (&ret, + GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, (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 @@ * @file fs/gnunet-auto-share.c * @brief automatically publish files on GNUnet * @author Christian Grothoff - * + * * TODO: * - support loading meta data / keywords from resource file * - add stability timer (a la buildbot) @@ -204,7 +204,7 @@ load_state () while (n-- > 0) { if ( (GNUNET_OK != - GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) || + GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) || (GNUNET_OK != GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) goto error; @@ -224,7 +224,7 @@ load_state () wi, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); } - if (GNUNET_OK == + if (GNUNET_OK == GNUNET_BIO_read_close (rh, &emsg)) return; rh = NULL; @@ -259,7 +259,7 @@ write_item (void *cls, "Saving serialization ID of file `%s' with value `%s'\n", wi->filename, GNUNET_h2s (&wi->id)); - if ( (GNUNET_OK != + if ( (GNUNET_OK != GNUNET_BIO_write_string (wh, wi->filename)) || (GNUNET_OK != GNUNET_BIO_write (wh, @@ -381,7 +381,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_break (0); GNUNET_OS_process_kill (publish_proc, SIGKILL); - type = GNUNET_OS_PROCESS_SIGNALED; + type = GNUNET_OS_PROCESS_SIGNALED; } GNUNET_OS_process_destroy (publish_proc); publish_proc = NULL; @@ -415,7 +415,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) wi); } save_state (); - schedule_next_task (); + schedule_next_task (); } @@ -452,7 +452,7 @@ work (void *cls, static char content_prio[20]; static char repl_level[20]; struct WorkItem *wi; - const struct GNUNET_DISK_FileHandle *pr; + const struct GNUNET_DISK_FileHandle *pr; int argc; run_task = GNUNET_SCHEDULER_NO_TASK; @@ -553,7 +553,7 @@ determine_id (void *cls, /* use hash here to make hierarchical structure distinct from all files on the same level */ GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft); - /* use XOR here so that order of the files in the directory + /* use XOR here so that order of the files in the directory does not matter! */ GNUNET_CRYPTO_hash_xor (&ft, id, id); return GNUNET_OK; @@ -613,7 +613,7 @@ add_file (void *cls, work_tail, wi); if (GNUNET_YES == do_shutdown) - return GNUNET_SYSERR; + return GNUNET_SYSERR; return GNUNET_OK; } @@ -645,7 +645,7 @@ schedule_next_task () struct GNUNET_TIME_Relative delay; if (GNUNET_YES == do_shutdown) - return; + return; if (NULL == work_head) { /* 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, load_state (); run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, &scan, NULL); - + kill_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task, NULL); @@ -707,7 +707,7 @@ run (void *cls, char *const *args, const char *cfgfile, * @param cls NULL (unused) * @param key key of the item in the map (unused) * @param value the 'struct WorkItem' to free - * @return GNUNET_OK to continue to iterate + * @return GNUNET_OK to continue to iterate */ static int free_item (void *cls, @@ -731,7 +731,7 @@ free_item (void *cls, */ int main (int argc, char *const *argv) -{ +{ static const struct GNUNET_GETOPT_CommandLineOption options[] = { {'a', "anonymity", "LEVEL", 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; /** - * Parse a pattern string and store the corresponding + * Parse a pattern string and store the corresponding * 'struct Pattern' in the given head/tail. * * @param head where to store the head @@ -243,7 +243,7 @@ make_file (uint64_t length, return NULL; /* initialize data with 'unique' data only depending on 'kval' and 'size', making sure that blocks do not repeat */ - for (i=0;ivalue.publish.cctx; GNUNET_STATISTICS_update (stats_handle, - "# publishing time (ms)", - (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, + "# publishing time (ms)", + (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, GNUNET_NO); p->task = GNUNET_SCHEDULER_add_now (&publish_stop_task, p); return p; @@ -424,9 +424,9 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: p = info->value.download.cctx; GNUNET_STATISTICS_update (stats_handle, - "# download time (ms)", - (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, - GNUNET_NO); + "# download time (ms)", + (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, + GNUNET_NO); p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p); return p; case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: @@ -450,12 +450,12 @@ progress_cb (void *cls, if (p->y != GNUNET_FS_uri_chk_get_file_size (uri)) return NULL; /* not what we want */ GNUNET_STATISTICS_update (stats_handle, - "# search time (ms)", - (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, + "# search time (ms)", + (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, GNUNET_NO); p->start_time = GNUNET_TIME_absolute_get (); p->ctx = GNUNET_FS_download_start (fs_handle, uri, - NULL, NULL, NULL, + NULL, NULL, NULL, 0, GNUNET_FS_uri_chk_get_file_size (uri), anonymity_level, GNUNET_FS_DOWNLOAD_NO_TEMPORARIES, @@ -483,7 +483,7 @@ progress_cb (void *cls, GNUNET_free (p); } return NULL; - default: + default: /* unexpected event during profiling */ GNUNET_break (0); return NULL; @@ -497,7 +497,7 @@ progress_cb (void *cls, * @param cls the 'struct Pattern' specifying the operation to perform * @param tc scheduler context */ -static void +static void start_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { @@ -522,7 +522,7 @@ start_publish (void *cls, * @param cls the 'struct Pattern' specifying the operation to perform * @param tc scheduler context */ -static void +static void start_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { @@ -563,7 +563,7 @@ run (void *cls, char *const *args GNUNET_UNUSED, NULL); if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (cfg, + GNUNET_CONFIGURATION_get_value_number (cfg, "TESTBED", "PEERID", &my_peerid)) { @@ -574,28 +574,28 @@ run (void *cls, char *const *args GNUNET_UNUSED, return; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (cfg, + GNUNET_CONFIGURATION_get_value_number (cfg, "FSPROFILER", "ANONYMITY_LEVEL", &anonymity_level)) anonymity_level = 1; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (cfg, + GNUNET_CONFIGURATION_get_value_number (cfg, "FSPROFILER", "REPLICATION_LEVEL", - &replication_level)) + &replication_level)) replication_level = 1; GNUNET_snprintf (myoptname, sizeof (myoptname), "DOWNLOAD-PATTERN-%u", my_peerid); if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, + GNUNET_CONFIGURATION_get_value_string (cfg, "FSPROFILER", myoptname, - &download_pattern)) + &download_pattern)) download_pattern = GNUNET_strdup (""); GNUNET_snprintf (myoptname, sizeof (myoptname), "PUBLISH-PATTERN-%u", my_peerid); if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, + GNUNET_CONFIGURATION_get_value_string (cfg, "FSPROFILER", myoptname, - &publish_pattern)) + &publish_pattern)) publish_pattern = GNUNET_strdup (""); if ( (GNUNET_OK != 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) * @param n total size of the download * @param w desired number of steps in the progress bar */ -static void -display_bar (unsigned long long x, - unsigned long long n, +static void +display_bar (unsigned long long x, + unsigned long long n, unsigned int w) { char buf[w + 20]; @@ -142,7 +142,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { s = GNUNET_strdup (GNUNET_STRINGS_relative_time_to_string (info->value.download.eta, GNUNET_YES)); - if (info->value.download.specifics.progress.block_download_duration.rel_value_us + if (info->value.download.specifics.progress.block_download_duration.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) s2 = _(""); 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 @@ /** * @file fs/gnunet-fs-profiler.c - * @brief tool to benchmark/profile file-sharing + * @brief tool to benchmark/profile file-sharing * @author Christian Grothoff */ #include "platform.h" @@ -137,7 +137,7 @@ terminate_task (void *cls, * failed */ static void -test_master (void *cls, +test_master (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, @@ -152,7 +152,7 @@ test_master (void *cls, terminate_taskid = GNUNET_SCHEDULER_add_delayed (timeout, &terminate_task, NULL); else - terminate_taskid = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, + terminate_taskid = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &terminate_task, NULL); } 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, memcpy (zdata, data, data_len); zdata[data_len] = '\0'; (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format, - data_mime_type, zdata, data_len + 1); - } + data_mime_type, zdata, data_len + 1); + } else { (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, * * @param tree tree to free */ -static void +static void free_tree (struct ScanTreeNode *tree) { struct ScanTreeNode *pos; @@ -151,7 +151,7 @@ free_tree (struct ScanTreeNode *tree) if (NULL != tree->parent) GNUNET_CONTAINER_DLL_remove (tree->parent->children_head, tree->parent->children_tail, - tree); + tree); GNUNET_free (tree->filename); GNUNET_free (tree); } @@ -205,7 +205,7 @@ write_message (uint16_t message_type, struct GNUNET_MessageHeader hdr; #if 0 - fprintf (stderr, + fprintf (stderr, "Helper sends %u-byte message of type %u\n", (unsigned int) (sizeof (struct GNUNET_MessageHeader) + data_length), (unsigned int) message_type); @@ -295,7 +295,7 @@ scan_callback (void *cls, * * @param filename file or directory to scan * @param dst where to store the resulting share tree item; - * NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is returned) + * NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is returned) * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ static int @@ -323,7 +323,7 @@ preprocess_file (const char *filename, /* Report the progress */ if (GNUNET_OK != - write_message (S_ISDIR (sbuf.st_mode) + write_message (S_ISDIR (sbuf.st_mode) ? GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY : GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE, filename, strlen (filename) + 1)) @@ -338,9 +338,9 @@ preprocess_file (const char *filename, rc.parent = item; rc.stop = GNUNET_NO; - GNUNET_DISK_directory_scan (filename, - &scan_callback, - &rc); + GNUNET_DISK_directory_scan (filename, + &scan_callback, + &rc); if ( (GNUNET_YES == rc.stop) || (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY, @@ -363,7 +363,7 @@ preprocess_file (const char *filename, */ static int extract_files (struct ScanTreeNode *item) -{ +{ struct GNUNET_CONTAINER_MetaData *meta; ssize_t size; size_t slen; @@ -380,7 +380,7 @@ extract_files (struct ScanTreeNode *item) return GNUNET_SYSERR; return GNUNET_OK; } - + /* this is the expensive operation, *afterwards* we'll check for aborts */ meta = GNUNET_CONTAINER_meta_data_create (); EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta); @@ -393,7 +393,7 @@ extract_files (struct ScanTreeNode *item) if (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA, item->filename, slen)) - return GNUNET_SYSERR; + return GNUNET_SYSERR; return GNUNET_OK; } else if (size > (UINT16_MAX - sizeof (struct GNUNET_MessageHeader) - slen)) @@ -404,7 +404,7 @@ extract_files (struct ScanTreeNode *item) { char buf[size + slen]; char *dst = &buf[slen]; - + memcpy (buf, item->filename, slen); size = GNUNET_CONTAINER_meta_data_serialize (meta, &dst, size, @@ -417,7 +417,7 @@ extract_files (struct ScanTreeNode *item) GNUNET_CONTAINER_meta_data_destroy (meta); if (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA, - buf, + buf, slen + size)) return GNUNET_SYSERR; } @@ -456,7 +456,7 @@ ignore_sigpipe () * @param flags flags to use (O_RDONLY or O_WRONLY) */ static void -make_dev_zero (int fd, +make_dev_zero (int fd, int flags) { int z; @@ -483,7 +483,7 @@ make_dev_zero (int fd, * otherwise custom plugins to load from LE * @return 0 on success */ -int +int main (int argc, char *const *argv) { @@ -502,7 +502,7 @@ main (int argc, output_stream = 1; /* stdout */ #else ignore_sigpipe (); - /* move stdout to some other FD for IPC, bind + /* move stdout to some other FD for IPC, bind stdout/stderr to /dev/null */ output_stream = dup (1); make_dev_zero (1, O_WRONLY); @@ -512,7 +512,7 @@ main (int argc, /* parse command line */ if ( (3 != argc) && (2 != argc) ) { - FPRINTF (stderr, + FPRINTF (stderr, "%s", "gnunet-helper-fs-publish needs exactly one or two arguments\n"); #if WINDOWS @@ -532,7 +532,7 @@ main (int argc, } /* scan tree to find out how much work there is to be done */ - if (GNUNET_OK != preprocess_file (filename_expanded, + if (GNUNET_OK != preprocess_file (filename_expanded, &root)) { (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); @@ -542,7 +542,7 @@ main (int argc, #endif return 2; } - /* signal that we're done counting files, so that a percentage of + /* signal that we're done counting files, so that a percentage of progress can now be calculated */ if (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) @@ -551,7 +551,7 @@ main (int argc, #if WINDOWS GNUNET_free ((void*) argv); #endif - return 3; + return 3; } if (NULL != root) { @@ -572,7 +572,7 @@ main (int argc, (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); EXTRACTOR_plugin_remove_all (plugins); #if WINDOWS - GNUNET_free ((void*) argv); + GNUNET_free ((void*) argv); #endif return 0; } 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) { GNUNET_CONTAINER_meta_data_destroy (meta); meta = NULL; - } + } } @@ -187,7 +187,7 @@ stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_FS_directory_scan_abort (ds); ds = NULL; - } + } if (NULL != identity) { GNUNET_IDENTITY_disconnect (identity); @@ -477,7 +477,7 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) if (GNUNET_YES == item->is_directory) { GNUNET_CONTAINER_meta_data_delete (item->meta, - EXTRACTOR_METATYPE_MIMETYPE, + EXTRACTOR_METATYPE_MIMETYPE, NULL, 0); GNUNET_FS_meta_data_make_directory (item->meta); if (NULL == item->ksk_uri) @@ -488,9 +488,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) else GNUNET_FS_uri_ksk_add_keyword (item->ksk_uri, GNUNET_FS_DIRECTORY_MIME, GNUNET_NO); - fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL, + fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL, item->ksk_uri, - item->meta, + item->meta, &bo, item->filename); for (child = item->children_head; child; child = child->next) { @@ -500,9 +500,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) } else { - fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, + fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, item->filename, - item->ksk_uri, item->meta, + item->ksk_uri, item->meta, !do_insert, &bo); } @@ -542,7 +542,7 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) priv = NULL; else priv = GNUNET_IDENTITY_ego_get_private_key (namespace); - pc = GNUNET_FS_publish_start (ctx, fi, + pc = GNUNET_FS_publish_start (ctx, fi, priv, this_id, next_id, (do_simulate) ? GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY : @@ -569,8 +569,8 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) * @param reason kind of progress we are making */ static void -directory_scan_cb (void *cls, - const char *filename, +directory_scan_cb (void *cls, + const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason) { @@ -584,21 +584,21 @@ directory_scan_cb (void *cls, if (is_directory == GNUNET_YES) FPRINTF (stdout, _("Scanning directory `%s'.\n"), filename); else - FPRINTF (stdout, _("Scanning file `%s'.\n"), filename); + FPRINTF (stdout, _("Scanning file `%s'.\n"), filename); } break; case GNUNET_FS_DIRSCANNER_FILE_IGNORED: - FPRINTF (stderr, + FPRINTF (stderr, _("There was trouble processing file `%s', skipping it.\n"), filename); break; case GNUNET_FS_DIRSCANNER_ALL_COUNTED: if (verbose) - FPRINTF (stdout, "%s", _("Preprocessing complete.\n")); + FPRINTF (stdout, "%s", _("Preprocessing complete.\n")); break; case GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED: if (verbose > 2) - FPRINTF (stdout, _("Extracting meta data from file `%s' complete.\n"), filename); + FPRINTF (stdout, _("Extracting meta data from file `%s' complete.\n"), filename); break; case GNUNET_FS_DIRSCANNER_FINISHED: if (verbose > 1) @@ -630,7 +630,7 @@ directory_scan_cb (void *cls, * has been initialized. * * @param args0 filename to publish - */ + */ static void identity_continuation (const char *args0) { @@ -673,8 +673,8 @@ identity_continuation (const char *args0) return; } ds = GNUNET_FS_directory_scan_start (args0, - disable_extractor, - ex, + disable_extractor, + ex, &directory_scan_cb, NULL); if (NULL == ds) { @@ -706,7 +706,7 @@ identity_cb (void *cls, { const char *args0 = cls; - if (NULL == ego) + if (NULL == ego) { identity_continuation (args0); 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, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, - const struct GNUNET_ATS_Information *ats, + const struct GNUNET_ATS_Information *ats, uint32_t ats_count) { unsigned int i; @@ -270,7 +270,7 @@ update_latencies (void *cls, gettext_noop ("# running average P2P latency (ms)"), GSF_avg_latency.rel_value_us / 1000LL, GNUNET_NO); - break; + break; } } @@ -416,7 +416,7 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Considering mesh-based download for block\n"); GSF_mesh_lookup_ (pr); - break; + break; case GNUNET_BLOCK_TYPE_FS_UBLOCK: /* the above block types are in the DHT */ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -625,7 +625,7 @@ main_init (struct GNUNET_SERVER_Handle *server, anon_p2p_off = (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg, "fs", - "DISABLE_ANON_TRANSFER")); + "DISABLE_ANON_TRANSFER")); GSF_core = GNUNET_CORE_connect (GSF_cfg, NULL, &peer_init_handler, &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) { char *fn; - GNUNET_asprintf (&fn, - "%s%s%s", - respectDirectory, + GNUNET_asprintf (&fn, + "%s%s%s", + respectDirectory, DIR_SEPARATOR_STR, GNUNET_i2s_full (id)); return fn; @@ -542,7 +542,7 @@ ats_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reserved %d bytes / need to wait %s for reservation\n", - (int) amount, + (int) amount, GNUNET_STRINGS_relative_time_to_string (res_delay, GNUNET_YES)); cp->rc = NULL; if (0 == amount) @@ -597,7 +597,7 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer) GNUNET_free (fn); cp->request_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); GNUNET_break (GNUNET_OK == - GNUNET_CONTAINER_multipeermap_put (cp_map, + GNUNET_CONTAINER_multipeermap_put (cp_map, GSF_connected_peer_get_identity2_ (cp), cp, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); @@ -682,7 +682,7 @@ GSF_handle_p2p_migration_stop_ (void *cls, bt = GNUNET_TIME_relative_ntoh (msm->duration); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Migration of content to peer `%s' blocked for %s\n"), - GNUNET_i2s (other), + GNUNET_i2s (other), GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES)); cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt); if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task) @@ -1254,7 +1254,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, { pr = peerreq->pr; prd = GSF_pending_request_get_data_ (pr); - if (prd->type == type) + if (prd->type == type) { if (prd->ttl.abs_value_us >= GNUNET_TIME_absolute_get ().abs_value_us + ttl * 1000LL) { @@ -1278,7 +1278,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, peerreq = GNUNET_new (struct PeerRequest); peerreq->cp = cp; - pr = GSF_pending_request_create_ (options, type, &gm->query, + pr = GSF_pending_request_create_ (options, type, &gm->query, target, (bfsize > 0) ? (const char *) &opt[bits] : NULL, @@ -1813,8 +1813,8 @@ GSF_connected_peer_init_ () * @return #GNUNET_YES (we should continue to iterate) */ static int -clean_peer (void *cls, - const struct GNUNET_PeerIdentity *key, +clean_peer (void *cls, + const struct GNUNET_PeerIdentity *key, void *value) { GSF_peer_disconnect_handler_ (NULL, key); @@ -1846,8 +1846,8 @@ GSF_connected_peer_done_ () * @return #GNUNET_YES (we should continue to iterate) */ static int -clean_local_client (void *cls, - const struct GNUNET_PeerIdentity *key, +clean_local_client (void *cls, + const struct GNUNET_PeerIdentity *key, void *value) { 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) _ ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), ii->filename, - ir->filename); + ir->filename); GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); 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, * @param msg error message */ static void -remove_cont (void *cls, int success, +remove_cont (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) { 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, if (0 != (SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY & ntohl (sm->options))) options |= GSF_PRO_LOCAL_ONLY; cr->pr = GSF_pending_request_create_ (options, type, - &sm->query, + &sm->query, (0 != memcmp (&sm->target, &all_zeros, 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; /** * Function called with a reply from the mesh. - * + * * @param cls closure * @param type type of the block, ANY on error * @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 @@ #define CLIENT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) -/** +/** * Handle for a mesh to another peer. */ struct MeshHandle; @@ -99,7 +99,7 @@ struct GSF_MeshRequest }; -/** +/** * Handle for a mesh to another peer. */ struct MeshHandle @@ -127,12 +127,12 @@ struct MeshHandle /** * Handle for active write operation, or NULL. - */ + */ struct GNUNET_MESH_TransmitHandle *wh; /** * Which peer does this mesh go to? - */ + */ struct GNUNET_PeerIdentity target; /** @@ -177,7 +177,7 @@ transmit_pending (struct MeshHandle *mh); /** - * Iterator called on each entry in a waiting map to + * Iterator called on each entry in a waiting map to * move it back to the pending list. * * @param cls the 'struct MeshHandle' @@ -192,7 +192,7 @@ move_to_pending (void *cls, { struct MeshHandle *mh = cls; struct GSF_MeshRequest *sr = value; - + GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (mh->waiting_map, key, @@ -342,7 +342,7 @@ transmit_sqm (void *cls, transmit_pending (mh); return sizeof (sqm); } - + /** * Transmit pending requests via the mesh. @@ -371,7 +371,7 @@ struct HandleReplyClosure /** * Reply payload. - */ + */ const void *data; /** @@ -384,11 +384,11 @@ struct HandleReplyClosure */ size_t data_size; - /** + /** * Type of the block. */ enum GNUNET_BLOCK_Type type; - + /** * Did we have a matching query? */ @@ -397,7 +397,7 @@ struct HandleReplyClosure /** - * Iterator called on each entry in a waiting map to + * Iterator called on each entry in a waiting map to * process a result. * * @param cls the 'struct HandleReplyClosure' @@ -412,7 +412,7 @@ handle_reply (void *cls, { struct HandleReplyClosure *hrc = cls; struct GSF_MeshRequest *sr = value; - + sr->proc (sr->proc_cls, hrc->type, hrc->expiration, @@ -462,7 +462,7 @@ reply_cb (void *cls, type, &srm[1], msize, &query)) { - GNUNET_break_op (0); + GNUNET_break_op (0); reset_mesh_async (mh); return GNUNET_SYSERR; } @@ -611,7 +611,7 @@ GSF_mesh_query_cancel (struct GSF_MeshRequest *sr) /** - * Iterator called on each entry in a waiting map to + * Iterator called on each entry in a waiting map to * call the 'proc' continuation and release associated * resources. * @@ -641,7 +641,7 @@ free_waiting_entry (void *cls, * * @param cls NULL * @param tunnel tunnel of the disconnecting client - * @param tunnel_ctx our 'struct MeshClient' + * @param tunnel_ctx our 'struct MeshClient' */ static void cleaner_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 { /** * DLL - */ + */ struct MeshClient *next; /** * DLL - */ + */ struct MeshClient *prev; /** * Tunnel for communication. - */ + */ struct GNUNET_MESH_Tunnel *tunnel; /** * Handle for active write operation, or NULL. - */ + */ struct GNUNET_MESH_TransmitHandle *wh; /** @@ -99,7 +99,7 @@ struct MeshClient * Tail of write queue. */ struct WriteQueueItem *wqi_tail; - + /** * Current active request to the datastore, if we have one pending. */ @@ -117,7 +117,7 @@ struct MeshClient /** * Size of the last write that was initiated. - */ + */ size_t reply_size; }; @@ -130,12 +130,12 @@ static struct GNUNET_MESH_Handle *listen_tunnel; /** * Head of DLL of mesh clients. - */ + */ static struct MeshClient *sc_head; /** * Tail of DLL of mesh clients. - */ + */ static struct MeshClient *sc_tail; /** @@ -155,7 +155,7 @@ static unsigned long long sc_count_max; * * @param cls the 'struct MeshClient' * @param tc scheduler context - */ + */ static void timeout_mesh_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -182,7 +182,7 @@ static void refresh_timeout_task (struct MeshClient *sc) { if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) - GNUNET_SCHEDULER_cancel (sc->timeout_task); + GNUNET_SCHEDULER_cancel (sc->timeout_task); sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT, &timeout_mesh_task, sc); @@ -291,7 +291,7 @@ continue_writing (struct MeshClient *sc) } sc->wh = GNUNET_MESH_notify_transmit_ready (sc->tunnel, GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_REL, - wqi->msize, + wqi->msize, &write_continuation, sc); if (NULL == sc->wh) @@ -320,7 +320,7 @@ continue_writing (struct MeshClient *sc) * @param uid unique identifier for the datum; * maybe 0 if no unique identifier is available */ -static void +static void handle_datastore_reply (void *cls, const struct GNUNET_HashCode *key, size_t size, const void *data, @@ -416,7 +416,7 @@ request_cb (void *cls, 0, &sqm->query, ntohl (sqm->type), - 0 /* priority */, + 0 /* priority */, GSF_datastore_queue_size, GNUNET_TIME_UNIT_FOREVER_REL, &handle_datastore_reply, sc); @@ -481,7 +481,7 @@ accept_cb (void *cls, * * @param cls NULL * @param tunnel tunnel of the disconnecting client - * @param tunnel_ctx our 'struct MeshClient' + * @param tunnel_ctx our 'struct MeshClient' */ static void cleaner_cb (void *cls, @@ -501,9 +501,9 @@ cleaner_cb (void *cls, gettext_noop ("# mesh connections active"), -1, GNUNET_NO); if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task) - GNUNET_SCHEDULER_cancel (sc->terminate_task); + GNUNET_SCHEDULER_cancel (sc->terminate_task); if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) - GNUNET_SCHEDULER_cancel (sc->timeout_task); + GNUNET_SCHEDULER_cancel (sc->timeout_task); if (NULL != sc->wh) GNUNET_MESH_notify_transmit_ready_cancel (sc->wh); 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; * are stored in a 'struct GSF_RequestPlan'. (We need * to be able to lookup all pending requests corresponding * to a given plan entry.) - * + * * Similarly head and tail of the "PR" MDLL are stored * with the 'struct GSF_PendingRequest'. (We need * to be able to lookup all plan entries corresponding @@ -360,7 +360,7 @@ get_latest (const struct GSF_RequestPlan *rp) if (NULL == bi) return NULL; /* should never happen */ ret = bi->pr; - bi = bi->next_PE; + bi = bi->next_PE; while (NULL != bi) { 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) pp->delay_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); pp->cp = cp; - GNUNET_CONTAINER_multipeermap_put (plans, + GNUNET_CONTAINER_multipeermap_put (plans, id, pp, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); } 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); * @return GNUNET_YES if 'result' was changed, GNUNET_NO otherwise. */ int -GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head, +GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head, struct GSF_ConnectedPeer *sender, struct GNUNET_TIME_Absolute *result); 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, { refresh_bloomfilter (pr); } - GNUNET_CONTAINER_multihashmap_put (pr_map, + GNUNET_CONTAINER_multihashmap_put (pr_map, &pr->public_data.query, pr, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES)) @@ -482,7 +482,7 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr, } } } - if (NULL != pr->gh) + if (NULL != pr->gh) GNUNET_DHT_get_filter_known_results (pr->gh, replies_seen_count, replies_seen); @@ -828,8 +828,8 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) GNUNET_TIME_absolute_get_duration (pr-> public_data.start_time).rel_value_us); if (GNUNET_YES != - GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, - prq->sender, + GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, + prq->sender, &last_transmission)) last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; /* pass on to other peers / local clients */ @@ -890,10 +890,10 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) prq->request_found = GNUNET_YES; /* finally, pass on to other peer / local client */ if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, - prq->sender, + prq->sender, &last_transmission)) last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; - pr->rh (pr->rh_cls, prq->eval, pr, + pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, last_transmission, prq->type, prq->data, prq->size); return GNUNET_YES; @@ -934,7 +934,7 @@ struct PutMigrationContext * @param msg NULL on success, otherwise an error message */ static void -put_migration_continuation (void *cls, int success, +put_migration_continuation (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) { @@ -947,13 +947,13 @@ put_migration_continuation (void *cls, int success, { if (GNUNET_SYSERR != success) { - GNUNET_LOAD_update (datastore_put_load, + GNUNET_LOAD_update (datastore_put_load, GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us); } else { /* on queue failure / timeout, increase the put load dramatically */ - GNUNET_LOAD_update (datastore_put_load, + GNUNET_LOAD_update (datastore_put_load, GNUNET_TIME_UNIT_MINUTES.rel_value_us); } } @@ -968,17 +968,17 @@ put_migration_continuation (void *cls, int success, GNUNET_free (pmc); return; } - if ( (GNUNET_NO == success) && - (GNUNET_NO == pmc->requested) && + if ( (GNUNET_NO == success) && + (GNUNET_NO == pmc->requested) && (NULL != cp) ) { ppd = GSF_get_peer_performance_data_ (cp); if (min_expiration.abs_value_us > 0) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %s because datastore is full\n", GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_expiration), GNUNET_YES)); - GSF_block_peer_migration_ (cp, min_expiration); + GSF_block_peer_migration_ (cp, min_expiration); } else { @@ -989,7 +989,7 @@ put_migration_continuation (void *cls, int success, mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, ppd->migration_delay.rel_value_us); ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Replicated content already exists locally, asking to stop migration for %s\n", GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES)); GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause)); @@ -1123,12 +1123,12 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr) xquery_size += sizeof (struct GNUNET_PeerIdentity); } pr->gh = - GNUNET_DHT_get_start (GSF_dht, + GNUNET_DHT_get_start (GSF_dht, pr->public_data.type, &pr->public_data.query, DHT_GET_REPLICATION, GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, xquery, xquery_size, &handle_dht_reply, pr); - if ( (NULL != pr->gh) && + if ( (NULL != pr->gh) && (0 != pr->replies_seen_count) ) GNUNET_DHT_get_filter_known_results (pr->gh, pr->replies_seen_count, @@ -1138,7 +1138,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr) /** * Function called with a reply from the mesh. - * + * * @param cls the pending request struct * @param type type of the block, ANY on error * @param expiration expiration time for the block @@ -1698,7 +1698,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, test_put_load_too_high (prq.priority)); } putl = GNUNET_LOAD_get_load (datastore_put_load); - if ( (NULL != cp) && + if ( (NULL != cp) && (GNUNET_NO == prq.request_found) && ( (GNUNET_YES != active_to_migration) || (putl > 2.5 * (1 + prq.priority)) ) ) @@ -1711,7 +1711,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, (unsigned int) (60000 * putl * putl))); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %s because of load %f and events %d/%d\n", GNUNET_STRINGS_relative_time_to_string (block_time, 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) * maybe 0 if no unique identifier is available */ static void -process_dht_put_content (void *cls, - const struct GNUNET_HashCode * key, +process_dht_put_content (void *cls, + const struct GNUNET_HashCode * key, size_t size, - const void *data, + const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, 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, * Function that gathers stats from all daemons. */ static void -stat_run (void *cls, +stat_run (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg); @@ -147,7 +147,7 @@ get_done (void *cls, int success) /** * Adapter function called to establish a connection to * statistics service. - * + * * @param cls closure * @param cfg configuration of the peer to connect to; will be available until * GNUNET_TESTBED_operation_done() is called on the operation returned @@ -166,11 +166,11 @@ statistics_connect_adapter (void *cls, /** * Adapter function called to destroy a connection to * statistics service. - * + * * @param cls closure * @param op_result service handle returned from the connect adapter */ -static void +static void statistics_disconnect_adapter (void *cls, void *op_result) { @@ -182,7 +182,7 @@ statistics_disconnect_adapter (void *cls, * Function that gathers stats from all daemons. */ static void -stat_run (void *cls, +stat_run (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg) @@ -244,12 +244,12 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_DISK_directory_remove (fn); GNUNET_free (fn); } - if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) + if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout during download, shutting down with error\n"); ok = 1; - GNUNET_SCHEDULER_shutdown (); + GNUNET_SCHEDULER_shutdown (); return; } @@ -276,7 +276,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void -do_download (void *cls, +do_download (void *cls, const struct GNUNET_FS_Uri *uri, const char *fn) { @@ -298,7 +298,7 @@ do_download (void *cls, else anonymity = 1; GNUNET_FS_TEST_download (daemons[0], TIMEOUT, anonymity, SEED, uri, VERBOSE, - &do_report, + &do_report, (NULL == fn) ? NULL : GNUNET_strdup (fn)); } @@ -314,7 +314,7 @@ do_publish (void *cls, unsigned int i; int do_index; int anonymity; - + GNUNET_assert (NUM_DAEMONS == num_peers); for (i=0;ivalue.publish.specifics. completed.chk_uri, NULL, fn, NULL, 0, - FILESIZE, anonymity_level, + FILESIZE, anonymity_level, GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", NULL); GNUNET_assert (download != NULL); @@ -173,8 +173,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) GNUNET_TIME_absolute_get_duration (start).rel_value_us) / 1024LL)); GAUGER ("FS", - (GNUNET_YES == indexed) - ? "Local download speed (indexed)" + (GNUNET_YES == indexed) + ? "Local download speed (indexed)" : "Local download speed (inserted)", (unsigned long long) (FILESIZE * 1000000LL / (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) static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_TESTING_Peer *peer) { 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 () bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); sks_uri = GNUNET_FS_uri_sks_create (&nsid, "root"); - GNUNET_FS_publish_ksk (fs, - ksk_uri, meta, sks_uri, + GNUNET_FS_publish_ksk (fs, + ksk_uri, meta, sks_uri, &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &adv_cont, NULL); GNUNET_FS_uri_destroy (sks_uri); @@ -296,7 +296,7 @@ testNamespace () static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { 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 () static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { 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) static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { 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) { rtask = GNUNET_SCHEDULER_NO_TASK; GNUNET_FS_stop (fs); - fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", + fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", &progress_cb, NULL, GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END); @@ -223,7 +223,7 @@ progress_cb (void *cls, static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_TESTING_Peer *peer) { 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; static void abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) -{ +{ if (NULL != publish) { 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, size_t i; fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL, - GNUNET_FS_FLAGS_DO_PROBES, + GNUNET_FS_FLAGS_DO_PROBES, GNUNET_FS_OPTIONS_END); GNUNET_assert (NULL != fs); 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) static void -run (void *cls, +run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { 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, static void -do_publish (void *cls, +do_publish (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg) { @@ -113,7 +113,7 @@ do_publish (void *cls, /** * Actual main function for the test. - * + * * @param cls closure * @param h the run handle * @param num_peers number of peers in 'peers' @@ -124,7 +124,7 @@ do_publish (void *cls, * failed */ static void -run (void *cls, +run (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, @@ -132,7 +132,7 @@ run (void *cls, unsigned int links_failed) { unsigned int i; - + GNUNET_assert (NUM_DAEMONS == num_peers); for (i=0;i