diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-03-08 14:37:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-03-08 14:37:14 +0000 |
commit | e8d66b6a3b705cc70db7d2f66d8d04f8cc454e3f (patch) | |
tree | 2bf9ae14c5677ca1cd91a27a4003bc9f2190ec28 /src/transport/transport_api.c | |
parent | 1df2d4e1f694fc99863ed431adea24fa22fe12c1 (diff) | |
download | gnunet-e8d66b6a3b705cc70db7d2f66d8d04f8cc454e3f.tar.gz gnunet-e8d66b6a3b705cc70db7d2f66d8d04f8cc454e3f.zip |
nodeb
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 7328dc95d..80eda9935 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -829,15 +829,31 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, | |||
829 | n = neighbour_find (handle, target); | 829 | n = neighbour_find (handle, target); |
830 | if (n != NULL) | 830 | if (n != NULL) |
831 | { | 831 | { |
832 | #if DEBUG_TRANSPORT | ||
832 | if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__) | 833 | if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__) |
833 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
834 | "Quota changed from %u to %u for peer `%s'\n", | 835 | "Quota changed from %u to %u for peer `%s'\n", |
835 | (unsigned int) n->out_tracker.available_bytes_per_s__, | 836 | (unsigned int) n->out_tracker.available_bytes_per_s__, |
836 | (unsigned int) ntohl (quota_out.value__), | 837 | (unsigned int) ntohl (quota_out.value__), |
837 | GNUNET_i2s (target)); | 838 | GNUNET_i2s (target)); |
839 | else | ||
840 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
841 | "Quota remains at %u for peer `%s'\n", | ||
842 | (unsigned int) n->out_tracker.available_bytes_per_s__, | ||
843 | GNUNET_i2s (target)); | ||
844 | #endif | ||
838 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, | 845 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, |
839 | quota_out); | 846 | quota_out); |
840 | } | 847 | } |
848 | else | ||
849 | { | ||
850 | #if DEBUG_TRANSPORT | ||
851 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
852 | "Quota changed to %u for peer `%s', but I have no such neighbour!\n", | ||
853 | (unsigned int) ntohl (quota_out.value__), | ||
854 | GNUNET_i2s (target)); | ||
855 | #endif | ||
856 | } | ||
841 | sqc = GNUNET_malloc (sizeof (struct SetQuotaContext)); | 857 | sqc = GNUNET_malloc (sizeof (struct SetQuotaContext)); |
842 | sqc->handle = handle; | 858 | sqc->handle = handle; |
843 | sqc->target = *target; | 859 | sqc->target = *target; |
@@ -1108,7 +1124,8 @@ reconnect (void *cls, | |||
1108 | while (NULL != n) | 1124 | while (NULL != n) |
1109 | { | 1125 | { |
1110 | #if DEBUG_TRANSPORT_DISCONNECT | 1126 | #if DEBUG_TRANSPORT_DISCONNECT |
1111 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting due to reconnect being called\n"); | 1127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1128 | "Disconnecting due to reconnect being called\n"); | ||
1112 | #endif | 1129 | #endif |
1113 | next = n->next; | 1130 | next = n->next; |
1114 | if (n->is_connected) | 1131 | if (n->is_connected) |
@@ -1116,7 +1133,8 @@ reconnect (void *cls, | |||
1116 | n = next; | 1133 | n = next; |
1117 | } | 1134 | } |
1118 | #if DEBUG_TRANSPORT | 1135 | #if DEBUG_TRANSPORT |
1119 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); | 1136 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1137 | "Connecting to transport service.\n"); | ||
1120 | #endif | 1138 | #endif |
1121 | GNUNET_assert (h->client == NULL); | 1139 | GNUNET_assert (h->client == NULL); |
1122 | h->client = GNUNET_CLIENT_connect (h->sched, "transport", h->cfg); | 1140 | h->client = GNUNET_CLIENT_connect (h->sched, "transport", h->cfg); |