aboutsummaryrefslogtreecommitdiff
path: root/src/topology
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-05 20:31:58 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-05 20:31:58 +0000
commitcb4610c2c23191e0977738402d87e7b6bd0808c9 (patch)
treebb6f7ad28dd92895680c909adbe3d54a3cce62b6 /src/topology
parent78a3d311f2c3c82affe6003b9bd3c17c0b2d200b (diff)
downloadgnunet-cb4610c2c23191e0977738402d87e7b6bd0808c9.tar.gz
gnunet-cb4610c2c23191e0977738402d87e7b6bd0808c9.zip
trying to fix bandwidth calculations
Diffstat (limited to 'src/topology')
-rw-r--r--src/topology/gnunet-daemon-topology.c31
-rw-r--r--src/topology/test_gnunet_service_topology_data.conf1
2 files changed, 24 insertions, 8 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 6ae4d8210..7f761360d 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -832,6 +832,11 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello)
832 struct PeerList *pos; 832 struct PeerList *pos;
833 uint16_t size; 833 uint16_t size;
834 834
835 GNUNET_break (GNUNET_OK == GNUNET_HELLO_get_id (hello, &pid));
836 if (0 == memcmp (&pid,
837 &my_identity,
838 sizeof (struct GNUNET_PeerIdentity)))
839 return; /* that's me! */
835 have_address = GNUNET_NO; 840 have_address = GNUNET_NO;
836 GNUNET_HELLO_iterate_addresses (hello, 841 GNUNET_HELLO_iterate_addresses (hello,
837 GNUNET_NO, 842 GNUNET_NO,
@@ -839,7 +844,6 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello)
839 &have_address); 844 &have_address);
840 if (GNUNET_NO == have_address) 845 if (GNUNET_NO == have_address)
841 return; /* no point in advertising this one... */ 846 return; /* no point in advertising this one... */
842 GNUNET_break (GNUNET_OK == GNUNET_HELLO_get_id (hello, &pid));
843 peer = find_peer (&pid); 847 peer = find_peer (&pid);
844 if (peer == NULL) 848 if (peer == NULL)
845 peer = make_peer (&pid, hello, GNUNET_NO); 849 peer = make_peer (&pid, hello, GNUNET_NO);
@@ -1098,13 +1102,24 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
1098 } 1102 }
1099 else 1103 else
1100 { 1104 {
1101 entries_found++; 1105 if (0 != memcmp (&pid,
1102 fl = make_peer (&pid, 1106 &my_identity,
1103 NULL, 1107 sizeof (struct GNUNET_PeerIdentity)))
1104 GNUNET_YES); 1108 {
1105 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1109 entries_found++;
1106 _("Found friend `%s' in configuration\n"), 1110 fl = make_peer (&pid,
1107 GNUNET_i2s (&fl->id)); 1111 NULL,
1112 GNUNET_YES);
1113 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1114 _("Found friend `%s' in configuration\n"),
1115 GNUNET_i2s (&fl->id));
1116 }
1117 else
1118 {
1119 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1120 _("Found myself `%s' in friend list (useless, ignored)\n"),
1121 GNUNET_i2s (&fl->id));
1122 }
1108 } 1123 }
1109 pos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded); 1124 pos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded);
1110 while ((pos < frstat.st_size) && isspace (data[pos])) 1125 while ((pos < frstat.st_size) && isspace (data[pos]))
diff --git a/src/topology/test_gnunet_service_topology_data.conf b/src/topology/test_gnunet_service_topology_data.conf
index 588134b8a..a7cf18955 100644
--- a/src/topology/test_gnunet_service_topology_data.conf
+++ b/src/topology/test_gnunet_service_topology_data.conf
@@ -8,6 +8,7 @@ PORT = 2664
8[transport] 8[transport]
9PORT = 2665 9PORT = 2665
10PLUGINS = tcp 10PLUGINS = tcp
11DEBUG = YES
11#PREFIX = xterm -e xterm -T transport -e gdb -x cmd --args 12#PREFIX = xterm -e xterm -T transport -e gdb -x cmd --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p 13#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13 14