diff options
author | Julius Bünger <buenger@mytum.de> | 2016-08-27 14:58:27 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2016-08-27 14:58:27 +0000 |
commit | ca9a09fa7419882c6257ab5b6fa7cfc66bf6540d (patch) | |
tree | 2186d48c31c8cc8a6a9b07791402694dcbb87b4f /src/rps | |
parent | 6df56da479bf8e600a69f058758a7fb371e63e9d (diff) | |
download | gnunet-ca9a09fa7419882c6257ab5b6fa7cfc66bf6540d.tar.gz gnunet-ca9a09fa7419882c6257ab5b6fa7cfc66bf6540d.zip |
-rps peers: logging
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps_peers.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps_peers.c b/src/rps/gnunet-service-rps_peers.c index 0a8c48806..49b154547 100644 --- a/src/rps/gnunet-service-rps_peers.c +++ b/src/rps/gnunet-service-rps_peers.c | |||
@@ -895,6 +895,10 @@ restore_valid_peers () | |||
895 | buf = GNUNET_malloc (file_size); | 895 | buf = GNUNET_malloc (file_size); |
896 | size_read = GNUNET_DISK_file_read (fh, buf, file_size); | 896 | size_read = GNUNET_DISK_file_read (fh, buf, file_size); |
897 | GNUNET_assert (size_read == file_size); | 897 | GNUNET_assert (size_read == file_size); |
898 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
899 | "Restoring %" PRIu32 " peers from file `%s'\n", | ||
900 | num_peers, | ||
901 | filename_valid_peers); | ||
898 | for (iter_buf = buf; iter_buf < buf + file_size - 1; iter_buf += 53) | 902 | for (iter_buf = buf; iter_buf < buf + file_size - 1; iter_buf += 53) |
899 | { | 903 | { |
900 | str_repr = GNUNET_strndup (iter_buf, 53); | 904 | str_repr = GNUNET_strndup (iter_buf, 53); |
@@ -908,11 +912,15 @@ restore_valid_peers () | |||
908 | "num_peers: %" PRIu32 ", _size (valid_peers): %u\n", | 912 | "num_peers: %" PRIu32 ", _size (valid_peers): %u\n", |
909 | num_peers, | 913 | num_peers, |
910 | GNUNET_CONTAINER_multipeermap_size (valid_peers)); | 914 | GNUNET_CONTAINER_multipeermap_size (valid_peers)); |
911 | GNUNET_assert (num_peers == GNUNET_CONTAINER_multipeermap_size (valid_peers)); | 915 | if (num_peers != GNUNET_CONTAINER_multipeermap_size (valid_peers)) |
916 | { | ||
917 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
918 | "Number of restored peers does not match file size. Have probably duplicates.\n"); | ||
919 | } | ||
912 | GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); | 920 | GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); |
913 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 921 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
914 | "Restored %u valid peers from disk\n", | 922 | "Restored %u valid peers from disk\n", |
915 | num_peers); | 923 | GNUNET_CONTAINER_multipeermap_size (valid_peers)); |
916 | } | 924 | } |
917 | 925 | ||
918 | 926 | ||