diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-12 19:07:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-12 19:07:40 +0000 |
commit | 6c471eeb15e27f8226492b4860a3c2acb94c5f25 (patch) | |
tree | a3a9dcba12ee5356c03056c10b7aba5367b2ef34 /src/fs/fs_download.c | |
parent | 16bcbbea7133fd2265d46bd2ae1dc70e8c9ba96f (diff) | |
download | gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.tar.gz gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.zip |
-consistently use struct GNUNET_HashCode
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r-- | src/fs/fs_download.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 61178766b..fbbbc2f23 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -153,7 +153,7 @@ struct ProcessResultClosure | |||
153 | /** | 153 | /** |
154 | * Hash of data. | 154 | * Hash of data. |
155 | */ | 155 | */ |
156 | GNUNET_HashCode query; | 156 | struct GNUNET_HashCode query; |
157 | 157 | ||
158 | /** | 158 | /** |
159 | * Data found in P2P network. | 159 | * Data found in P2P network. |
@@ -198,7 +198,7 @@ struct ProcessResultClosure | |||
198 | * @return GNUNET_YES (we should continue to iterate); unless serious error | 198 | * @return GNUNET_YES (we should continue to iterate); unless serious error |
199 | */ | 199 | */ |
200 | static int | 200 | static int |
201 | process_result_with_request (void *cls, const GNUNET_HashCode * key, | 201 | process_result_with_request (void *cls, const struct GNUNET_HashCode * key, |
202 | void *value); | 202 | void *value); |
203 | 203 | ||
204 | 204 | ||
@@ -225,7 +225,7 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, | |||
225 | char enc[len]; | 225 | char enc[len]; |
226 | struct GNUNET_CRYPTO_AesSessionKey sk; | 226 | struct GNUNET_CRYPTO_AesSessionKey sk; |
227 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 227 | struct GNUNET_CRYPTO_AesInitializationVector iv; |
228 | GNUNET_HashCode query; | 228 | struct GNUNET_HashCode query; |
229 | 229 | ||
230 | GNUNET_CRYPTO_hash_to_aes_key (&chk->key, &sk, &iv); | 230 | GNUNET_CRYPTO_hash_to_aes_key (&chk->key, &sk, &iv); |
231 | if (-1 == GNUNET_CRYPTO_aes_encrypt (block, len, &sk, &iv, enc)) | 231 | if (-1 == GNUNET_CRYPTO_aes_encrypt (block, len, &sk, &iv, enc)) |
@@ -234,7 +234,7 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, | |||
234 | return GNUNET_SYSERR; | 234 | return GNUNET_SYSERR; |
235 | } | 235 | } |
236 | GNUNET_CRYPTO_hash (enc, len, &query); | 236 | GNUNET_CRYPTO_hash (enc, len, &query); |
237 | if (0 != memcmp (&query, &chk->query, sizeof (GNUNET_HashCode))) | 237 | if (0 != memcmp (&query, &chk->query, sizeof (struct GNUNET_HashCode))) |
238 | { | 238 | { |
239 | GNUNET_break_op (0); | 239 | GNUNET_break_op (0); |
240 | return GNUNET_SYSERR; | 240 | return GNUNET_SYSERR; |
@@ -624,7 +624,7 @@ try_top_down_reconstruction (struct GNUNET_FS_DownloadContext *dc, | |||
624 | { | 624 | { |
625 | uint64_t off; | 625 | uint64_t off; |
626 | char block[DBLOCK_SIZE]; | 626 | char block[DBLOCK_SIZE]; |
627 | GNUNET_HashCode key; | 627 | struct GNUNET_HashCode key; |
628 | uint64_t total; | 628 | uint64_t total; |
629 | size_t len; | 629 | size_t len; |
630 | unsigned int i; | 630 | unsigned int i; |
@@ -653,7 +653,7 @@ try_top_down_reconstruction (struct GNUNET_FS_DownloadContext *dc, | |||
653 | return; /* failure */ | 653 | return; /* failure */ |
654 | } | 654 | } |
655 | GNUNET_CRYPTO_hash (block, len, &key); | 655 | GNUNET_CRYPTO_hash (block, len, &key); |
656 | if (0 != memcmp (&key, &dr->chk.key, sizeof (GNUNET_HashCode))) | 656 | if (0 != memcmp (&key, &dr->chk.key, sizeof (struct GNUNET_HashCode))) |
657 | return; /* mismatch */ | 657 | return; /* mismatch */ |
658 | if (GNUNET_OK != | 658 | if (GNUNET_OK != |
659 | encrypt_existing_match (dc, &dr->chk, dr, block, len, GNUNET_NO)) | 659 | encrypt_existing_match (dc, &dr->chk, dr, block, len, GNUNET_NO)) |
@@ -926,7 +926,7 @@ GNUNET_FS_free_download_request_ (struct DownloadRequest *dr) | |||
926 | * @return GNUNET_YES (we should continue to iterate); unless serious error | 926 | * @return GNUNET_YES (we should continue to iterate); unless serious error |
927 | */ | 927 | */ |
928 | static int | 928 | static int |
929 | process_result_with_request (void *cls, const GNUNET_HashCode * key, | 929 | process_result_with_request (void *cls, const struct GNUNET_HashCode * key, |
930 | void *value) | 930 | void *value) |
931 | { | 931 | { |
932 | struct ProcessResultClosure *prc = cls; | 932 | struct ProcessResultClosure *prc = cls; |
@@ -1376,7 +1376,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1376 | * @return GNUNET_OK | 1376 | * @return GNUNET_OK |
1377 | */ | 1377 | */ |
1378 | static int | 1378 | static int |
1379 | retry_entry (void *cls, const GNUNET_HashCode * key, void *entry) | 1379 | retry_entry (void *cls, const struct GNUNET_HashCode * key, void *entry) |
1380 | { | 1380 | { |
1381 | struct GNUNET_FS_DownloadContext *dc = cls; | 1381 | struct GNUNET_FS_DownloadContext *dc = cls; |
1382 | struct DownloadRequest *dr = entry; | 1382 | struct DownloadRequest *dr = entry; |