aboutsummaryrefslogtreecommitdiff
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
parent69685227863090eb24ee20d07e8c0f139264c061 (diff)
downloadgnunet-a9763a49d78b240fed1ace9068a0ea11cdff00f7.tar.gz
gnunet-a9763a49d78b240fed1ace9068a0ea11cdff00f7.zip
-eliminating #if DEBUG checks
-rw-r--r--src/fs/fs_download.c52
-rw-r--r--src/fs/fs_tree.c7
-rw-r--r--src/fs/fs_unindex.c7
-rw-r--r--src/fs/gnunet-service-fs.c2
-rw-r--r--src/fs/gnunet-service-fs.h3
-rw-r--r--src/fs/gnunet-service-fs_cp.c18
-rw-r--r--src/fs/gnunet-service-fs_indexing.c11
-rw-r--r--src/fs/gnunet-service-fs_lc.c6
-rw-r--r--src/fs/gnunet-service-fs_pe.c13
-rw-r--r--src/fs/gnunet-service-fs_pr.c34
-rw-r--r--src/fs/gnunet-service-fs_push.c24
-rw-r--r--src/fs/gnunet-service-fs_put.c2
12 files changed, 1 insertions, 178 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}
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 2ac38ffd3..b3bbdc7b1 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -27,7 +27,6 @@
27#include "platform.h" 27#include "platform.h"
28#include "fs_tree.h" 28#include "fs_tree.h"
29 29
30#define DEBUG_TREE GNUNET_EXTRA_LOGGING
31 30
32/** 31/**
33 * Context for an ECRS-based file encoder that computes 32 * Context for an ECRS-based file encoder that computes
@@ -341,10 +340,8 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
341 if (te->chk_tree_depth == te->current_depth) 340 if (te->chk_tree_depth == te->current_depth)
342 { 341 {
343 off = CHK_PER_INODE * (te->chk_tree_depth - 1); 342 off = CHK_PER_INODE * (te->chk_tree_depth - 1);
344#if DEBUG_TREE
345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n", 343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n",
346 GNUNET_h2s (&te->chk_tree[off].query), off); 344 GNUNET_h2s (&te->chk_tree[off].query), off);
347#endif
348 te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 345 te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
349 te->uri->type = chk; 346 te->uri->type = chk;
350 te->uri->data.chk.chk = te->chk_tree[off]; 347 te->uri->data.chk.chk = te->chk_tree[off];
@@ -374,23 +371,19 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
374 pt_block = &te->chk_tree[(te->current_depth - 1) * CHK_PER_INODE]; 371 pt_block = &te->chk_tree[(te->current_depth - 1) * CHK_PER_INODE];
375 } 372 }
376 off = compute_chk_offset (te->current_depth, te->publish_offset); 373 off = compute_chk_offset (te->current_depth, te->publish_offset);
377#if DEBUG_TREE
378 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 374 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
379 "TE is at offset %llu and depth %u with block size %u and target-CHK-offset %u\n", 375 "TE is at offset %llu and depth %u with block size %u and target-CHK-offset %u\n",
380 (unsigned long long) te->publish_offset, te->current_depth, 376 (unsigned long long) te->publish_offset, te->current_depth,
381 (unsigned int) pt_size, (unsigned int) off); 377 (unsigned int) pt_size, (unsigned int) off);
382#endif
383 mychk = &te->chk_tree[te->current_depth * CHK_PER_INODE + off]; 378 mychk = &te->chk_tree[te->current_depth * CHK_PER_INODE + off];
384 GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key); 379 GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key);
385 GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv); 380 GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv);
386 GNUNET_CRYPTO_aes_encrypt (pt_block, pt_size, &sk, &iv, enc); 381 GNUNET_CRYPTO_aes_encrypt (pt_block, pt_size, &sk, &iv, enc);
387 GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query); 382 GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query);
388#if DEBUG_TREE
389 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 383 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
390 "TE calculates query to be `%s', stored at %u\n", 384 "TE calculates query to be `%s', stored at %u\n",
391 GNUNET_h2s (&mychk->query), 385 GNUNET_h2s (&mychk->query),
392 te->current_depth * CHK_PER_INODE + off); 386 te->current_depth * CHK_PER_INODE + off);
393#endif
394 if (NULL != te->proc) 387 if (NULL != te->proc)
395 te->proc (te->cls, mychk, te->publish_offset, te->current_depth, 388 te->proc (te->cls, mychk, te->publish_offset, te->current_depth,
396 (0 == 389 (0 ==
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index fa9147bcd..ff1996a2f 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.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_UNINDEX GNUNET_EXTRA_LOGGING
35 34
36/** 35/**
37 * Function called by the tree encoder to obtain 36 * Function called by the tree encoder to obtain
@@ -158,10 +157,8 @@ process_cont (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration
158 signal_unindex_error (uc); 157 signal_unindex_error (uc);
159 return; 158 return;
160 } 159 }
161#if DEBUG_UNINDEX
162 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 160 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
163 "Datastore REMOVE operation succeeded\n"); 161 "Datastore REMOVE operation succeeded\n");
164#endif
165 GNUNET_FS_tree_encoder_next (uc->tc); 162 GNUNET_FS_tree_encoder_next (uc->tc);
166} 163}
167 164
@@ -202,10 +199,8 @@ unindex_process (void *cls, const struct ContentHashKey *chk, uint64_t offset,
202 odb.file_id = uc->file_id; 199 odb.file_id = uc->file_id;
203 data = &odb; 200 data = &odb;
204 } 201 }
205#if DEBUG_UNINDEX
206 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
207 "Sending REMOVE request to DATASTORE service\n"); 203 "Sending REMOVE request to DATASTORE service\n");
208#endif
209 GNUNET_DATASTORE_remove (uc->dsh, &chk->query, size, data, -2, 1, 204 GNUNET_DATASTORE_remove (uc->dsh, &chk->query, size, data, -2, 1,
210 GNUNET_CONSTANTS_SERVICE_TIMEOUT, &process_cont, uc); 205 GNUNET_CONSTANTS_SERVICE_TIMEOUT, &process_cont, uc);
211} 206}
@@ -299,10 +294,8 @@ unindex_finish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
299 signal_unindex_error (uc); 294 signal_unindex_error (uc);
300 return; 295 return;
301 } 296 }
302#if DEBUG_UNINDEX
303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 297 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
304 "Sending UNINDEX message to FS service\n"); 298 "Sending UNINDEX message to FS service\n");
305#endif
306 req.header.size = htons (sizeof (struct UnindexMessage)); 299 req.header.size = htons (sizeof (struct UnindexMessage));
307 req.header.type = htons (GNUNET_MESSAGE_TYPE_FS_UNINDEX); 300 req.header.type = htons (GNUNET_MESSAGE_TYPE_FS_UNINDEX);
308 req.reserved = 0; 301 req.reserved = 0;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index cdf8f4325..06ac91c73 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -373,11 +373,9 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr,
373 struct GSF_PendingRequestData *prd; 373 struct GSF_PendingRequestData *prd;
374 374
375 prd = GSF_pending_request_get_data_ (pr); 375 prd = GSF_pending_request_get_data_ (pr);
376#if DEBUG_FS_CLIENT
377 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 376 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
378 "Finished database lookup for local request `%s' with result %d\n", 377 "Finished database lookup for local request `%s' with result %d\n",
379 GNUNET_h2s (&prd->query), result); 378 GNUNET_h2s (&prd->query), result);
380#endif
381 GNUNET_SERVER_receive_done (client, GNUNET_OK); 379 GNUNET_SERVER_receive_done (client, GNUNET_OK);
382 if (GNUNET_BLOCK_EVALUATION_OK_LAST == result) 380 if (GNUNET_BLOCK_EVALUATION_OK_LAST == result)
383 return; /* we're done, 'pr' was already destroyed... */ 381 return; /* we're done, 'pr' was already destroyed... */
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h
index c669dcc7a..5ea73ee28 100644
--- a/src/fs/gnunet-service-fs.h
+++ b/src/fs/gnunet-service-fs.h
@@ -33,9 +33,6 @@
33#include "gnunet_block_lib.h" 33#include "gnunet_block_lib.h"
34#include "fs.h" 34#include "fs.h"
35 35
36#define DEBUG_FS GNUNET_YES
37
38#define DEBUG_FS_CLIENT GNUNET_EXTRA_LOGGING
39 36
40/** 37/**
41 * By which amount do we decrement the TTL for simple forwarding / 38 * By which amount do we decrement the TTL for simple forwarding /
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 86986b899..e84993bd3 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -912,11 +912,9 @@ handle_p2p_reply (void *cls, enum GNUNET_BLOCK_EvaluationResult eval,
912 1, GNUNET_NO); 912 1, GNUNET_NO);
913 return; 913 return;
914 } 914 }
915#if DEBUG_FS
916 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 915 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
917 "Transmitting result for query `%s' to peer\n", 916 "Transmitting result for query `%s' to peer\n",
918 GNUNET_h2s (&prd->query)); 917 GNUNET_h2s (&prd->query));
919#endif
920 GNUNET_STATISTICS_update (GSF_stats, 918 GNUNET_STATISTICS_update (GSF_stats,
921 gettext_noop ("# replies received for other peers"), 919 gettext_noop ("# replies received for other peers"),
922 1, GNUNET_NO); 920 1, GNUNET_NO);
@@ -1194,7 +1192,6 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1194 cp = cps; 1192 cp = cps;
1195 if (cp == NULL) 1193 if (cp == NULL)
1196 { 1194 {
1197#if DEBUG_FS
1198 if (0 != (bm & GET_MESSAGE_BIT_RETURN_TO)) 1195 if (0 != (bm & GET_MESSAGE_BIT_RETURN_TO))
1199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1200 "Failed to find RETURN-TO peer `%4s' in connection set. Dropping query.\n", 1197 "Failed to find RETURN-TO peer `%4s' in connection set. Dropping query.\n",
@@ -1205,7 +1202,6 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1205 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1206 "Failed to find peer `%4s' in connection set. Dropping query.\n", 1203 "Failed to find peer `%4s' in connection set. Dropping query.\n",
1207 GNUNET_i2s (other)); 1204 GNUNET_i2s (other));
1208#endif
1209 GNUNET_STATISTICS_update (GSF_stats, 1205 GNUNET_STATISTICS_update (GSF_stats,
1210 gettext_noop 1206 gettext_noop
1211 ("# requests dropped due to missing reverse route"), 1207 ("# requests dropped due to missing reverse route"),
@@ -1218,19 +1214,15 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1218 priority = bound_priority (ntohl (gm->priority), cps); 1214 priority = bound_priority (ntohl (gm->priority), cps);
1219 if (priority < 0) 1215 if (priority < 0)
1220 { 1216 {
1221#if DEBUG_FS
1222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1217 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1223 "Dropping query from `%s', this peer is too busy.\n", 1218 "Dropping query from `%s', this peer is too busy.\n",
1224 GNUNET_i2s (other)); 1219 GNUNET_i2s (other));
1225#endif
1226 return NULL; 1220 return NULL;
1227 } 1221 }
1228#if DEBUG_FS
1229 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1230 "Received request for `%s' of type %u from peer `%4s' with flags %u\n", 1223 "Received request for `%s' of type %u from peer `%4s' with flags %u\n",
1231 GNUNET_h2s (&gm->query), (unsigned int) type, GNUNET_i2s (other), 1224 GNUNET_h2s (&gm->query), (unsigned int) type, GNUNET_i2s (other),
1232 (unsigned int) bm); 1225 (unsigned int) bm);
1233#endif
1234 namespace = (0 != (bm & GET_MESSAGE_BIT_SKS_NAMESPACE)) ? &opt[bits++] : NULL; 1226 namespace = (0 != (bm & GET_MESSAGE_BIT_SKS_NAMESPACE)) ? &opt[bits++] : NULL;
1235 if ((type == GNUNET_BLOCK_TYPE_FS_SBLOCK) && (namespace == NULL)) 1227 if ((type == GNUNET_BLOCK_TYPE_FS_SBLOCK) && (namespace == NULL))
1236 { 1228 {
@@ -1267,11 +1259,9 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1267 TTL_DECREMENT); 1259 TTL_DECREMENT);
1268 if ((ttl < 0) && (((int32_t) (ttl - ttl_decrement)) > 0)) 1260 if ((ttl < 0) && (((int32_t) (ttl - ttl_decrement)) > 0))
1269 { 1261 {
1270#if DEBUG_FS
1271 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1272 "Dropping query from `%s' due to TTL underflow (%d - %u).\n", 1263 "Dropping query from `%s' due to TTL underflow (%d - %u).\n",
1273 GNUNET_i2s (other), ttl, ttl_decrement); 1264 GNUNET_i2s (other), ttl, ttl_decrement);
1274#endif
1275 GNUNET_STATISTICS_update (GSF_stats, 1265 GNUNET_STATISTICS_update (GSF_stats,
1276 gettext_noop 1266 gettext_noop
1277 ("# requests dropped due TTL underflow"), 1, 1267 ("# requests dropped due TTL underflow"), 1,
@@ -1295,11 +1285,9 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1295 { 1285 {
1296 /* existing request has higher TTL, drop new one! */ 1286 /* existing request has higher TTL, drop new one! */
1297 prd->priority += priority; 1287 prd->priority += priority;
1298#if DEBUG_FS
1299 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1300 "Have existing request with higher TTL, dropping new request.\n", 1289 "Have existing request with higher TTL, dropping new request.\n",
1301 GNUNET_i2s (other)); 1290 GNUNET_i2s (other));
1302#endif
1303 GNUNET_STATISTICS_update (GSF_stats, 1291 GNUNET_STATISTICS_update (GSF_stats,
1304 gettext_noop 1292 gettext_noop
1305 ("# requests dropped due to higher-TTL request"), 1293 ("# requests dropped due to higher-TTL request"),
@@ -1352,10 +1340,8 @@ peer_transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1352 struct GSF_PeerTransmitHandle *pth = cls; 1340 struct GSF_PeerTransmitHandle *pth = cls;
1353 struct GSF_ConnectedPeer *cp; 1341 struct GSF_ConnectedPeer *cp;
1354 1342
1355#if DEBUG_FS
1356 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1357 "Timeout trying to transmit to other peer\n"); 1344 "Timeout trying to transmit to other peer\n");
1358#endif
1359 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1345 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
1360 cp = pth->cp; 1346 cp = pth->cp;
1361 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1347 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
@@ -1717,19 +1703,15 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp,
1717{ 1703{
1718 if (cp->last_migration_block.abs_value > block_time.abs_value) 1704 if (cp->last_migration_block.abs_value > block_time.abs_value)
1719 { 1705 {
1720#if DEBUG_FS
1721 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1706 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1722 "Migration already blocked for another %llu ms\n", 1707 "Migration already blocked for another %llu ms\n",
1723 (unsigned long long) 1708 (unsigned long long)
1724 GNUNET_TIME_absolute_get_remaining 1709 GNUNET_TIME_absolute_get_remaining
1725 (cp->last_migration_block).rel_value); 1710 (cp->last_migration_block).rel_value);
1726#endif
1727 return; /* already blocked */ 1711 return; /* already blocked */
1728 } 1712 }
1729#if DEBUG_FS
1730 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %llu ms\n", 1713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %llu ms\n",
1731 (unsigned long long) GNUNET_TIME_absolute_get_remaining (block_time).rel_value); 1714 (unsigned long long) GNUNET_TIME_absolute_get_remaining (block_time).rel_value);
1732#endif
1733 cp->last_migration_block = block_time; 1715 cp->last_migration_block = block_time;
1734 if (cp->migration_pth != NULL) 1716 if (cp->migration_pth != NULL)
1735 GSF_peer_transmit_cancel_ (cp->migration_pth); 1717 GSF_peer_transmit_cancel_ (cp->migration_pth);
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index d3aef8917..b56301962 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -265,10 +265,8 @@ hash_for_index_val (void *cls, const GNUNET_HashCode * res)
265 _ 265 _
266 ("Hash mismatch trying to index file `%s' which has hash `%s'\n"), 266 ("Hash mismatch trying to index file `%s' which has hash `%s'\n"),
267 ii->filename, GNUNET_h2s (res)); 267 ii->filename, GNUNET_h2s (res));
268#if DEBUG_FS
269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Wanted `%s'\n", 268 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Wanted `%s'\n",
270 GNUNET_h2s (&ii->file_id)); 269 GNUNET_h2s (&ii->file_id));
271#endif
272 GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, 270 GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0,
273 GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED); 271 GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED);
274 GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); 272 GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES);
@@ -329,11 +327,8 @@ GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client,
329 ii->filename = (const char *) &ii[1]; 327 ii->filename = (const char *) &ii[1];
330 memcpy (&ii[1], fn, slen); 328 memcpy (&ii[1], fn, slen);
331 ii->file_id = ism->file_id; 329 ii->file_id = ism->file_id;
332#if DEBUG_FS
333 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message for file `%s'\n", 330 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message for file `%s'\n",
334 "START_INDEX", ii->filename); 331 "START_INDEX", ii->filename);
335#endif
336
337 ii->tc = GNUNET_SERVER_transmit_context_create (client); 332 ii->tc = GNUNET_SERVER_transmit_context_create (client);
338 mydev = 0; 333 mydev = 0;
339 myino = 0; 334 myino = 0;
@@ -346,12 +341,10 @@ GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client,
346 GNUNET_free (fn); 341 GNUNET_free (fn);
347 return; 342 return;
348 } 343 }
349#if DEBUG_FS
350 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 344 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
351 "Mismatch in file identifiers (%llu != %llu or %u != %u), need to hash.\n", 345 "Mismatch in file identifiers (%llu != %llu or %u != %u), need to hash.\n",
352 (unsigned long long) ino, (unsigned long long) myino, 346 (unsigned long long) ino, (unsigned long long) myino,
353 (unsigned int) dev, (unsigned int) mydev); 347 (unsigned int) dev, (unsigned int) mydev);
354#endif
355 /* slow validation, need to hash full file (again) */ 348 /* slow validation, need to hash full file (again) */
356 ii->fhc = 349 ii->fhc =
357 GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_IDLE, fn, 350 GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_IDLE, fn,
@@ -457,11 +450,9 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
457 } 450 }
458 pos = next; 451 pos = next;
459 } 452 }
460#if DEBUG_FS
461 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 453 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
462 "Client requested unindexing of file `%s': %s\n", 454 "Client requested unindexing of file `%s': %s\n",
463 GNUNET_h2s (&um->file_id), found ? "found" : "not found"); 455 GNUNET_h2s (&um->file_id), found ? "found" : "not found");
464#endif
465 if (GNUNET_YES == found) 456 if (GNUNET_YES == found)
466 write_index_list (); 457 write_index_list ();
467 tc = GNUNET_SERVER_transmit_context_create (client); 458 tc = GNUNET_SERVER_transmit_context_create (client);
@@ -583,10 +574,8 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size,
583 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 574 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
584 return GNUNET_SYSERR; 575 return GNUNET_SYSERR;
585 } 576 }
586#if DEBUG_FS
587 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 577 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
588 "On-demand encoded block for query `%s'\n", GNUNET_h2s (key)); 578 "On-demand encoded block for query `%s'\n", GNUNET_h2s (key));
589#endif
590 cont (cont_cls, key, nsize, edata, GNUNET_BLOCK_TYPE_FS_DBLOCK, priority, 579 cont (cont_cls, key, nsize, edata, GNUNET_BLOCK_TYPE_FS_DBLOCK, priority,
591 anonymity, expiration, uid); 580 anonymity, expiration, uid);
592 return GNUNET_OK; 581 return GNUNET_OK;
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index dcedd495a..36aafdde9 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -270,11 +270,9 @@ client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval,
270 memcpy (&pm[1], data, data_len); 270 memcpy (&pm[1], data, data_len);
271 GSF_local_client_transmit_ (lc, &pm->header); 271 GSF_local_client_transmit_ (lc, &pm->header);
272 } 272 }
273#if DEBUG_FS_CLIENT
274 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 273 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
275 "Queued reply to query `%s' for local client\n", 274 "Queued reply to query `%s' for local client\n",
276 GNUNET_h2s (&prd->query), (unsigned int) prd->type); 275 GNUNET_h2s (&prd->query), (unsigned int) prd->type);
277#endif
278 if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST) 276 if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
279 return; 277 return;
280 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) 278 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task)
@@ -325,11 +323,9 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
325 sc = (msize - sizeof (struct SearchMessage)) / sizeof (GNUNET_HashCode); 323 sc = (msize - sizeof (struct SearchMessage)) / sizeof (GNUNET_HashCode);
326 sm = (const struct SearchMessage *) message; 324 sm = (const struct SearchMessage *) message;
327 type = ntohl (sm->type); 325 type = ntohl (sm->type);
328#if DEBUG_FS_CLIENT
329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
330 "Received request for `%s' of type %u from local client\n", 327 "Received request for `%s' of type %u from local client\n",
331 GNUNET_h2s (&sm->query), (unsigned int) type); 328 GNUNET_h2s (&sm->query), (unsigned int) type);
332#endif
333 lc = GSF_local_client_lookup_ (client); 329 lc = GSF_local_client_lookup_ (client);
334 cr = NULL; 330 cr = NULL;
335 /* detect duplicate KBLOCK requests */ 331 /* detect duplicate KBLOCK requests */
@@ -352,10 +348,8 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
352 } 348 }
353 if (cr != NULL) 349 if (cr != NULL)
354 { 350 {
355#if DEBUG_FS_CLIENT
356 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 351 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
357 "Have existing request, merging content-seen lists.\n"); 352 "Have existing request, merging content-seen lists.\n");
358#endif
359 GSF_pending_request_update_ (cr->pr, (const GNUNET_HashCode *) &sm[1], sc); 353 GSF_pending_request_update_ (cr->pr, (const GNUNET_HashCode *) &sm[1], sc);
360 GNUNET_STATISTICS_update (GSF_stats, 354 GNUNET_STATISTICS_update (GSF_stats,
361 gettext_noop 355 gettext_noop
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index f1d87db01..71b0fc091 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -318,12 +318,9 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp)
318 (unsigned int) rp->transmission_counter, 318 (unsigned int) rp->transmission_counter,
319 (unsigned long long) delay.rel_value); 319 (unsigned long long) delay.rel_value);
320 rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); 320 rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay);
321#if DEBUG_FS
322 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 321 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
323 "Earliest (re)transmission for `%s' in %us\n", 322 "Earliest (re)transmission for `%s' in %us\n",
324 GNUNET_h2s (&prd->query), rp->transmission_counter); 323 GNUNET_h2s (&prd->query), rp->transmission_counter);
325#endif
326
327 GNUNET_assert (rp->hn == NULL); 324 GNUNET_assert (rp->hn == NULL);
328 if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value 325 if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value
329 == 0) 326 == 0)
@@ -414,11 +411,9 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
414 rp->last_transmission = GNUNET_TIME_absolute_get (); 411 rp->last_transmission = GNUNET_TIME_absolute_get ();
415 rp->transmission_counter++; 412 rp->transmission_counter++;
416 total_delay++; 413 total_delay++;
417#if DEBUG_FS
418 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 414 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
419 "Executing plan %p executed %u times, planning retransmission\n", 415 "Executing plan %p executed %u times, planning retransmission\n",
420 rp, rp->transmission_counter); 416 rp, rp->transmission_counter);
421#endif
422 plan (pp, rp); 417 plan (pp, rp);
423 GNUNET_STATISTICS_update (GSF_stats, 418 GNUNET_STATISTICS_update (GSF_stats,
424 gettext_noop 419 gettext_noop
@@ -463,18 +458,14 @@ schedule_peer_transmission (void *cls,
463 rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap); 458 rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap);
464 if (NULL == rp) 459 if (NULL == rp)
465 { 460 {
466#if DEBUG_FS
467 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No active requests for plan %p.\n", 461 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No active requests for plan %p.\n",
468 pp); 462 pp);
469#endif
470 return; /* both queues empty */ 463 return; /* both queues empty */
471 } 464 }
472 delay = GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission); 465 delay = GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission);
473#if DEBUG_FS
474 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 466 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
475 "Sleeping for %llu ms before retrying requests on plan %p.\n", 467 "Sleeping for %llu ms before retrying requests on plan %p.\n",
476 (unsigned long long) delay.rel_value, pp); 468 (unsigned long long) delay.rel_value, pp);
477#endif
478 GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# delay heap timeout"), 469 GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# delay heap timeout"),
479 delay.rel_value, GNUNET_NO); 470 delay.rel_value, GNUNET_NO);
480 471
@@ -486,9 +477,7 @@ schedule_peer_transmission (void *cls,
486 1, GNUNET_NO); 477 1, GNUNET_NO);
487 /* process from priority heap */ 478 /* process from priority heap */
488 rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); 479 rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
489#if DEBUG_FS > 1
490 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp); 480 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp);
491#endif
492 GNUNET_assert (NULL != rp); 481 GNUNET_assert (NULL != rp);
493 msize = GSF_pending_request_get_message_ (get_latest (rp), 0, NULL); 482 msize = GSF_pending_request_get_message_ (get_latest (rp), 0, NULL);
494 pp->pth = 483 pp->pth =
@@ -608,11 +597,9 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr)
608 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plan entries"), 1, 597 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plan entries"), 1,
609 GNUNET_NO); 598 GNUNET_NO);
610 prd = GSF_pending_request_get_data_ (pr); 599 prd = GSF_pending_request_get_data_ (pr);
611#if DEBUG_FS
612 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 600 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
613 "Planning transmission of query `%s' to peer `%s'\n", 601 "Planning transmission of query `%s' to peer `%s'\n",
614 GNUNET_h2s (&prd->query), GNUNET_i2s (&id)); 602 GNUNET_h2s (&prd->query), GNUNET_i2s (&id));
615#endif
616 rp = GNUNET_malloc (sizeof (struct GSF_RequestPlan)); 603 rp = GNUNET_malloc (sizeof (struct GSF_RequestPlan));
617 rpr = GNUNET_malloc (sizeof (struct GSF_RequestPlanReference)); 604 rpr = GNUNET_malloc (sizeof (struct GSF_RequestPlanReference));
618 prl = GNUNET_malloc (sizeof (struct PendingRequestList)); 605 prl = GNUNET_malloc (sizeof (struct PendingRequestList));
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index c16f94464..d4b448185 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -278,11 +278,9 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
278 struct GSF_PendingRequest *pr; 278 struct GSF_PendingRequest *pr;
279 struct GSF_PendingRequest *dpr; 279 struct GSF_PendingRequest *dpr;
280 280
281#if DEBUG_FS
282 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 281 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
283 "Creating request handle for `%s' of type %d\n", 282 "Creating request handle for `%s' of type %d\n",
284 GNUNET_h2s (query), type); 283 GNUNET_h2s (query), type);
285#endif
286 GNUNET_STATISTICS_update (GSF_stats, 284 GNUNET_STATISTICS_update (GSF_stats,
287 gettext_noop ("# Pending requests created"), 1, 285 gettext_noop ("# Pending requests created"), 1,
288 GNUNET_NO); 286 GNUNET_NO);
@@ -489,12 +487,10 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
489 int64_t ttl; 487 int64_t ttl;
490 int do_route; 488 int do_route;
491 489
492#if DEBUG_FS
493 if (buf_size > 0) 490 if (buf_size > 0)
494 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 491 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
495 "Building request message for `%s' of type %d\n", 492 "Building request message for `%s' of type %d\n",
496 GNUNET_h2s (&pr->public_data.query), pr->public_data.type); 493 GNUNET_h2s (&pr->public_data.query), pr->public_data.type);
497#endif
498 k = 0; 494 k = 0;
499 bm = 0; 495 bm = 0;
500 do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); 496 do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY));
@@ -574,10 +570,8 @@ clean_request (void *cls, const GNUNET_HashCode * key, void *value)
574 struct GSF_PendingRequest *pr = value; 570 struct GSF_PendingRequest *pr = value;
575 GSF_LocalLookupContinuation cont; 571 GSF_LocalLookupContinuation cont;
576 572
577#if DEBUG_FS
578 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
579 "Cleaning up pending request for `%s'.\n", GNUNET_h2s (key)); 574 "Cleaning up pending request for `%s'.\n", GNUNET_h2s (key));
580#endif
581 if (NULL != (cont = pr->llc_cont)) 575 if (NULL != (cont = pr->llc_cont))
582 { 576 {
583 pr->llc_cont = NULL; 577 pr->llc_cont = NULL;
@@ -778,11 +772,9 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
778 772
779 if (NULL == pr->rh) 773 if (NULL == pr->rh)
780 return GNUNET_YES; 774 return GNUNET_YES;
781#if DEBUG_FS
782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 775 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
783 "Matched result (type %u) for query `%s' with pending request\n", 776 "Matched result (type %u) for query `%s' with pending request\n",
784 (unsigned int) prq->type, GNUNET_h2s (key)); 777 (unsigned int) prq->type, GNUNET_h2s (key));
785#endif
786 GNUNET_STATISTICS_update (GSF_stats, 778 GNUNET_STATISTICS_update (GSF_stats,
787 gettext_noop ("# replies received and matched"), 1, 779 gettext_noop ("# replies received and matched"), 1,
788 GNUNET_NO); 780 GNUNET_NO);
@@ -815,10 +807,8 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
815 gettext_noop 807 gettext_noop
816 ("# duplicate replies discarded (bloomfilter)"), 808 ("# duplicate replies discarded (bloomfilter)"),
817 1, GNUNET_NO); 809 1, GNUNET_NO);
818#if DEBUG_FS && 0
819 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
820 "Duplicate response `%s', discarding.\n", GNUNET_h2s (&mhash)); 811 "Duplicate response, discarding.\n");
821#endif
822 return GNUNET_YES; /* duplicate */ 812 return GNUNET_YES; /* duplicate */
823 case GNUNET_BLOCK_EVALUATION_RESULT_INVALID: 813 case GNUNET_BLOCK_EVALUATION_RESULT_INVALID:
824 return GNUNET_YES; /* wrong namespace */ 814 return GNUNET_YES; /* wrong namespace */
@@ -838,11 +828,9 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
838 GSF_pending_request_update_ (pr, &chash, 1); 828 GSF_pending_request_update_ (pr, &chash, 1);
839 if (NULL == prq->sender) 829 if (NULL == prq->sender)
840 { 830 {
841#if DEBUG_FS
842 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 831 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
843 "Found result for query `%s' in local datastore\n", 832 "Found result for query `%s' in local datastore\n",
844 GNUNET_h2s (key)); 833 GNUNET_h2s (key));
845#endif
846 GNUNET_STATISTICS_update (GSF_stats, 834 GNUNET_STATISTICS_update (GSF_stats,
847 gettext_noop ("# results found locally"), 1, 835 gettext_noop ("# results found locally"), 1,
848 GNUNET_NO); 836 GNUNET_NO);
@@ -940,11 +928,9 @@ put_migration_continuation (void *cls, int success,
940 ppd = GSF_get_peer_performance_data_ (cp); 928 ppd = GSF_get_peer_performance_data_ (cp);
941 if (min_expiration.abs_value > 0) 929 if (min_expiration.abs_value > 0)
942 { 930 {
943#if DEBUG_FS
944 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 931 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
945 "Asking to stop migration for %llu ms because datastore is full\n", 932 "Asking to stop migration for %llu ms because datastore is full\n",
946 (unsigned long long) GNUNET_TIME_absolute_get_remaining (min_expiration).rel_value); 933 (unsigned long long) GNUNET_TIME_absolute_get_remaining (min_expiration).rel_value);
947#endif
948 GSF_block_peer_migration_ (cp, min_expiration); 934 GSF_block_peer_migration_ (cp, min_expiration);
949 } 935 }
950 else 936 else
@@ -956,11 +942,9 @@ put_migration_continuation (void *cls, int success,
956 mig_pause.rel_value = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 942 mig_pause.rel_value = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
957 ppd->migration_delay.rel_value); 943 ppd->migration_delay.rel_value);
958 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); 944 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2);
959#if DEBUG_FS
960 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 945 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
961 "Replicated content already exists locally, asking to stop migration for %llu ms\n", 946 "Replicated content already exists locally, asking to stop migration for %llu ms\n",
962 (unsigned long long) mig_pause.rel_value); 947 (unsigned long long) mig_pause.rel_value);
963#endif
964 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause)); 948 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause));
965 } 949 }
966 } 950 }
@@ -1042,11 +1026,9 @@ handle_dht_reply (void *cls, struct GNUNET_TIME_Absolute exp,
1042 if ((GNUNET_YES == active_to_migration) && 1026 if ((GNUNET_YES == active_to_migration) &&
1043 (GNUNET_NO == test_put_load_too_high (prq.priority))) 1027 (GNUNET_NO == test_put_load_too_high (prq.priority)))
1044 { 1028 {
1045#if DEBUG_FS
1046 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1029 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1047 "Replicating result for query `%s' with priority %u\n", 1030 "Replicating result for query `%s' with priority %u\n",
1048 GNUNET_h2s (key), prq.priority); 1031 GNUNET_h2s (key), prq.priority);
1049#endif
1050 pmc = GNUNET_malloc (sizeof (struct PutMigrationContext)); 1032 pmc = GNUNET_malloc (sizeof (struct PutMigrationContext));
1051 pmc->start = GNUNET_TIME_absolute_get (); 1033 pmc->start = GNUNET_TIME_absolute_get ();
1052 pmc->requested = GNUNET_YES; 1034 pmc->requested = GNUNET_YES;
@@ -1220,10 +1202,8 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size,
1220 } 1202 }
1221 if (NULL == key) 1203 if (NULL == key)
1222 { 1204 {
1223#if DEBUG_FS
1224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 1205 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
1225 "No further local responses available.\n"); 1206 "No further local responses available.\n");
1226#endif
1227 if ((pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK) || 1207 if ((pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK) ||
1228 (pr->public_data.type == GNUNET_BLOCK_TYPE_FS_IBLOCK)) 1208 (pr->public_data.type == GNUNET_BLOCK_TYPE_FS_IBLOCK))
1229 GNUNET_STATISTICS_update (GSF_stats, 1209 GNUNET_STATISTICS_update (GSF_stats,
@@ -1232,17 +1212,13 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size,
1232 GNUNET_NO); 1212 GNUNET_NO);
1233 goto check_error_and_continue; 1213 goto check_error_and_continue;
1234 } 1214 }
1235#if DEBUG_FS
1236 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1237 "Received reply for `%s' of type %d with UID %llu from datastore.\n", 1216 "Received reply for `%s' of type %d with UID %llu from datastore.\n",
1238 GNUNET_h2s (key), type, (unsigned long long) uid); 1217 GNUNET_h2s (key), type, (unsigned long long) uid);
1239#endif
1240 if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) 1218 if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
1241 { 1219 {
1242#if DEBUG_FS
1243 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1220 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1244 "Found ONDEMAND block, performing on-demand encoding\n"); 1221 "Found ONDEMAND block, performing on-demand encoding\n");
1245#endif
1246 GNUNET_STATISTICS_update (GSF_stats, 1222 GNUNET_STATISTICS_update (GSF_stats,
1247 gettext_noop 1223 gettext_noop
1248 ("# on-demand blocks matched requests"), 1, 1224 ("# on-demand blocks matched requests"), 1,
@@ -1356,9 +1332,7 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size,
1356 ((GNUNET_YES == GSF_test_get_load_too_high_ (0)) || 1332 ((GNUNET_YES == GSF_test_get_load_too_high_ (0)) ||
1357 (pr->public_data.results_found > 5 + 2 * pr->public_data.priority))) 1333 (pr->public_data.results_found > 5 + 2 * pr->public_data.priority)))
1358 { 1334 {
1359#if DEBUG_FS > 2
1360 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Load too high, done with request\n"); 1335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Load too high, done with request\n");
1361#endif
1362 GNUNET_STATISTICS_update (GSF_stats, 1336 GNUNET_STATISTICS_update (GSF_stats,
1363 gettext_noop 1337 gettext_noop
1364 ("# Datastore lookups concluded (load too high)"), 1338 ("# Datastore lookups concluded (load too high)"),
@@ -1557,11 +1531,9 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1557 if ((GNUNET_YES == active_to_migration) && 1531 if ((GNUNET_YES == active_to_migration) &&
1558 (GNUNET_NO == test_put_load_too_high (prq.priority))) 1532 (GNUNET_NO == test_put_load_too_high (prq.priority)))
1559 { 1533 {
1560#if DEBUG_FS
1561 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1534 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1562 "Replicating result for query `%s' with priority %u\n", 1535 "Replicating result for query `%s' with priority %u\n",
1563 GNUNET_h2s (&query), prq.priority); 1536 GNUNET_h2s (&query), prq.priority);
1564#endif
1565 pmc = GNUNET_malloc (sizeof (struct PutMigrationContext)); 1537 pmc = GNUNET_malloc (sizeof (struct PutMigrationContext));
1566 pmc->start = GNUNET_TIME_absolute_get (); 1538 pmc->start = GNUNET_TIME_absolute_get ();
1567 pmc->requested = prq.request_found; 1539 pmc->requested = prq.request_found;
@@ -1581,12 +1553,10 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1581 } 1553 }
1582 else 1554 else
1583 { 1555 {
1584#if DEBUG_FS
1585 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1556 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1586 "Choosing not to keep content `%s' (%d/%d)\n", 1557 "Choosing not to keep content `%s' (%d/%d)\n",
1587 GNUNET_h2s (&query), active_to_migration, 1558 GNUNET_h2s (&query), active_to_migration,
1588 test_put_load_too_high (prq.priority)); 1559 test_put_load_too_high (prq.priority));
1589#endif
1590 } 1560 }
1591 putl = GNUNET_LOAD_get_load (datastore_put_load); 1561 putl = GNUNET_LOAD_get_load (datastore_put_load);
1592 if ((NULL != (cp = prq.sender)) && (GNUNET_NO == prq.request_found) && 1562 if ((NULL != (cp = prq.sender)) && (GNUNET_NO == prq.request_found) &&
@@ -1601,14 +1571,12 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1601 GNUNET_CRYPTO_random_u32 1571 GNUNET_CRYPTO_random_u32
1602 (GNUNET_CRYPTO_QUALITY_WEAK, 1572 (GNUNET_CRYPTO_QUALITY_WEAK,
1603 (unsigned int) (60000 * putl * putl))); 1573 (unsigned int) (60000 * putl * putl)));
1604#if DEBUG_FS
1605 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1574 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1606 "Asking to stop migration for %llu ms because of load %f and events %d/%d\n", 1575 "Asking to stop migration for %llu ms because of load %f and events %d/%d\n",
1607 (unsigned long long) block_time.rel_value, 1576 (unsigned long long) block_time.rel_value,
1608 putl, 1577 putl,
1609 active_to_migration, 1578 active_to_migration,
1610 (GNUNET_NO == prq.request_found)); 1579 (GNUNET_NO == prq.request_found));
1611#endif
1612 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (block_time)); 1580 GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (block_time));
1613 } 1581 }
1614 return GNUNET_OK; 1582 return GNUNET_OK;
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index 4fde823a1..22a76f332 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -31,8 +31,6 @@
31#include "gnunet-service-fs_push.h" 31#include "gnunet-service-fs_push.h"
32 32
33 33
34#define DEBUG_FS_MIGRATION GNUNET_EXTRA_LOGGING
35
36/** 34/**
37 * Maximum number of blocks we keep in memory for migration. 35 * Maximum number of blocks we keep in memory for migration.
38 */ 36 */
@@ -227,10 +225,8 @@ transmit_message (void *cls, size_t buf_size, void *buf)
227 peer->msg = NULL; 225 peer->msg = NULL;
228 if (buf == NULL) 226 if (buf == NULL)
229 { 227 {
230#if DEBUG_FS_MIGRATION
231 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
232 "Failed to migrate content to another peer (disconnect)\n"); 229 "Failed to migrate content to another peer (disconnect)\n");
233#endif
234 GNUNET_free (msg); 230 GNUNET_free (msg);
235 return 0; 231 return 0;
236 } 232 }
@@ -238,10 +234,8 @@ transmit_message (void *cls, size_t buf_size, void *buf)
238 GNUNET_assert (msize <= buf_size); 234 GNUNET_assert (msize <= buf_size);
239 memcpy (buf, msg, msize); 235 memcpy (buf, msg, msize);
240 GNUNET_free (msg); 236 GNUNET_free (msg);
241#if DEBUG_FS_MIGRATION
242 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pushing %u bytes to another peer\n", 237 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pushing %u bytes to another peer\n",
243 msize); 238 msize);
244#endif
245 find_content (peer); 239 find_content (peer);
246 return msize; 240 return msize;
247} 241}
@@ -292,10 +286,8 @@ transmit_content (struct MigrationReadyPeer *peer,
292 { 286 {
293 ret = GNUNET_NO; 287 ret = GNUNET_NO;
294 } 288 }
295#if DEBUG_FS_MIGRATION
296 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 289 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
297 "Asking for transmission of %u bytes for migration\n", msize); 290 "Asking for transmission of %u bytes for migration\n", msize);
298#endif
299 peer->th = GSF_peer_transmit_ (peer->peer, GNUNET_NO, 0 /* priority */ , 291 peer->th = GSF_peer_transmit_ (peer->peer, GNUNET_NO, 0 /* priority */ ,
300 GNUNET_TIME_UNIT_FOREVER_REL, msize, 292 GNUNET_TIME_UNIT_FOREVER_REL, msize,
301 &transmit_message, peer); 293 &transmit_message, peer);
@@ -390,16 +382,12 @@ find_content (struct MigrationReadyPeer *mrp)
390 { 382 {
391 if (mig_size < MAX_MIGRATION_QUEUE) 383 if (mig_size < MAX_MIGRATION_QUEUE)
392 { 384 {
393#if DEBUG_FS_MIGRATION
394 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 385 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
395 "No content found for pushing, waiting for queue to fill\n"); 386 "No content found for pushing, waiting for queue to fill\n");
396#endif
397 return; /* will fill up eventually... */ 387 return; /* will fill up eventually... */
398 } 388 }
399#if DEBUG_FS_MIGRATION
400 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 389 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
401 "No suitable content found, purging content from full queue\n"); 390 "No suitable content found, purging content from full queue\n");
402#endif
403 /* failed to find migration target AND 391 /* failed to find migration target AND
404 * queue is full, purge most-forwarded 392 * queue is full, purge most-forwarded
405 * block from queue to make room for more */ 393 * block from queue to make room for more */
@@ -419,10 +407,8 @@ find_content (struct MigrationReadyPeer *mrp)
419 consider_gathering (); 407 consider_gathering ();
420 return; 408 return;
421 } 409 }
422#if DEBUG_FS_MIGRATION
423 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
424 "Preparing to push best content to peer\n"); 411 "Preparing to push best content to peer\n");
425#endif
426 transmit_content (mrp, best); 412 transmit_content (mrp, best);
427} 413}
428 414
@@ -459,10 +445,8 @@ consider_gathering ()
459 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, mig_size); 445 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, mig_size);
460 delay = GNUNET_TIME_relative_divide (delay, MAX_MIGRATION_QUEUE); 446 delay = GNUNET_TIME_relative_divide (delay, MAX_MIGRATION_QUEUE);
461 delay = GNUNET_TIME_relative_max (delay, min_migration_delay); 447 delay = GNUNET_TIME_relative_max (delay, min_migration_delay);
462#if DEBUG_FS_MIGRATION
463 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 448 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
464 "Scheduling gathering task (queue size: %u)\n", mig_size); 449 "Scheduling gathering task (queue size: %u)\n", mig_size);
465#endif
466 mig_task = 450 mig_task =
467 GNUNET_SCHEDULER_add_delayed (delay, &gather_migration_blocks, NULL); 451 GNUNET_SCHEDULER_add_delayed (delay, &gather_migration_blocks, NULL);
468} 452}
@@ -494,9 +478,7 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size,
494 mig_qe = NULL; 478 mig_qe = NULL;
495 if (key == NULL) 479 if (key == NULL)
496 { 480 {
497#if DEBUG_FS_MIGRATION
498 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No content found for migration...\n"); 481 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No content found for migration...\n");
499#endif
500 consider_gathering (); 482 consider_gathering ();
501 return; 483 return;
502 } 484 }
@@ -516,11 +498,9 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size,
516 consider_gathering (); 498 consider_gathering ();
517 return; 499 return;
518 } 500 }
519#if DEBUG_FS_MIGRATION
520 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 501 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
521 "Retrieved block `%s' of type %u for migration (queue size: %u/%u)\n", 502 "Retrieved block `%s' of type %u for migration (queue size: %u/%u)\n",
522 GNUNET_h2s (key), type, mig_size + 1, MAX_MIGRATION_QUEUE); 503 GNUNET_h2s (key), type, mig_size + 1, MAX_MIGRATION_QUEUE);
523#endif
524 mb = GNUNET_malloc (sizeof (struct MigrationReadyBlock) + size); 504 mb = GNUNET_malloc (sizeof (struct MigrationReadyBlock) + size);
525 mb->query = *key; 505 mb->query = *key;
526 mb->expiration = expiration; 506 mb->expiration = expiration;
@@ -534,10 +514,8 @@ process_migration_content (void *cls, const GNUNET_HashCode * key, size_t size,
534 { 514 {
535 if (NULL == pos->th) 515 if (NULL == pos->th)
536 { 516 {
537#if DEBUG_FS_MIGRATION
538 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 517 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
539 "Preparing to push best content to peer\n"); 518 "Preparing to push best content to peer\n");
540#endif
541 if (GNUNET_YES == transmit_content (pos, mb)) 519 if (GNUNET_YES == transmit_content (pos, mb))
542 break; /* 'mb' was freed! */ 520 break; /* 'mb' was freed! */
543 } 521 }
@@ -563,11 +541,9 @@ gather_migration_blocks (void *cls,
563 return; 541 return;
564 if (GSF_dsh != NULL) 542 if (GSF_dsh != NULL)
565 { 543 {
566#if DEBUG_FS_MIGRATION
567 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
568 "Asking datastore for content for replication (queue size: %u)\n", 545 "Asking datastore for content for replication (queue size: %u)\n",
569 mig_size); 546 mig_size);
570#endif
571 mig_qe = 547 mig_qe =
572 GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX, 548 GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX,
573 GNUNET_TIME_UNIT_FOREVER_REL, 549 GNUNET_TIME_UNIT_FOREVER_REL,
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index fe6ebdbe4..3ac67136a 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -156,11 +156,9 @@ process_dht_put_content (void *cls, const GNUNET_HashCode * key, size_t size,
156 } 156 }
157 po->zero_anonymity_count_estimate = 157 po->zero_anonymity_count_estimate =
158 GNUNET_MAX (po->current_offset, po->zero_anonymity_count_estimate); 158 GNUNET_MAX (po->current_offset, po->zero_anonymity_count_estimate);
159#if DEBUG_FS
160 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 159 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
161 "Retrieved block `%s' of type %u for DHT PUT\n", GNUNET_h2s (key), 160 "Retrieved block `%s' of type %u for DHT PUT\n", GNUNET_h2s (key),
162 type); 161 type);
163#endif
164 GNUNET_DHT_put (GSF_dht, key, 5 /* DEFAULT_PUT_REPLICATION */ , 162 GNUNET_DHT_put (GSF_dht, key, 5 /* DEFAULT_PUT_REPLICATION */ ,
165 GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, type, size, data, 163 GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, type, size, data,
166 expiration, GNUNET_TIME_UNIT_FOREVER_REL, 164 expiration, GNUNET_TIME_UNIT_FOREVER_REL,