diff options
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index efb0e4b77..00fe3bc4d 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -495,14 +495,10 @@ reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
495 | n->state_reset = GNUNET_SCHEDULER_NO_TASK; | 495 | n->state_reset = GNUNET_SCHEDULER_NO_TASK; |
496 | if (n->state == S_CONNECTED) | 496 | if (n->state == S_CONNECTED) |
497 | return; | 497 | return; |
498 | |||
499 | #if DEBUG_TRANSPORT | ||
500 | GNUNET_STATISTICS_update (GST_stats, | 498 | GNUNET_STATISTICS_update (GST_stats, |
501 | gettext_noop | 499 | gettext_noop |
502 | ("# failed connection attempts due to timeout"), 1, | 500 | ("# failed connection attempts due to timeout"), 1, |
503 | GNUNET_NO); | 501 | GNUNET_NO); |
504 | #endif | ||
505 | |||
506 | /* resetting state */ | 502 | /* resetting state */ |
507 | 503 | ||
508 | if (n->state == S_FAST_RECONNECT) | 504 | if (n->state == S_FAST_RECONNECT) |
@@ -714,11 +710,9 @@ transmit_send_continuation (void *cls, | |||
714 | n->transmission_task = GNUNET_SCHEDULER_add_now (&transmission_task, n); | 710 | n->transmission_task = GNUNET_SCHEDULER_add_now (&transmission_task, n); |
715 | } | 711 | } |
716 | } | 712 | } |
717 | #if DEBUG_TRANSPORT | ||
718 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending message of type %u was %s\n", | 713 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending message of type %u was %s\n", |
719 | ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type), | 714 | ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type), |
720 | (success == GNUNET_OK) ? "successful" : "FAILED"); | 715 | (success == GNUNET_OK) ? "successful" : "FAILED"); |
721 | #endif | ||
722 | if (NULL != mq->cont) | 716 | if (NULL != mq->cont) |
723 | mq->cont (mq->cont_cls, success); | 717 | mq->cont (mq->cont_cls, success); |
724 | GNUNET_free (mq); | 718 | GNUNET_free (mq); |
@@ -763,10 +757,8 @@ try_transmission_to_peer (struct NeighbourMapEntry *n) | |||
763 | 757 | ||
764 | if (n->address == NULL) | 758 | if (n->address == NULL) |
765 | { | 759 | { |
766 | #if DEBUG_TRANSPORT | ||
767 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No address for peer `%s'\n", | 760 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No address for peer `%s'\n", |
768 | GNUNET_i2s (&n->id)); | 761 | GNUNET_i2s (&n->id)); |
769 | #endif | ||
770 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); | 762 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); |
771 | transmit_send_continuation (mq, &n->id, GNUNET_SYSERR); | 763 | transmit_send_continuation (mq, &n->id, GNUNET_SYSERR); |
772 | GNUNET_assert (n->transmission_task == GNUNET_SCHEDULER_NO_TASK); | 764 | GNUNET_assert (n->transmission_task == GNUNET_SCHEDULER_NO_TASK); |
@@ -853,11 +845,9 @@ static void | |||
853 | send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target, | 845 | send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target, |
854 | int result) | 846 | int result) |
855 | { | 847 | { |
856 | #if DEBUG_TRANSPORT | ||
857 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 848 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
858 | "Sending DISCONNECT message to peer `%4s': %i\n", | 849 | "Sending DISCONNECT message to peer `%4s': %i\n", |
859 | GNUNET_i2s (target), result); | 850 | GNUNET_i2s (target), result); |
860 | #endif | ||
861 | } | 851 | } |
862 | 852 | ||
863 | 853 | ||
@@ -867,12 +857,9 @@ send_disconnect (struct NeighbourMapEntry * n) | |||
867 | size_t ret; | 857 | size_t ret; |
868 | struct SessionDisconnectMessage disconnect_msg; | 858 | struct SessionDisconnectMessage disconnect_msg; |
869 | 859 | ||
870 | #if DEBUG_TRANSPORT | ||
871 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 860 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
872 | "Sending DISCONNECT message to peer `%4s'\n", | 861 | "Sending DISCONNECT message to peer `%4s'\n", |
873 | GNUNET_i2s (&n->id)); | 862 | GNUNET_i2s (&n->id)); |
874 | #endif | ||
875 | |||
876 | disconnect_msg.header.size = htons (sizeof (struct SessionDisconnectMessage)); | 863 | disconnect_msg.header.size = htons (sizeof (struct SessionDisconnectMessage)); |
877 | disconnect_msg.header.type = | 864 | disconnect_msg.header.type = |
878 | htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); | 865 | htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); |
@@ -1112,10 +1099,8 @@ disconnect_all_neighbours (void *cls, const GNUNET_HashCode * key, void *value) | |||
1112 | { | 1099 | { |
1113 | struct NeighbourMapEntry *n = value; | 1100 | struct NeighbourMapEntry *n = value; |
1114 | 1101 | ||
1115 | #if DEBUG_TRANSPORT | ||
1116 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n", | 1102 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n", |
1117 | GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); | 1103 | GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); |
1118 | #endif | ||
1119 | if (S_CONNECTED == n->state) | 1104 | if (S_CONNECTED == n->state) |
1120 | GNUNET_STATISTICS_update (GST_stats, | 1105 | GNUNET_STATISTICS_update (GST_stats, |
1121 | gettext_noop | 1106 | gettext_noop |
@@ -1180,11 +1165,9 @@ send_outbound_quota (const struct GNUNET_PeerIdentity *target, | |||
1180 | { | 1165 | { |
1181 | struct QuotaSetMessage q_msg; | 1166 | struct QuotaSetMessage q_msg; |
1182 | 1167 | ||
1183 | #if DEBUG_TRANSPORT | ||
1184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1168 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1185 | "Sending outbound quota of %u Bps for peer `%s' to all clients\n", | 1169 | "Sending outbound quota of %u Bps for peer `%s' to all clients\n", |
1186 | ntohl (quota.value__), GNUNET_i2s (target)); | 1170 | ntohl (quota.value__), GNUNET_i2s (target)); |
1187 | #endif | ||
1188 | q_msg.header.size = htons (sizeof (struct QuotaSetMessage)); | 1171 | q_msg.header.size = htons (sizeof (struct QuotaSetMessage)); |
1189 | q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); | 1172 | q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); |
1190 | q_msg.quota = quota; | 1173 | q_msg.quota = quota; |
@@ -1232,11 +1215,9 @@ send_connect_continuation (void *cls, const struct GNUNET_PeerIdentity *target, | |||
1232 | if ((GNUNET_NO == success) && | 1215 | if ((GNUNET_NO == success) && |
1233 | ((n->state == S_NOT_CONNECTED) || (n->state == S_CONNECT_SENT))) | 1216 | ((n->state == S_NOT_CONNECTED) || (n->state == S_CONNECT_SENT))) |
1234 | { | 1217 | { |
1235 | #if DEBUG_TRANSPORT | ||
1236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1218 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1237 | "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %p, asking ATS for new address \n", | 1219 | "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %p, asking ATS for new address \n", |
1238 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); | 1220 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); |
1239 | #endif | ||
1240 | change_state (n, S_NOT_CONNECTED); | 1221 | change_state (n, S_NOT_CONNECTED); |
1241 | if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) | 1222 | if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) |
1242 | GNUNET_SCHEDULER_cancel (n->ats_suggest); | 1223 | GNUNET_SCHEDULER_cancel (n->ats_suggest); |
@@ -1350,11 +1331,9 @@ send_switch_address_continuation (void *cls, | |||
1350 | } | 1331 | } |
1351 | break; | 1332 | break; |
1352 | case S_FAST_RECONNECT: | 1333 | case S_FAST_RECONNECT: |
1353 | #if DEBUG_TRANSPORT | ||
1354 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1355 | "Successful fast reconnect to peer `%s'\n", | 1335 | "Successful fast reconnect to peer `%s'\n", |
1356 | GNUNET_i2s (&n->id)); | 1336 | GNUNET_i2s (&n->id)); |
1357 | #endif | ||
1358 | change_state (n, S_CONNECTED); | 1337 | change_state (n, S_CONNECTED); |
1359 | neighbours_connected++; | 1338 | neighbours_connected++; |
1360 | GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, | 1339 | GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, |
@@ -1424,11 +1403,9 @@ send_connect_ack_continuation (void *cls, | |||
1424 | } | 1403 | } |
1425 | 1404 | ||
1426 | /* sending failed, ask for next address */ | 1405 | /* sending failed, ask for next address */ |
1427 | #if DEBUG_TRANSPORT | ||
1428 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1406 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1429 | "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %X, asking ATS for new address \n", | 1407 | "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %X, asking ATS for new address \n", |
1430 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); | 1408 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); |
1431 | #endif | ||
1432 | if (n->state != S_NOT_CONNECTED) | 1409 | if (n->state != S_NOT_CONNECTED) |
1433 | change_state (n, S_NOT_CONNECTED); | 1410 | change_state (n, S_NOT_CONNECTED); |
1434 | GNUNET_assert (strlen (cc->address->transport_name) > 0); | 1411 | GNUNET_assert (strlen (cc->address->transport_name) > 0); |
@@ -1763,10 +1740,8 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer) | |||
1763 | { | 1740 | { |
1764 | struct NeighbourMapEntry *n; | 1741 | struct NeighbourMapEntry *n; |
1765 | 1742 | ||
1766 | #if DEBUG_TRANSPORT | ||
1767 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1743 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1768 | "Unknown peer `%s', creating new neighbour\n", GNUNET_i2s (peer)); | 1744 | "Unknown peer `%s', creating new neighbour\n", GNUNET_i2s (peer)); |
1769 | #endif | ||
1770 | n = GNUNET_malloc (sizeof (struct NeighbourMapEntry)); | 1745 | n = GNUNET_malloc (sizeof (struct NeighbourMapEntry)); |
1771 | n->id = *peer; | 1746 | n->id = *peer; |
1772 | n->state = S_NOT_CONNECTED; | 1747 | n->state = S_NOT_CONNECTED; |
@@ -1800,10 +1775,8 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) | |||
1800 | { | 1775 | { |
1801 | return; | 1776 | return; |
1802 | } | 1777 | } |
1803 | #if DEBUG_TRANSPORT | ||
1804 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to peer `%s'\n", | 1778 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to peer `%s'\n", |
1805 | GNUNET_i2s (target)); | 1779 | GNUNET_i2s (target)); |
1806 | #endif | ||
1807 | if (0 == | 1780 | if (0 == |
1808 | memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity))) | 1781 | memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity))) |
1809 | { | 1782 | { |
@@ -1823,12 +1796,9 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) | |||
1823 | 1796 | ||
1824 | if (n == NULL) | 1797 | if (n == NULL) |
1825 | n = setup_neighbour (target); | 1798 | n = setup_neighbour (target); |
1826 | #if DEBUG_TRANSPORT | ||
1827 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1799 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1828 | "Asking ATS for suggested address to connect to peer `%s'\n", | 1800 | "Asking ATS for suggested address to connect to peer `%s'\n", |
1829 | GNUNET_i2s (&n->id)); | 1801 | GNUNET_i2s (&n->id)); |
1830 | #endif | ||
1831 | |||
1832 | GNUNET_ATS_suggest_address (GST_ats, &n->id); | 1802 | GNUNET_ATS_suggest_address (GST_ats, &n->id); |
1833 | } | 1803 | } |
1834 | 1804 | ||
@@ -1873,12 +1843,8 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
1873 | /* This can happen during shutdown */ | 1843 | /* This can happen during shutdown */ |
1874 | return; | 1844 | return; |
1875 | } | 1845 | } |
1876 | |||
1877 | #if DEBUG_TRANSPORT | ||
1878 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", | 1846 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", |
1879 | session, GNUNET_i2s (peer)); | 1847 | session, GNUNET_i2s (peer)); |
1880 | #endif | ||
1881 | |||
1882 | n = lookup_neighbour (peer); | 1848 | n = lookup_neighbour (peer); |
1883 | if (NULL == n) | 1849 | if (NULL == n) |
1884 | return; | 1850 | return; |
@@ -1974,7 +1940,6 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, | |||
1974 | gettext_noop | 1940 | gettext_noop |
1975 | ("# messages not sent (no such peer or not connected)"), | 1941 | ("# messages not sent (no such peer or not connected)"), |
1976 | 1, GNUNET_NO); | 1942 | 1, GNUNET_NO); |
1977 | #if DEBUG_TRANSPORT | ||
1978 | if (n == NULL) | 1943 | if (n == NULL) |
1979 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1980 | "Could not send message to peer `%s': unknown neighbour", | 1945 | "Could not send message to peer `%s': unknown neighbour", |
@@ -1983,7 +1948,6 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, | |||
1983 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1948 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1984 | "Could not send message to peer `%s': not connected\n", | 1949 | "Could not send message to peer `%s': not connected\n", |
1985 | GNUNET_i2s (target)); | 1950 | GNUNET_i2s (target)); |
1986 | #endif | ||
1987 | if (NULL != cont) | 1951 | if (NULL != cont) |
1988 | cont (cont_cls, GNUNET_SYSERR); | 1952 | cont (cont_cls, GNUNET_SYSERR); |
1989 | return; | 1953 | return; |
@@ -1995,12 +1959,9 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, | |||
1995 | gettext_noop | 1959 | gettext_noop |
1996 | ("# messages not sent (no such peer or not connected)"), | 1960 | ("# messages not sent (no such peer or not connected)"), |
1997 | 1, GNUNET_NO); | 1961 | 1, GNUNET_NO); |
1998 | #if DEBUG_TRANSPORT | ||
1999 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1962 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2000 | "Could not send message to peer `%s': no address available\n", | 1963 | "Could not send message to peer `%s': no address available\n", |
2001 | GNUNET_i2s (target)); | 1964 | GNUNET_i2s (target)); |
2002 | #endif | ||
2003 | |||
2004 | if (NULL != cont) | 1965 | if (NULL != cont) |
2005 | cont (cont_cls, GNUNET_SYSERR); | 1966 | cont (cont_cls, GNUNET_SYSERR); |
2006 | return; | 1967 | return; |
@@ -2075,12 +2036,10 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | |||
2075 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size)) | 2036 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size)) |
2076 | { | 2037 | { |
2077 | n->quota_violation_count++; | 2038 | n->quota_violation_count++; |
2078 | #if DEBUG_TRANSPORT | ||
2079 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2039 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2080 | "Bandwidth quota (%u b/s) violation detected (total of %u).\n", | 2040 | "Bandwidth quota (%u b/s) violation detected (total of %u).\n", |
2081 | n->in_tracker.available_bytes_per_s__, | 2041 | n->in_tracker.available_bytes_per_s__, |
2082 | n->quota_violation_count); | 2042 | n->quota_violation_count); |
2083 | #endif | ||
2084 | /* Discount 32k per violation */ | 2043 | /* Discount 32k per violation */ |
2085 | GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, -32 * 1024); | 2044 | GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, -32 * 1024); |
2086 | } | 2045 | } |
@@ -2106,14 +2065,12 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | |||
2106 | ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 32 * 1024); | 2065 | ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 32 * 1024); |
2107 | if (ret.rel_value > 0) | 2066 | if (ret.rel_value > 0) |
2108 | { | 2067 | { |
2109 | #if DEBUG_TRANSPORT | ||
2110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2068 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2111 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", | 2069 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", |
2112 | (unsigned long long) n->in_tracker. | 2070 | (unsigned long long) n->in_tracker. |
2113 | consumption_since_last_update__, | 2071 | consumption_since_last_update__, |
2114 | (unsigned int) n->in_tracker.available_bytes_per_s__, | 2072 | (unsigned int) n->in_tracker.available_bytes_per_s__, |
2115 | (unsigned long long) ret.rel_value); | 2073 | (unsigned long long) ret.rel_value); |
2116 | #endif | ||
2117 | GNUNET_STATISTICS_update (GST_stats, | 2074 | GNUNET_STATISTICS_update (GST_stats, |
2118 | gettext_noop ("# ms throttling suggested"), | 2075 | gettext_noop ("# ms throttling suggested"), |
2119 | (int64_t) ret.rel_value, GNUNET_NO); | 2076 | (int64_t) ret.rel_value, GNUNET_NO); |
@@ -2216,11 +2173,8 @@ GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour, | |||
2216 | n->latency = | 2173 | n->latency = |
2217 | GNUNET_TIME_absolute_get_difference (n->keep_alive_sent, | 2174 | GNUNET_TIME_absolute_get_difference (n->keep_alive_sent, |
2218 | GNUNET_TIME_absolute_get ()); | 2175 | GNUNET_TIME_absolute_get ()); |
2219 | #if DEBUG_TRANSPORT | ||
2220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Latency for peer `%s' is %llu ms\n", | 2176 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Latency for peer `%s' is %llu ms\n", |
2221 | GNUNET_i2s (&n->id), n->latency.rel_value); | 2177 | GNUNET_i2s (&n->id), n->latency.rel_value); |
2222 | #endif | ||
2223 | |||
2224 | 2178 | ||
2225 | if (n->latency.rel_value == GNUNET_TIME_relative_get_forever ().rel_value) | 2179 | if (n->latency.rel_value == GNUNET_TIME_relative_get_forever ().rel_value) |
2226 | { | 2180 | { |
@@ -2275,18 +2229,14 @@ GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, | |||
2275 | 1, GNUNET_NO); | 2229 | 1, GNUNET_NO); |
2276 | return; | 2230 | return; |
2277 | } | 2231 | } |
2278 | #if DEBUG_TRANSPORT | ||
2279 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2280 | "Setting inbound quota of %u Bps for peer `%s' to all clients\n", | 2233 | "Setting inbound quota of %u Bps for peer `%s' to all clients\n", |
2281 | ntohl (quota.value__), GNUNET_i2s (&n->id)); | 2234 | ntohl (quota.value__), GNUNET_i2s (&n->id)); |
2282 | #endif | ||
2283 | GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, quota); | 2235 | GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, quota); |
2284 | if (0 != ntohl (quota.value__)) | 2236 | if (0 != ntohl (quota.value__)) |
2285 | return; | 2237 | return; |
2286 | #if DEBUG_TRANSPORT | ||
2287 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n", | 2238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n", |
2288 | GNUNET_i2s (&n->id), "SET_QUOTA"); | 2239 | GNUNET_i2s (&n->id), "SET_QUOTA"); |
2289 | #endif | ||
2290 | if (is_connected (n)) | 2240 | if (is_connected (n)) |
2291 | GNUNET_STATISTICS_update (GST_stats, | 2241 | GNUNET_STATISTICS_update (GST_stats, |
2292 | gettext_noop ("# disconnects due to quota of 0"), | 2242 | gettext_noop ("# disconnects due to quota of 0"), |
@@ -2396,12 +2346,9 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity | |||
2396 | const struct SessionDisconnectMessage *sdm; | 2346 | const struct SessionDisconnectMessage *sdm; |
2397 | GNUNET_HashCode hc; | 2347 | GNUNET_HashCode hc; |
2398 | 2348 | ||
2399 | #if DEBUG_TRANSPORT | ||
2400 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2349 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2401 | "Received DISCONNECT message from peer `%s'\n", | 2350 | "Received DISCONNECT message from peer `%s'\n", |
2402 | GNUNET_i2s (peer)); | 2351 | GNUNET_i2s (peer)); |
2403 | #endif | ||
2404 | |||
2405 | if (ntohs (msg->size) != sizeof (struct SessionDisconnectMessage)) | 2352 | if (ntohs (msg->size) != sizeof (struct SessionDisconnectMessage)) |
2406 | { | 2353 | { |
2407 | // GNUNET_break_op (0); | 2354 | // GNUNET_break_op (0); |
@@ -2585,12 +2532,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
2585 | neighbours_connected++; | 2532 | neighbours_connected++; |
2586 | GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, | 2533 | GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, |
2587 | GNUNET_NO); | 2534 | GNUNET_NO); |
2588 | #if DEBUG_TRANSPORT | ||
2589 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2535 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2590 | "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", | 2536 | "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", |
2591 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, | 2537 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, |
2592 | __LINE__); | 2538 | __LINE__); |
2593 | #endif | ||
2594 | connect_notify_cb (callback_cls, &n->id, ats, ats_count); | 2539 | connect_notify_cb (callback_cls, &n->id, ats, ats_count); |
2595 | send_outbound_quota (peer, n->bandwidth_out); | 2540 | send_outbound_quota (peer, n->bandwidth_out); |
2596 | 2541 | ||
@@ -2607,11 +2552,8 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
2607 | { | 2552 | { |
2608 | struct NeighbourMapEntry *n; | 2553 | struct NeighbourMapEntry *n; |
2609 | 2554 | ||
2610 | #if DEBUG_TRANSPORT | ||
2611 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ACK message from peer `%s'\n", | 2555 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ACK message from peer `%s'\n", |
2612 | GNUNET_i2s (peer)); | 2556 | GNUNET_i2s (peer)); |
2613 | #endif | ||
2614 | |||
2615 | if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) | 2557 | if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) |
2616 | { | 2558 | { |
2617 | GNUNET_break_op (0); | 2559 | GNUNET_break_op (0); |
@@ -2656,12 +2598,10 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | |||
2656 | GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in); | 2598 | GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in); |
2657 | if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK) | 2599 | if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK) |
2658 | n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, n); | 2600 | n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, n); |
2659 | #if DEBUG_TRANSPORT | ||
2660 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2601 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2661 | "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", | 2602 | "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", |
2662 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, | 2603 | GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, |
2663 | __LINE__); | 2604 | __LINE__); |
2664 | #endif | ||
2665 | connect_notify_cb (callback_cls, &n->id, ats, ats_count); | 2605 | connect_notify_cb (callback_cls, &n->id, ats, ats_count); |
2666 | send_outbound_quota (peer, n->bandwidth_out); | 2606 | send_outbound_quota (peer, n->bandwidth_out); |
2667 | } | 2607 | } |
@@ -2688,13 +2628,10 @@ handle_connect_blacklist_cont (void *cls, | |||
2688 | struct NeighbourMapEntry *n; | 2628 | struct NeighbourMapEntry *n; |
2689 | struct BlackListCheckContext *bcc = cls; | 2629 | struct BlackListCheckContext *bcc = cls; |
2690 | 2630 | ||
2691 | #if DEBUG_TRANSPORT | ||
2692 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2631 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2693 | "Blacklist check due to CONNECT message: `%s'\n", | 2632 | "Blacklist check due to CONNECT message: `%s'\n", |
2694 | GNUNET_i2s (peer), | 2633 | GNUNET_i2s (peer), |
2695 | (result == GNUNET_OK) ? "ALLOWED" : "FORBIDDEN"); | 2634 | (result == GNUNET_OK) ? "ALLOWED" : "FORBIDDEN"); |
2696 | #endif | ||
2697 | |||
2698 | /* not allowed */ | 2635 | /* not allowed */ |
2699 | if (GNUNET_OK != result) | 2636 | if (GNUNET_OK != result) |
2700 | { | 2637 | { |
@@ -2762,11 +2699,8 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
2762 | struct BlackListCheckContext *bcc = NULL; | 2699 | struct BlackListCheckContext *bcc = NULL; |
2763 | struct NeighbourMapEntry *n; | 2700 | struct NeighbourMapEntry *n; |
2764 | 2701 | ||
2765 | #if DEBUG_TRANSPORT | ||
2766 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2702 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2767 | "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer)); | 2703 | "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer)); |
2768 | #endif | ||
2769 | |||
2770 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) | 2704 | if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) |
2771 | { | 2705 | { |
2772 | GNUNET_break_op (0); | 2706 | GNUNET_break_op (0); |