diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/fs/fs_search.c | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/fs/fs_search.c')
-rw-r--r-- | src/fs/fs_search.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 2e09c1e22..7a869b4c5 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -54,11 +54,11 @@ GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
54 | pi->value.search.sc = sc; | 54 | pi->value.search.sc = sc; |
55 | pi->value.search.cctx = (NULL != sc) ? sc->client_info : NULL; | 55 | pi->value.search.cctx = (NULL != sc) ? sc->client_info : NULL; |
56 | pi->value.search.pctx = | 56 | pi->value.search.pctx = |
57 | ((NULL == sc) || (NULL == sc->psearch_result)) | 57 | ((NULL == sc) || (NULL == sc->psearch_result)) |
58 | ? NULL | 58 | ? NULL |
59 | : sc->psearch_result->client_info; | 59 | : sc->psearch_result->client_info; |
60 | pi->value.search.query = (NULL != sc) ? sc->uri : NULL; | 60 | pi->value.search.query = (NULL != sc) ? sc->uri : NULL; |
61 | pi->value.search.duration = (NULL != sc) | 61 | pi->value.search.duration = (NULL != sc) |
62 | ? GNUNET_TIME_absolute_get_duration (sc->start_time) | 62 | ? GNUNET_TIME_absolute_get_duration (sc->start_time) |
63 | : GNUNET_TIME_UNIT_ZERO; | 63 | : GNUNET_TIME_UNIT_ZERO; |
64 | pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0; | 64 | pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0; |
@@ -125,7 +125,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc, | |||
125 | struct GNUNET_FS_SearchResult *sr) | 125 | struct GNUNET_FS_SearchResult *sr) |
126 | { | 126 | { |
127 | struct GNUNET_FS_ProgressInfo pi; | 127 | struct GNUNET_FS_ProgressInfo pi; |
128 | 128 | ||
129 | pi.status = GNUNET_FS_STATUS_SEARCH_UPDATE; | 129 | pi.status = GNUNET_FS_STATUS_SEARCH_UPDATE; |
130 | pi.value.search.specifics.update.cctx = sr->client_info; | 130 | pi.value.search.specifics.update.cctx = sr->client_info; |
131 | pi.value.search.specifics.update.meta = sr->meta; | 131 | pi.value.search.specifics.update.meta = sr->meta; |
@@ -135,7 +135,7 @@ notify_client_chk_update (struct GNUNET_FS_SearchContext *sc, | |||
135 | pi.value.search.specifics.update.availability_certainty = | 135 | pi.value.search.specifics.update.availability_certainty = |
136 | sr->availability_trials; | 136 | sr->availability_trials; |
137 | pi.value.search.specifics.update.applicability_rank = sr->optional_support; | 137 | pi.value.search.specifics.update.applicability_rank = sr->optional_support; |
138 | pi.value.search.specifics.update.current_probe_time | 138 | pi.value.search.specifics.update.current_probe_time |
139 | = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); | 139 | = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); |
140 | sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); | 140 | sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); |
141 | } | 141 | } |
@@ -194,12 +194,12 @@ signal_probe_result (struct GNUNET_FS_SearchResult *sr) | |||
194 | pi.value.search.specifics.update.cctx = sr->client_info; | 194 | pi.value.search.specifics.update.cctx = sr->client_info; |
195 | pi.value.search.specifics.update.meta = sr->meta; | 195 | pi.value.search.specifics.update.meta = sr->meta; |
196 | pi.value.search.specifics.update.uri = sr->uri; | 196 | pi.value.search.specifics.update.uri = sr->uri; |
197 | pi.value.search.specifics.update.availability_rank | 197 | pi.value.search.specifics.update.availability_rank |
198 | = 2 * sr->availability_success - sr->availability_trials; | 198 | = 2 * sr->availability_success - sr->availability_trials; |
199 | pi.value.search.specifics.update.availability_certainty | 199 | pi.value.search.specifics.update.availability_certainty |
200 | = sr->availability_trials; | 200 | = sr->availability_trials; |
201 | pi.value.search.specifics.update.applicability_rank = sr->optional_support; | 201 | pi.value.search.specifics.update.applicability_rank = sr->optional_support; |
202 | pi.value.search.specifics.update.current_probe_time | 202 | pi.value.search.specifics.update.current_probe_time |
203 | = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); | 203 | = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); |
204 | sr->client_info = GNUNET_FS_search_make_status_ (&pi, sr->h, sr->sc); | 204 | sr->client_info = GNUNET_FS_search_make_status_ (&pi, sr->h, sr->sc); |
205 | GNUNET_FS_search_start_probe_ (sr); | 205 | GNUNET_FS_search_start_probe_ (sr); |
@@ -380,7 +380,7 @@ probe_ping_task (void *cls, | |||
380 | struct GNUNET_FS_SearchResult *sr = cls; | 380 | struct GNUNET_FS_SearchResult *sr = cls; |
381 | 381 | ||
382 | signal_probe_result (sr); | 382 | signal_probe_result (sr); |
383 | sr->probe_ping_task | 383 | sr->probe_ping_task |
384 | = GNUNET_SCHEDULER_add_delayed (GNUNET_FS_PROBE_UPDATE_FREQUENCY, | 384 | = GNUNET_SCHEDULER_add_delayed (GNUNET_FS_PROBE_UPDATE_FREQUENCY, |
385 | &probe_ping_task, | 385 | &probe_ping_task, |
386 | sr); | 386 | sr); |
@@ -434,7 +434,7 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr) | |||
434 | len, sr->anonymity, | 434 | len, sr->anonymity, |
435 | GNUNET_FS_DOWNLOAD_NO_TEMPORARIES | | 435 | GNUNET_FS_DOWNLOAD_NO_TEMPORARIES | |
436 | GNUNET_FS_DOWNLOAD_IS_PROBE, sr, NULL); | 436 | GNUNET_FS_DOWNLOAD_IS_PROBE, sr, NULL); |
437 | sr->probe_ping_task | 437 | sr->probe_ping_task |
438 | = GNUNET_SCHEDULER_add_now (&probe_ping_task, | 438 | = GNUNET_SCHEDULER_add_now (&probe_ping_task, |
439 | sr); | 439 | sr); |
440 | } | 440 | } |
@@ -465,7 +465,7 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h, | |||
465 | sr->uri = GNUNET_FS_uri_dup (uri); | 465 | sr->uri = GNUNET_FS_uri_dup (uri); |
466 | sr->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); | 466 | sr->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); |
467 | sr->client_info = client_info; | 467 | sr->client_info = client_info; |
468 | sr->anonymity = anonymity; | 468 | sr->anonymity = anonymity; |
469 | GNUNET_FS_search_start_probe_ (sr); | 469 | GNUNET_FS_search_start_probe_ (sr); |
470 | return sr; | 470 | return sr; |
471 | } | 471 | } |
@@ -473,8 +473,8 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h, | |||
473 | 473 | ||
474 | /** | 474 | /** |
475 | * Stop probing activity associated with a search result. | 475 | * Stop probing activity associated with a search result. |
476 | * | 476 | * |
477 | * @param sr search result | 477 | * @param sr search result |
478 | */ | 478 | */ |
479 | static void | 479 | static void |
480 | GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr) | 480 | 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, | |||
674 | * @param edata encrypted data | 674 | * @param edata encrypted data |
675 | * @param edata_size number of bytes in @a edata (and @a data) | 675 | * @param edata_size number of bytes in @a edata (and @a data) |
676 | * @param data where to store the plaintext | 676 | * @param data where to store the plaintext |
677 | * @return keyword index on success, #GNUNET_SYSERR on error (no such | 677 | * @return keyword index on success, #GNUNET_SYSERR on error (no such |
678 | * keyword, internal error) | 678 | * keyword, internal error) |
679 | */ | 679 | */ |
680 | static int | 680 | static int |
@@ -683,7 +683,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
683 | const void *edata, | 683 | const void *edata, |
684 | size_t edata_size, | 684 | size_t edata_size, |
685 | char *data) | 685 | char *data) |
686 | { | 686 | { |
687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
688 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; | 688 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
689 | unsigned int i; | 689 | unsigned int i; |
@@ -721,7 +721,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
721 | * @param size size of nb | 721 | * @param size size of nb |
722 | */ | 722 | */ |
723 | static void | 723 | static void |
724 | process_kblock (struct GNUNET_FS_SearchContext *sc, | 724 | process_kblock (struct GNUNET_FS_SearchContext *sc, |
725 | const struct UBlock *ub, | 725 | const struct UBlock *ub, |
726 | size_t size) | 726 | size_t size) |
727 | { | 727 | { |
@@ -749,7 +749,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc, | |||
749 | if (NULL == (uri = GNUNET_FS_uri_parse (&pt[1], &emsg))) | 749 | if (NULL == (uri = GNUNET_FS_uri_parse (&pt[1], &emsg))) |
750 | { | 750 | { |
751 | GNUNET_break_op (0); /* ublock malformed */ | 751 | GNUNET_break_op (0); /* ublock malformed */ |
752 | GNUNET_free_non_null (emsg); | 752 | GNUNET_free_non_null (emsg); |
753 | return; | 753 | return; |
754 | } | 754 | } |
755 | j = eos - pt + 1; | 755 | j = eos - pt + 1; |
@@ -781,7 +781,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc, | |||
781 | * @param size size of sb | 781 | * @param size size of sb |
782 | */ | 782 | */ |
783 | static void | 783 | static void |
784 | process_sblock (struct GNUNET_FS_SearchContext *sc, | 784 | process_sblock (struct GNUNET_FS_SearchContext *sc, |
785 | const struct UBlock *ub, | 785 | const struct UBlock *ub, |
786 | size_t size) | 786 | size_t size) |
787 | { | 787 | { |
@@ -811,8 +811,8 @@ process_sblock (struct GNUNET_FS_SearchContext *sc, | |||
811 | } | 811 | } |
812 | if (NULL == (uri = GNUNET_FS_uri_parse (uris, &emsg))) | 812 | if (NULL == (uri = GNUNET_FS_uri_parse (uris, &emsg))) |
813 | { | 813 | { |
814 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 814 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
815 | _("Failed to parse URI `%s': %s\n"), | 815 | _("Failed to parse URI `%s': %s\n"), |
816 | uris, emsg); | 816 | uris, emsg); |
817 | GNUNET_break_op (0); /* ublock malformed */ | 817 | GNUNET_break_op (0); /* ublock malformed */ |
818 | GNUNET_free_non_null (emsg); | 818 | GNUNET_free_non_null (emsg); |
@@ -837,9 +837,9 @@ process_sblock (struct GNUNET_FS_SearchContext *sc, | |||
837 | * @param size size of data | 837 | * @param size size of data |
838 | */ | 838 | */ |
839 | static void | 839 | static void |
840 | process_result (struct GNUNET_FS_SearchContext *sc, | 840 | process_result (struct GNUNET_FS_SearchContext *sc, |
841 | enum GNUNET_BLOCK_Type type, | 841 | enum GNUNET_BLOCK_Type type, |
842 | struct GNUNET_TIME_Absolute expiration, | 842 | struct GNUNET_TIME_Absolute expiration, |
843 | const void *data, | 843 | const void *data, |
844 | size_t size) | 844 | size_t size) |
845 | { | 845 | { |
@@ -1108,7 +1108,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1108 | &dpub); | 1108 | &dpub); |
1109 | GNUNET_CRYPTO_hash (&dpub, | 1109 | GNUNET_CRYPTO_hash (&dpub, |
1110 | sizeof (dpub), | 1110 | sizeof (dpub), |
1111 | &sm->query); | 1111 | &sm->query); |
1112 | mbc.put_cnt = (size - msize) / sizeof (struct GNUNET_HashCode); | 1112 | mbc.put_cnt = (size - msize) / sizeof (struct GNUNET_HashCode); |
1113 | sqms = GNUNET_CONTAINER_multihashmap_size (sc->master_result_map); | 1113 | sqms = GNUNET_CONTAINER_multihashmap_size (sc->master_result_map); |
1114 | mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt); | 1114 | mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt); |
@@ -1206,7 +1206,7 @@ try_reconnect (struct GNUNET_FS_SearchContext *sc) | |||
1206 | } | 1206 | } |
1207 | sc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (sc->reconnect_backoff); | 1207 | sc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (sc->reconnect_backoff); |
1208 | sc->task = | 1208 | sc->task = |
1209 | GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff, | 1209 | GNUNET_SCHEDULER_add_delayed (sc->reconnect_backoff, |
1210 | &do_reconnect, | 1210 | &do_reconnect, |
1211 | sc); | 1211 | sc); |
1212 | } | 1212 | } |
@@ -1293,8 +1293,8 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1293 | keyword, | 1293 | keyword, |
1294 | "fs-ublock", | 1294 | "fs-ublock", |
1295 | &sre->dpub); | 1295 | &sre->dpub); |
1296 | GNUNET_CRYPTO_hash (&sre->dpub, | 1296 | GNUNET_CRYPTO_hash (&sre->dpub, |
1297 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), | 1297 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
1298 | &sre->uquery); | 1298 | &sre->uquery); |
1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); | 1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); |
1300 | if (sre->mandatory) | 1300 | if (sre->mandatory) |