diff options
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r-- | src/fs/fs_download.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index a3c5b9b62..89de277da 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -143,7 +143,8 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
143 | * @param buf where the callee should write the message | 143 | * @param buf where the callee should write the message |
144 | * @return number of bytes written to buf | 144 | * @return number of bytes written to buf |
145 | */ | 145 | */ |
146 | static size_t transmit_download_request (void *cls, size_t size, void *buf); | 146 | static size_t |
147 | transmit_download_request (void *cls, size_t size, void *buf); | ||
147 | 148 | ||
148 | 149 | ||
149 | /** | 150 | /** |
@@ -194,8 +195,9 @@ struct ProcessResultClosure | |||
194 | * @param value value in the hash map (a 'struct DownloadRequest') | 195 | * @param value value in the hash map (a 'struct DownloadRequest') |
195 | * @return GNUNET_YES (we should continue to iterate); unless serious error | 196 | * @return GNUNET_YES (we should continue to iterate); unless serious error |
196 | */ | 197 | */ |
197 | static int process_result_with_request (void *cls, const GNUNET_HashCode * key, | 198 | static int |
198 | void *value); | 199 | process_result_with_request (void *cls, const GNUNET_HashCode * key, |
200 | void *value); | ||
199 | 201 | ||
200 | 202 | ||
201 | /** | 203 | /** |
@@ -261,7 +263,8 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, | |||
261 | * | 263 | * |
262 | * @param dc download context that is having trouble | 264 | * @param dc download context that is having trouble |
263 | */ | 265 | */ |
264 | static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | 266 | static void |
267 | try_reconnect (struct GNUNET_FS_DownloadContext *dc); | ||
265 | 268 | ||
266 | 269 | ||
267 | /** | 270 | /** |
@@ -275,10 +278,11 @@ static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | |||
275 | * @param length number of bytes in data | 278 | * @param length number of bytes in data |
276 | * @param data contents of the file (or NULL if they were not inlined) | 279 | * @param data contents of the file (or NULL if they were not inlined) |
277 | */ | 280 | */ |
278 | static void trigger_recursive_download (void *cls, const char *filename, | 281 | static void |
279 | const struct GNUNET_FS_Uri *uri, | 282 | trigger_recursive_download (void *cls, const char *filename, |
280 | const struct GNUNET_CONTAINER_MetaData | 283 | const struct GNUNET_FS_Uri *uri, |
281 | *meta, size_t length, const void *data); | 284 | const struct GNUNET_CONTAINER_MetaData *meta, |
285 | size_t length, const void *data); | ||
282 | 286 | ||
283 | 287 | ||
284 | /** | 288 | /** |
@@ -940,8 +944,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
940 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
941 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", | 945 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", |
942 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, | 946 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, |
943 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 947 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
944 | file_length)); | 948 | chk.file_length)); |
945 | 949 | ||
946 | #endif | 950 | #endif |
947 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll | 951 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll |
@@ -953,8 +957,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
953 | _ | 957 | _ |
954 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), | 958 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), |
955 | bs, dr->depth, (unsigned long long) dr->offset, | 959 | bs, dr->depth, (unsigned long long) dr->offset, |
956 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 960 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
957 | file_length), | 961 | chk.file_length), |
958 | prc->size); | 962 | prc->size); |
959 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); | 963 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); |
960 | while (dr->parent != NULL) | 964 | while (dr->parent != NULL) |
@@ -1077,8 +1081,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
1077 | #if DEBUG_DOWNLOAD | 1081 | #if DEBUG_DOWNLOAD |
1078 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1082 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1079 | "Download completed, truncating file to desired length %llu\n", | 1083 | "Download completed, truncating file to desired length %llu\n", |
1080 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 1084 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
1081 | file_length)); | 1085 | chk.file_length)); |
1082 | #endif | 1086 | #endif |
1083 | /* truncate file to size (since we store IBlocks at the end) */ | 1087 | /* truncate file to size (since we store IBlocks at the end) */ |
1084 | if (dc->filename != NULL) | 1088 | if (dc->filename != NULL) |
@@ -1757,8 +1761,7 @@ GNUNET_FS_download_start_task_ (void *cls, | |||
1757 | GNUNET_DISK_OPEN_READWRITE | | 1761 | GNUNET_DISK_OPEN_READWRITE | |
1758 | GNUNET_DISK_OPEN_CREATE | | 1762 | GNUNET_DISK_OPEN_CREATE | |
1759 | ((0 == | 1763 | ((0 == |
1760 | GNUNET_FS_uri_chk_get_file_size (dc-> | 1764 | GNUNET_FS_uri_chk_get_file_size (dc->uri)) ? |
1761 | uri)) ? | ||
1762 | GNUNET_DISK_OPEN_TRUNCATE : 0), | 1765 | GNUNET_DISK_OPEN_TRUNCATE : 0), |
1763 | GNUNET_DISK_PERM_USER_READ | | 1766 | GNUNET_DISK_PERM_USER_READ | |
1764 | GNUNET_DISK_PERM_USER_WRITE | | 1767 | GNUNET_DISK_PERM_USER_WRITE | |