aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_download.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-26 14:02:09 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-26 14:02:09 +0000
commita9763a49d78b240fed1ace9068a0ea11cdff00f7 (patch)
tree292f58cc3a0765c58952cd83c695e1faafc83fd9 /src/fs/fs_download.c
parent69685227863090eb24ee20d07e8c0f139264c061 (diff)
downloadgnunet-a9763a49d78b240fed1ace9068a0ea11cdff00f7.tar.gz
gnunet-a9763a49d78b240fed1ace9068a0ea11cdff00f7.zip
-eliminating #if DEBUG checks
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r--src/fs/fs_download.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 741ca1917..b23d14b87 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -31,7 +31,6 @@
31#include "fs_api.h" 31#include "fs_api.h"
32#include "fs_tree.h" 32#include "fs_tree.h"
33 33
34#define DEBUG_DOWNLOAD GNUNET_EXTRA_LOGGING
35 34
36/** 35/**
37 * Determine if the given download (options and meta data) should cause 36 * Determine if the given download (options and meta data) should cause
@@ -240,11 +239,9 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc,
240 GNUNET_break_op (0); 239 GNUNET_break_op (0);
241 return GNUNET_SYSERR; 240 return GNUNET_SYSERR;
242 } 241 }
243#if DEBUG_DOWNLOAD
244 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 242 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
245 "Matching block for `%s' at offset %llu already present, no need for download!\n", 243 "Matching block for `%s' at offset %llu already present, no need for download!\n",
246 dc->filename, (unsigned long long) dr->offset); 244 dc->filename, (unsigned long long) dr->offset);
247#endif
248 /* already got it! */ 245 /* already got it! */
249 prc.dc = dc; 246 prc.dc = dc;
250 prc.data = enc; 247 prc.data = enc;
@@ -564,10 +561,8 @@ match_full_data (void *cls, const char *plugin_name,
564 561
565 if (type != EXTRACTOR_METATYPE_GNUNET_FULL_DATA) 562 if (type != EXTRACTOR_METATYPE_GNUNET_FULL_DATA)
566 return 0; 563 return 0;
567#if DEBUG_DOWNLOAD
568 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u bytes of FD!\n", 564 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u bytes of FD!\n",
569 (unsigned int) data_len); 565 (unsigned int) data_len);
570#endif
571 if (GNUNET_FS_uri_chk_get_file_size (dc->uri) != data_len) 566 if (GNUNET_FS_uri_chk_get_file_size (dc->uri) != data_len)
572 { 567 {
573 GNUNET_break_op (0); 568 GNUNET_break_op (0);
@@ -731,12 +726,10 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
731 GNUNET_break (0); 726 GNUNET_break (0);
732 return; 727 return;
733 } 728 }
734#if DEBUG_DOWNLOAD
735 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
736 "Scheduling download at offset %llu and depth %u for `%s'\n", 730 "Scheduling download at offset %llu and depth %u for `%s'\n",
737 (unsigned long long) dr->offset, dr->depth, 731 (unsigned long long) dr->offset, dr->depth,
738 GNUNET_h2s (&dr->chk.query)); 732 GNUNET_h2s (&dr->chk.query));
739#endif
740 if (GNUNET_NO != 733 if (GNUNET_NO !=
741 GNUNET_CONTAINER_multihashmap_contains_value (dc->active, &dr->chk.query, 734 GNUNET_CONTAINER_multihashmap_contains_value (dc->active, &dr->chk.query,
742 dr)) 735 dr))
@@ -882,13 +875,11 @@ trigger_recursive_download (void *cls, const char *filename,
882 } 875 }
883 876
884 temp_name = NULL; 877 temp_name = NULL;
885#if DEBUG_DOWNLOAD
886 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 878 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
887 "Triggering recursive download of size %llu with %u bytes MD\n", 879 "Triggering recursive download of size %llu with %u bytes MD\n",
888 (unsigned long long) GNUNET_FS_uri_chk_get_file_size (uri), 880 (unsigned long long) GNUNET_FS_uri_chk_get_file_size (uri),
889 (unsigned int) 881 (unsigned int)
890 GNUNET_CONTAINER_meta_data_get_serialized_size (meta)); 882 GNUNET_CONTAINER_meta_data_get_serialized_size (meta));
891#endif
892 GNUNET_FS_download_start (dc->h, uri, meta, full_name, temp_name, 0, 883 GNUNET_FS_download_start (dc->h, uri, meta, full_name, temp_name, 0,
893 GNUNET_FS_uri_chk_get_file_size (uri), 884 GNUNET_FS_uri_chk_get_file_size (uri),
894 dc->anonymity, dc->options, NULL, dc); 885 dc->anonymity, dc->options, NULL, dc);
@@ -945,14 +936,11 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key,
945 int i; 936 int i;
946 struct ContentHashKey *chkarr; 937 struct ContentHashKey *chkarr;
947 938
948#if DEBUG_DOWNLOAD
949 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 939 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
950 "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", 940 "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n",
951 GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, 941 GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset,
952 (unsigned long long) GNUNET_ntohll (dc->uri->data. 942 (unsigned long long) GNUNET_ntohll (dc->uri->data.
953 chk.file_length)); 943 chk.file_length));
954
955#endif
956 bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll 944 bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll
957 (dc->uri->data.chk.file_length), 945 (dc->uri->data.chk.file_length),
958 dr->offset, dr->depth); 946 dr->offset, dr->depth);
@@ -1013,11 +1001,9 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key,
1013 dc->filename, STRERROR (errno)); 1001 dc->filename, STRERROR (errno));
1014 goto signal_error; 1002 goto signal_error;
1015 } 1003 }
1016#if DEBUG_DOWNLOAD
1017 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1004 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1018 "Saving decrypted block to disk at offset %llu\n", 1005 "Saving decrypted block to disk at offset %llu\n",
1019 (unsigned long long) off); 1006 (unsigned long long) off);
1020#endif
1021 if ((off != GNUNET_DISK_file_seek (fh, off, GNUNET_DISK_SEEK_SET))) 1007 if ((off != GNUNET_DISK_file_seek (fh, off, GNUNET_DISK_SEEK_SET)))
1022 { 1008 {
1023 GNUNET_asprintf (&dc->emsg, 1009 GNUNET_asprintf (&dc->emsg,
@@ -1089,12 +1075,10 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key,
1089 if (dc->completed == dc->length) 1075 if (dc->completed == dc->length)
1090 { 1076 {
1091 /* download completed, signal */ 1077 /* download completed, signal */
1092#if DEBUG_DOWNLOAD
1093 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1078 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1094 "Download completed, truncating file to desired length %llu\n", 1079 "Download completed, truncating file to desired length %llu\n",
1095 (unsigned long long) GNUNET_ntohll (dc->uri->data. 1080 (unsigned long long) GNUNET_ntohll (dc->uri->data.
1096 chk.file_length)); 1081 chk.file_length));
1097#endif
1098 /* truncate file to size (since we store IBlocks at the end) */ 1082 /* truncate file to size (since we store IBlocks at the end) */
1099 if (dc->filename != NULL) 1083 if (dc->filename != NULL)
1100 { 1084 {
@@ -1114,11 +1098,9 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key,
1114 return GNUNET_YES; 1098 return GNUNET_YES;
1115 } 1099 }
1116 1100
1117#if DEBUG_DOWNLOAD
1118 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1119 "Triggering downloads of children (this block was at depth %u and offset %llu)\n", 1102 "Triggering downloads of children (this block was at depth %u and offset %llu)\n",
1120 dr->depth, (unsigned long long) dr->offset); 1103 dr->depth, (unsigned long long) dr->offset);
1121#endif
1122 GNUNET_assert (0 == (prc->size % sizeof (struct ContentHashKey))); 1104 GNUNET_assert (0 == (prc->size % sizeof (struct ContentHashKey)));
1123 chkarr = (struct ContentHashKey *) pt; 1105 chkarr = (struct ContentHashKey *) pt;
1124 for (i = (prc->size / sizeof (struct ContentHashKey)) - 1; i >= 0; i--) 1106 for (i = (prc->size / sizeof (struct ContentHashKey)) - 1; i >= 0; i--)
@@ -1210,11 +1192,9 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
1210 prc.do_store = GNUNET_YES; 1192 prc.do_store = GNUNET_YES;
1211 prc.last_transmission = last_transmission; 1193 prc.last_transmission = last_transmission;
1212 GNUNET_CRYPTO_hash (data, size, &prc.query); 1194 GNUNET_CRYPTO_hash (data, size, &prc.query);
1213#if DEBUG_DOWNLOAD
1214 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1195 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1215 "Received result for query `%s' from `%s'-service\n", 1196 "Received result for query `%s' from `%s'-service\n",
1216 GNUNET_h2s (&prc.query), "FS"); 1197 GNUNET_h2s (&prc.query), "FS");
1217#endif
1218 GNUNET_CONTAINER_multihashmap_get_multiple (dc->active, &prc.query, 1198 GNUNET_CONTAINER_multihashmap_get_multiple (dc->active, &prc.query,
1219 &process_result_with_request, 1199 &process_result_with_request,
1220 &prc); 1200 &prc);
@@ -1278,10 +1258,8 @@ transmit_download_request (void *cls, size_t size, void *buf)
1278 dc->th = NULL; 1258 dc->th = NULL;
1279 if (NULL == buf) 1259 if (NULL == buf)
1280 { 1260 {
1281#if DEBUG_DOWNLOAD
1282 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1261 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1283 "Transmitting download request failed, trying to reconnect\n"); 1262 "Transmitting download request failed, trying to reconnect\n");
1284#endif
1285 try_reconnect (dc); 1263 try_reconnect (dc);
1286 return 0; 1264 return 0;
1287 } 1265 }
@@ -1291,11 +1269,9 @@ transmit_download_request (void *cls, size_t size, void *buf)
1291 while ((NULL != (dr = dc->pending_head)) && 1269 while ((NULL != (dr = dc->pending_head)) &&
1292 (size >= msize + sizeof (struct SearchMessage))) 1270 (size >= msize + sizeof (struct SearchMessage)))
1293 { 1271 {
1294#if DEBUG_DOWNLOAD
1295 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1272 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1296 "Transmitting download request for `%s' to `%s'-service\n", 1273 "Transmitting download request for `%s' to `%s'-service\n",
1297 GNUNET_h2s (&dr->chk.query), "FS"); 1274 GNUNET_h2s (&dr->chk.query), "FS");
1298#endif
1299 memset (sm, 0, sizeof (struct SearchMessage)); 1275 memset (sm, 0, sizeof (struct SearchMessage));
1300 sm->header.size = htons (sizeof (struct SearchMessage)); 1276 sm->header.size = htons (sizeof (struct SearchMessage));
1301 sm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_START_SEARCH); 1277 sm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_START_SEARCH);
@@ -1405,10 +1381,8 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc)
1405 1381
1406 if (NULL != dc->client) 1382 if (NULL != dc->client)
1407 { 1383 {
1408#if DEBUG_DOWNLOAD
1409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1384 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1410 "Moving all requests back to pending list\n"); 1385 "Moving all requests back to pending list\n");
1411#endif
1412 if (NULL != dc->th) 1386 if (NULL != dc->th)
1413 { 1387 {
1414 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th); 1388 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th);
@@ -1422,9 +1396,7 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc)
1422 dc->in_receive = GNUNET_NO; 1396 dc->in_receive = GNUNET_NO;
1423 dc->client = NULL; 1397 dc->client = NULL;
1424 } 1398 }
1425#if DEBUG_DOWNLOAD
1426 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will try to reconnect in 1s\n"); 1399 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will try to reconnect in 1s\n");
1427#endif
1428 dc->task = 1400 dc->task =
1429 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_reconnect, 1401 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_reconnect,
1430 dc); 1402 dc);
@@ -1443,9 +1415,7 @@ activate_fs_download (void *cls, struct GNUNET_CLIENT_Connection *client)
1443 struct GNUNET_FS_DownloadContext *dc = cls; 1415 struct GNUNET_FS_DownloadContext *dc = cls;
1444 struct GNUNET_FS_ProgressInfo pi; 1416 struct GNUNET_FS_ProgressInfo pi;
1445 1417
1446#if DEBUG_DOWNLOAD
1447 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download activated\n"); 1418 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download activated\n");
1448#endif
1449 GNUNET_assert (NULL != client); 1419 GNUNET_assert (NULL != client);
1450 GNUNET_assert (dc->client == NULL); 1420 GNUNET_assert (dc->client == NULL);
1451 GNUNET_assert (dc->th == NULL); 1421 GNUNET_assert (dc->th == NULL);
@@ -1455,10 +1425,8 @@ activate_fs_download (void *cls, struct GNUNET_CLIENT_Connection *client)
1455 dc->pending_head = NULL; 1425 dc->pending_head = NULL;
1456 dc->pending_tail = NULL; 1426 dc->pending_tail = NULL;
1457 GNUNET_CONTAINER_multihashmap_iterate (dc->active, &retry_entry, dc); 1427 GNUNET_CONTAINER_multihashmap_iterate (dc->active, &retry_entry, dc);
1458#if DEBUG_DOWNLOAD
1459 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1428 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1460 "Asking for transmission to FS service\n"); 1429 "Asking for transmission to FS service\n");
1461#endif
1462 if (dc->pending_head != NULL) 1430 if (dc->pending_head != NULL)
1463 { 1431 {
1464 dc->th = 1432 dc->th =
@@ -1483,9 +1451,7 @@ deactivate_fs_download (void *cls)
1483 struct GNUNET_FS_DownloadContext *dc = cls; 1451 struct GNUNET_FS_DownloadContext *dc = cls;
1484 struct GNUNET_FS_ProgressInfo pi; 1452 struct GNUNET_FS_ProgressInfo pi;
1485 1453
1486#if DEBUG_DOWNLOAD
1487 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download deactivated\n"); 1454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download deactivated\n");
1488#endif
1489 if (NULL != dc->th) 1455 if (NULL != dc->th)
1490 { 1456 {
1491 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th); 1457 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th);
@@ -1705,12 +1671,10 @@ reconstruct_cb (void *cls, const struct ContentHashKey *chk, uint64_t offset,
1705 if (dc->completed == dc->length) 1671 if (dc->completed == dc->length)
1706 { 1672 {
1707 /* download completed, signal */ 1673 /* download completed, signal */
1708#if DEBUG_DOWNLOAD
1709 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1674 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1710 "Download completed, truncating file to desired length %llu\n", 1675 "Download completed, truncating file to desired length %llu\n",
1711 (unsigned long long) GNUNET_ntohll (dc->uri->data. 1676 (unsigned long long) GNUNET_ntohll (dc->uri->data.
1712 chk.file_length)); 1677 chk.file_length));
1713#endif
1714 /* truncate file to size (since we store IBlocks at the end) */ 1678 /* truncate file to size (since we store IBlocks at the end) */
1715 if (dc->filename != NULL) 1679 if (dc->filename != NULL)
1716 { 1680 {
@@ -1792,9 +1756,7 @@ GNUNET_FS_download_start_task_ (void *cls,
1792 struct GNUNET_FS_ProgressInfo pi; 1756 struct GNUNET_FS_ProgressInfo pi;
1793 struct GNUNET_DISK_FileHandle *fh; 1757 struct GNUNET_DISK_FileHandle *fh;
1794 1758
1795#if DEBUG_DOWNLOAD
1796 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n"); 1759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n");
1797#endif
1798 dc->task = GNUNET_SCHEDULER_NO_TASK; 1760 dc->task = GNUNET_SCHEDULER_NO_TASK;
1799 if (dc->length == 0) 1761 if (dc->length == 0)
1800 { 1762 {
@@ -1850,10 +1812,8 @@ GNUNET_FS_download_start_task_ (void *cls,
1850 if (dc->rfh != NULL) 1812 if (dc->rfh != NULL)
1851 { 1813 {
1852 /* first, try top-down */ 1814 /* first, try top-down */
1853#if DEBUG_DOWNLOAD
1854 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1815 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1855 "Trying top-down reconstruction for `%s'\n", dc->filename); 1816 "Trying top-down reconstruction for `%s'\n", dc->filename);
1856#endif
1857 try_top_down_reconstruction (dc, dc->top_request); 1817 try_top_down_reconstruction (dc, dc->top_request);
1858 switch (dc->top_request->state) 1818 switch (dc->top_request->state)
1859 { 1819 {
@@ -1888,13 +1848,11 @@ GNUNET_FS_download_start_task_ (void *cls,
1888 if ((GNUNET_FS_uri_chk_get_file_size (dc->uri) <= MAX_INLINE_SIZE) && 1848 if ((GNUNET_FS_uri_chk_get_file_size (dc->uri) <= MAX_INLINE_SIZE) &&
1889 (NULL != dc->meta)) 1849 (NULL != dc->meta))
1890 { 1850 {
1891#if DEBUG_DOWNLOAD
1892 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1851 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1893 "Trying to find embedded meta data for download of size %llu with %u bytes MD\n", 1852 "Trying to find embedded meta data for download of size %llu with %u bytes MD\n",
1894 (unsigned long long) GNUNET_FS_uri_chk_get_file_size (dc->uri), 1853 (unsigned long long) GNUNET_FS_uri_chk_get_file_size (dc->uri),
1895 (unsigned int) 1854 (unsigned int)
1896 GNUNET_CONTAINER_meta_data_get_serialized_size (dc->meta)); 1855 GNUNET_CONTAINER_meta_data_get_serialized_size (dc->meta));
1897#endif
1898 GNUNET_CONTAINER_meta_data_iterate (dc->meta, &match_full_data, dc); 1856 GNUNET_CONTAINER_meta_data_iterate (dc->meta, &match_full_data, dc);
1899 if (dc->top_request->state == BRS_DOWNLOAD_UP) 1857 if (dc->top_request->state == BRS_DOWNLOAD_UP)
1900 { 1858 {
@@ -1911,10 +1869,8 @@ GNUNET_FS_download_start_task_ (void *cls,
1911 if (dc->rfh != NULL) 1869 if (dc->rfh != NULL)
1912 { 1870 {
1913 /* finally, try bottom-up */ 1871 /* finally, try bottom-up */
1914#if DEBUG_DOWNLOAD
1915 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1872 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1916 "Trying bottom-up reconstruction of file `%s'\n", dc->filename); 1873 "Trying bottom-up reconstruction of file `%s'\n", dc->filename);
1917#endif
1918 dc->te = 1874 dc->te =
1919 GNUNET_FS_tree_encoder_create (dc->h, dc->old_file_size, dc, &fh_reader, 1875 GNUNET_FS_tree_encoder_create (dc->h, dc->old_file_size, dc, &fh_reader,
1920 &reconstruct_cb, NULL, 1876 &reconstruct_cb, NULL,
@@ -2041,10 +1997,8 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
2041 GNUNET_break (0); 1997 GNUNET_break (0);
2042 return NULL; 1998 return NULL;
2043 } 1999 }
2044#if DEBUG_DOWNLOAD
2045 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting download `%s' of %llu bytes\n", 2000 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting download `%s' of %llu bytes\n",
2046 filename, (unsigned long long) length); 2001 filename, (unsigned long long) length);
2047#endif
2048 dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext)); 2002 dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext));
2049 dc->h = h; 2003 dc->h = h;
2050 dc->parent = parent; 2004 dc->parent = parent;
@@ -2081,10 +2035,8 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
2081 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp"); 2035 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp");
2082 } 2036 }
2083 2037
2084#if DEBUG_DOWNLOAD
2085 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download tree has depth %u\n", 2038 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download tree has depth %u\n",
2086 dc->treedepth); 2039 dc->treedepth);
2087#endif
2088 if (parent == NULL) 2040 if (parent == NULL)
2089 { 2041 {
2090 dc->top = 2042 dc->top =
@@ -2153,10 +2105,8 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
2153 GNUNET_break (0); 2105 GNUNET_break (0);
2154 return NULL; 2106 return NULL;
2155 } 2107 }
2156#if DEBUG_DOWNLOAD
2157 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting download `%s' of %llu bytes\n", 2108 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting download `%s' of %llu bytes\n",
2158 filename, (unsigned long long) length); 2109 filename, (unsigned long long) length);
2159#endif
2160 dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext)); 2110 dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext));
2161 dc->h = h; 2111 dc->h = h;
2162 dc->search = sr; 2112 dc->search = sr;
@@ -2195,10 +2145,8 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
2195 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp"); 2145 dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp");
2196 } 2146 }
2197 2147
2198#if DEBUG_DOWNLOAD
2199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download tree has depth %u\n", 2148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download tree has depth %u\n",
2200 dc->treedepth); 2149 dc->treedepth);
2201#endif
2202 dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_, dc); 2150 dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_, dc);
2203 return dc; 2151 return dc;
2204} 2152}