diff options
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 14 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_hello.c | 14 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 66 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 8 | ||||
-rw-r--r-- | src/transport/plugin_transport_http.c | 20 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 9 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp_broadcasting.c | 14 | ||||
-rw-r--r-- | src/transport/transport.h | 5 | ||||
-rw-r--r-- | src/transport/transport_api.c | 52 |
9 files changed, 6 insertions, 196 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index bf43008bb..679d52937 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -230,32 +230,24 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
230 | if (NULL == message) | 230 | if (NULL == message) |
231 | goto end; | 231 | goto end; |
232 | type = ntohs (message->type); | 232 | type = ntohs (message->type); |
233 | #if DEBUG_TRANSPORT | ||
234 | |||
235 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type); | 233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type); |
236 | #endif | ||
237 | |||
238 | switch (type) | 234 | switch (type) |
239 | { | 235 | { |
240 | case GNUNET_MESSAGE_TYPE_HELLO: | 236 | case GNUNET_MESSAGE_TYPE_HELLO: |
241 | GST_validation_handle_hello (message); | 237 | GST_validation_handle_hello (message); |
242 | return ret; | 238 | return ret; |
243 | case GNUNET_MESSAGE_TYPE_TRANSPORT_PING: | 239 | case GNUNET_MESSAGE_TYPE_TRANSPORT_PING: |
244 | #if DEBUG_TRANSPORT | ||
245 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 240 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
246 | "Processing `%s' from `%s'\n", "PING", | 241 | "Processing `%s' from `%s'\n", "PING", |
247 | (sender_address != | 242 | (sender_address != |
248 | NULL) ? GST_plugins_a2s (&address) : "<inbound>"); | 243 | NULL) ? GST_plugins_a2s (&address) : "<inbound>"); |
249 | #endif | ||
250 | GST_validation_handle_ping (peer, message, &address, session); | 244 | GST_validation_handle_ping (peer, message, &address, session); |
251 | break; | 245 | break; |
252 | case GNUNET_MESSAGE_TYPE_TRANSPORT_PONG: | 246 | case GNUNET_MESSAGE_TYPE_TRANSPORT_PONG: |
253 | #if DEBUG_TRANSPORT | ||
254 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 247 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
255 | "Processing `%s' from `%s'\n", "PONG", | 248 | "Processing `%s' from `%s'\n", "PONG", |
256 | (sender_address != | 249 | (sender_address != |
257 | NULL) ? GST_plugins_a2s (&address) : "<inbound>"); | 250 | NULL) ? GST_plugins_a2s (&address) : "<inbound>"); |
258 | #endif | ||
259 | GST_validation_handle_pong (peer, message); | 251 | GST_validation_handle_pong (peer, message); |
260 | break; | 252 | break; |
261 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT: | 253 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT: |
@@ -290,11 +282,9 @@ end: | |||
290 | * this connections seem to go extra-slow */ | 282 | * this connections seem to go extra-slow */ |
291 | GNUNET_ATS_address_update (GST_ats, &address, session, ats, ats_count); | 283 | GNUNET_ATS_address_update (GST_ats, &address, session, ats, ats_count); |
292 | #endif | 284 | #endif |
293 | #if DEBUG_TRANSPORT | ||
294 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 285 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
295 | "Allowing receive from peer %s to continue in %llu ms\n", | 286 | "Allowing receive from peer %s to continue in %llu ms\n", |
296 | GNUNET_i2s (peer), (unsigned long long) ret.rel_value); | 287 | GNUNET_i2s (peer), (unsigned long long) ret.rel_value); |
297 | #endif | ||
298 | return ret; | 288 | return ret; |
299 | } | 289 | } |
300 | 290 | ||
@@ -346,10 +336,8 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
346 | struct GNUNET_HELLO_Address address; | 336 | struct GNUNET_HELLO_Address address; |
347 | 337 | ||
348 | GNUNET_assert (strlen (transport_name) > 0); | 338 | GNUNET_assert (strlen (transport_name) > 0); |
349 | #if DEBUG_TRANSPORT | ||
350 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", | 339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", |
351 | session, GNUNET_i2s (peer)); | 340 | session, GNUNET_i2s (peer)); |
352 | #endif | ||
353 | if (NULL != session) | 341 | if (NULL != session) |
354 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 342 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
355 | "transport-ats", | 343 | "transport-ats", |
@@ -430,11 +418,9 @@ ats_request_address_change (void *cls, | |||
430 | /* ATS tells me to disconnect from peer */ | 418 | /* ATS tells me to disconnect from peer */ |
431 | if ((bw_in == 0) && (bw_out == 0)) | 419 | if ((bw_in == 0) && (bw_out == 0)) |
432 | { | 420 | { |
433 | #if DEBUG_TRANSPORT | ||
434 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 421 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
435 | "ATS tells me to disconnect from peer `%s'\n", | 422 | "ATS tells me to disconnect from peer `%s'\n", |
436 | GNUNET_i2s (&address->peer)); | 423 | GNUNET_i2s (&address->peer)); |
437 | #endif | ||
438 | GST_neighbours_force_disconnect (&address->peer); | 424 | GST_neighbours_force_disconnect (&address->peer); |
439 | return; | 425 | return; |
440 | } | 426 | } |
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c index 3838c511a..870c083d2 100644 --- a/src/transport/gnunet-service-transport_hello.c +++ b/src/transport/gnunet-service-transport_hello.c | |||
@@ -166,13 +166,9 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
166 | GNUNET_free (our_hello); | 166 | GNUNET_free (our_hello); |
167 | our_hello = GNUNET_HELLO_create (&GST_my_public_key, &address_generator, &gc); | 167 | our_hello = GNUNET_HELLO_create (&GST_my_public_key, &address_generator, &gc); |
168 | GNUNET_assert (NULL != our_hello); | 168 | GNUNET_assert (NULL != our_hello); |
169 | |||
170 | #if DEBUG_TRANSPORT | ||
171 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
172 | "Refreshed my `%s', new size is %d\n", "HELLO", | 170 | "Refreshed my `%s', new size is %d\n", "HELLO", |
173 | GNUNET_HELLO_size (our_hello)); | 171 | GNUNET_HELLO_size (our_hello)); |
174 | #endif | ||
175 | |||
176 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# refreshed my HELLO"), 1, | 172 | GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# refreshed my HELLO"), 1, |
177 | GNUNET_NO); | 173 | GNUNET_NO); |
178 | if (NULL != hello_cb) | 174 | if (NULL != hello_cb) |
@@ -260,13 +256,11 @@ GST_hello_modify_addresses (int addremove, | |||
260 | { | 256 | { |
261 | struct OwnAddressList *al; | 257 | struct OwnAddressList *al; |
262 | 258 | ||
263 | #if DEBUG_TRANSPORT | ||
264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 259 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
265 | (add_remove == | 260 | (addremove == |
266 | GNUNET_YES) ? "Adding `%s':%s to the set of our addresses\n" : | 261 | GNUNET_YES) ? "Adding `%s' to the set of our addresses\n" : |
267 | "Removing `%s':%s from the set of our addresses\n", | 262 | "Removing `%s' from the set of our addresses\n", |
268 | GST_plugins_a2s (address), p->short_name); | 263 | GST_plugins_a2s (address)); |
269 | #endif | ||
270 | GNUNET_assert (address != NULL); | 264 | GNUNET_assert (address != NULL); |
271 | if (GNUNET_NO == addremove) | 265 | if (GNUNET_NO == addremove) |
272 | { | 266 | { |
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); |
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 75ff4eb6f..ff786079f 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -870,10 +870,8 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
870 | PONG_SIGNATURE_LIFETIME.rel_value / 4) | 870 | PONG_SIGNATURE_LIFETIME.rel_value / 4) |
871 | { | 871 | { |
872 | /* create / update cached sig */ | 872 | /* create / update cached sig */ |
873 | #if DEBUG_TRANSPORT | ||
874 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 873 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
875 | "Creating PONG signature to indicate ownership.\n"); | 874 | "Creating PONG signature to indicate ownership.\n"); |
876 | #endif | ||
877 | *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME); | 875 | *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME); |
878 | pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp); | 876 | pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp); |
879 | GNUNET_assert (GNUNET_OK == | 877 | GNUNET_assert (GNUNET_OK == |
@@ -1083,13 +1081,9 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | |||
1083 | GNUNET_NO); | 1081 | GNUNET_NO); |
1084 | return; | 1082 | return; |
1085 | } | 1083 | } |
1086 | #if DEBUG_TRANSPORT | ||
1087 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1084 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1088 | "Address validated for peer `%s' with plugin `%s': `%s'\n", | 1085 | "Address validated for peer `%s' with plugin `%s': `%s'\n", |
1089 | GNUNET_i2s (sender), tname, GST_plugins_a2s (tname, addr, | 1086 | GNUNET_i2s (sender), tname, GST_plugins_a2s (&address)); |
1090 | addrlen)); | ||
1091 | #endif | ||
1092 | |||
1093 | /* validity achieved, remember it! */ | 1087 | /* validity achieved, remember it! */ |
1094 | ve->expecting_pong = GNUNET_NO; | 1088 | ve->expecting_pong = GNUNET_NO; |
1095 | ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); | 1089 | ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); |
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 48db6a372..4f9279495 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -786,23 +786,17 @@ http_plugin_send (void *cls, | |||
786 | 786 | ||
787 | if (session->inbound == GNUNET_NO) | 787 | if (session->inbound == GNUNET_NO) |
788 | { | 788 | { |
789 | #if DEBUG_HTTP | ||
790 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 789 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
791 | "Using outbound client session %p to send to `%s'\n", session, | 790 | "Using outbound client session %p to send to `%s'\n", session, |
792 | GNUNET_i2s (&session->target)); | 791 | GNUNET_i2s (&session->target)); |
793 | #endif | ||
794 | |||
795 | client_send (session, msg); | 792 | client_send (session, msg); |
796 | res = msgbuf_size; | 793 | res = msgbuf_size; |
797 | } | 794 | } |
798 | if (session->inbound == GNUNET_YES) | 795 | if (session->inbound == GNUNET_YES) |
799 | { | 796 | { |
800 | #if DEBUG_HTTP | ||
801 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 797 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
802 | "Using inbound server %p session to send to `%s'\n", session, | 798 | "Using inbound server %p session to send to `%s'\n", session, |
803 | GNUNET_i2s (&session->target)); | 799 | GNUNET_i2s (&session->target)); |
804 | #endif | ||
805 | |||
806 | server_send (session, msg); | 800 | server_send (session, msg); |
807 | res = msgbuf_size; | 801 | res = msgbuf_size; |
808 | } | 802 | } |
@@ -1556,11 +1550,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
1556 | /* Report addresses to transport service */ | 1550 | /* Report addresses to transport service */ |
1557 | start_report_addresses (plugin); | 1551 | start_report_addresses (plugin); |
1558 | 1552 | ||
1559 | #if DEBUG_HTTP | ||
1560 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1553 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1561 | "Plugin `%s' loaded\n", plugin->name); | 1554 | "Plugin `%s' loaded\n", plugin->name); |
1562 | #endif | ||
1563 | |||
1564 | return api; | 1555 | return api; |
1565 | } | 1556 | } |
1566 | 1557 | ||
@@ -1588,10 +1579,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
1588 | s = plugin->head; | 1579 | s = plugin->head; |
1589 | while (s != NULL) | 1580 | while (s != NULL) |
1590 | { | 1581 | { |
1591 | #if DEBUG_HTTP | ||
1592 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1582 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1593 | "Disconnecting `%s' \n", GNUNET_i2s (&s->target)); | 1583 | "Disconnecting `%s' \n", GNUNET_i2s (&s->target)); |
1594 | #endif | ||
1595 | if (s->inbound == GNUNET_NO) | 1584 | if (s->inbound == GNUNET_NO) |
1596 | GNUNET_assert (GNUNET_OK == client_disconnect (s)); | 1585 | GNUNET_assert (GNUNET_OK == client_disconnect (s)); |
1597 | else | 1586 | else |
@@ -1599,15 +1588,11 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
1599 | s = s->next; | 1588 | s = s->next; |
1600 | } | 1589 | } |
1601 | 1590 | ||
1602 | #if DEBUG_HTTP | ||
1603 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping server\n"); | 1591 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping server\n"); |
1604 | #endif | ||
1605 | /* Stop server */ | 1592 | /* Stop server */ |
1606 | server_stop (plugin); | 1593 | server_stop (plugin); |
1607 | 1594 | ||
1608 | #if DEBUG_HTTP | ||
1609 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping client\n"); | 1595 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping client\n"); |
1610 | #endif | ||
1611 | /* Stop client */ | 1596 | /* Stop client */ |
1612 | client_stop (plugin); | 1597 | client_stop (plugin); |
1613 | 1598 | ||
@@ -1639,17 +1624,12 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
1639 | s = t; | 1624 | s = t; |
1640 | } | 1625 | } |
1641 | 1626 | ||
1642 | |||
1643 | #if DEBUG_HTTP | ||
1644 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1627 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1645 | "Plugin `%s' unloaded\n", plugin->name); | 1628 | "Plugin `%s' unloaded\n", plugin->name); |
1646 | #endif | ||
1647 | |||
1648 | GNUNET_free_non_null (plugin->server_addr_v4); | 1629 | GNUNET_free_non_null (plugin->server_addr_v4); |
1649 | GNUNET_free_non_null (plugin->server_addr_v6); | 1630 | GNUNET_free_non_null (plugin->server_addr_v6); |
1650 | GNUNET_free (plugin); | 1631 | GNUNET_free (plugin); |
1651 | GNUNET_free (api); | 1632 | GNUNET_free (api); |
1652 | |||
1653 | return NULL; | 1633 | return NULL; |
1654 | } | 1634 | } |
1655 | 1635 | ||
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 0a6e0c52c..96b465291 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -229,10 +229,7 @@ server_load_certificate (struct Plugin *plugin) | |||
229 | } | 229 | } |
230 | GNUNET_free (key_file); | 230 | GNUNET_free (key_file); |
231 | GNUNET_free (cert_file); | 231 | GNUNET_free (cert_file); |
232 | #if DEBUG_HTTP | ||
233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TLS certificate loaded\n"); | 232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TLS certificate loaded\n"); |
234 | #endif | ||
235 | |||
236 | return res; | 233 | return res; |
237 | } | 234 | } |
238 | #endif | 235 | #endif |
@@ -1168,13 +1165,9 @@ server_start (struct Plugin *plugin) | |||
1168 | return GNUNET_SYSERR; | 1165 | return GNUNET_SYSERR; |
1169 | } | 1166 | } |
1170 | server_reschedule (plugin, plugin->server_v6, GNUNET_NO); | 1167 | server_reschedule (plugin, plugin->server_v6, GNUNET_NO); |
1171 | |||
1172 | |||
1173 | #if DEBUG_HTTP | ||
1174 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1168 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1175 | "%s server component started on port %u\n", plugin->name, | 1169 | "%s server component started on port %u\n", plugin->name, |
1176 | plugin->port); | 1170 | plugin->port); |
1177 | #endif | ||
1178 | return res; | 1171 | return res; |
1179 | } | 1172 | } |
1180 | 1173 | ||
@@ -1249,10 +1242,8 @@ server_stop (struct Plugin *plugin) | |||
1249 | GNUNET_free_non_null (plugin->key); | 1242 | GNUNET_free_non_null (plugin->key); |
1250 | #endif | 1243 | #endif |
1251 | 1244 | ||
1252 | #if DEBUG_HTTP | ||
1253 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1245 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1254 | "%s server component stopped\n", plugin->name); | 1246 | "%s server component stopped\n", plugin->name); |
1255 | #endif | ||
1256 | } | 1247 | } |
1257 | 1248 | ||
1258 | 1249 | ||
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index d378f2663..623cde2bd 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -105,12 +105,10 @@ broadcast_ipv6_mst_cb (void *cls, void *client, | |||
105 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != | 105 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != |
106 | ntohs (msg->header.type)) | 106 | ntohs (msg->header.type)) |
107 | return; | 107 | return; |
108 | #if DEBUG_UDP_BROADCASTING | ||
109 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 108 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
110 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", | 109 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", |
111 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), | 110 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), |
112 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); | 111 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); |
113 | #endif | ||
114 | struct GNUNET_ATS_Information atsi[2]; | 112 | struct GNUNET_ATS_Information atsi[2]; |
115 | 113 | ||
116 | /* setup ATS */ | 114 | /* setup ATS */ |
@@ -146,12 +144,10 @@ broadcast_ipv4_mst_cb (void *cls, void *client, | |||
146 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != | 144 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != |
147 | ntohs (msg->header.type)) | 145 | ntohs (msg->header.type)) |
148 | return; | 146 | return; |
149 | #if DEBUG_UDP_BROADCASTING | ||
150 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 147 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
151 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", | 148 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", |
152 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), | 149 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), |
153 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); | 150 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); |
154 | #endif | ||
155 | 151 | ||
156 | struct GNUNET_ATS_Information atsi[2]; | 152 | struct GNUNET_ATS_Information atsi[2]; |
157 | 153 | ||
@@ -181,11 +177,9 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st | |||
181 | 177 | ||
182 | if (addrlen == sizeof (struct sockaddr_in)) | 178 | if (addrlen == sizeof (struct sockaddr_in)) |
183 | { | 179 | { |
184 | #if DEBUG_UDP_BROADCASTING | ||
185 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 180 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
186 | "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n", | 181 | "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n", |
187 | size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen)); | 182 | size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen)); |
188 | #endif | ||
189 | struct Mstv4Context *mc; | 183 | struct Mstv4Context *mc; |
190 | 184 | ||
191 | mc = GNUNET_malloc (sizeof (struct Mstv4Context)); | 185 | mc = GNUNET_malloc (sizeof (struct Mstv4Context)); |
@@ -202,11 +196,9 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st | |||
202 | } | 196 | } |
203 | else if (addrlen == sizeof (struct sockaddr_in6)) | 197 | else if (addrlen == sizeof (struct sockaddr_in6)) |
204 | { | 198 | { |
205 | #if DEBUG_UDP_BROADCASTING | ||
206 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 199 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
207 | "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n", | 200 | "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n", |
208 | size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen)); | 201 | size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen)); |
209 | #endif | ||
210 | struct Mstv6Context *mc; | 202 | struct Mstv6Context *mc; |
211 | 203 | ||
212 | mc = GNUNET_malloc (sizeof (struct Mstv6Context)); | 204 | mc = GNUNET_malloc (sizeof (struct Mstv6Context)); |
@@ -329,7 +321,6 @@ iface_proc (void *cls, const char *name, int isDefault, | |||
329 | 321 | ||
330 | if (addr != NULL) | 322 | if (addr != NULL) |
331 | { | 323 | { |
332 | #if DEBUG_UDP_BROADCASTING | ||
333 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "address %s for interface %s %p\n ", | 324 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "address %s for interface %s %p\n ", |
334 | GNUNET_a2s (addr, addrlen), name, addr); | 325 | GNUNET_a2s (addr, addrlen), name, addr); |
335 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 326 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -337,7 +328,6 @@ iface_proc (void *cls, const char *name, int isDefault, | |||
337 | GNUNET_a2s (broadcast_addr, addrlen), name, broadcast_addr); | 328 | GNUNET_a2s (broadcast_addr, addrlen), name, broadcast_addr); |
338 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "netmask %s for interface %s %p\n ", | 329 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "netmask %s for interface %s %p\n ", |
339 | GNUNET_a2s (netmask, addrlen), name, netmask); | 330 | GNUNET_a2s (netmask, addrlen), name, netmask); |
340 | #endif | ||
341 | 331 | ||
342 | /* Collecting broadcast addresses */ | 332 | /* Collecting broadcast addresses */ |
343 | if (broadcast_addr != NULL) | 333 | if (broadcast_addr != NULL) |
@@ -430,9 +420,7 @@ setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struc | |||
430 | } | 420 | } |
431 | else | 421 | else |
432 | { | 422 | { |
433 | #if DEBUG_UDP | ||
434 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 broadcasting running\n"); | 423 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 broadcasting running\n"); |
435 | #endif | ||
436 | plugin->send_ipv6_broadcast_task = | 424 | plugin->send_ipv6_broadcast_task = |
437 | GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin); | 425 | GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin); |
438 | plugin->broadcast_ipv6 = GNUNET_YES; | 426 | plugin->broadcast_ipv6 = GNUNET_YES; |
@@ -483,9 +471,7 @@ stop_broadcast (struct Plugin *plugin) | |||
483 | } | 471 | } |
484 | else | 472 | else |
485 | { | 473 | { |
486 | #if DEBUG_UDP | ||
487 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n"); | 474 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n"); |
488 | #endif | ||
489 | } | 475 | } |
490 | 476 | ||
491 | if (plugin->send_ipv6_broadcast_task != GNUNET_SCHEDULER_NO_TASK) | 477 | if (plugin->send_ipv6_broadcast_task != GNUNET_SCHEDULER_NO_TASK) |
diff --git a/src/transport/transport.h b/src/transport/transport.h index 027720271..e0b881970 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h | |||
@@ -33,11 +33,6 @@ | |||
33 | 33 | ||
34 | #define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING | 34 | #define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING |
35 | 35 | ||
36 | #define DEBUG_TRANSPORT_TIMEOUT GNUNET_EXTRA_LOGGING | ||
37 | |||
38 | #define DEBUG_TRANSPORT_DISCONNECT GNUNET_EXTRA_LOGGING | ||
39 | |||
40 | #define DEBUG_TRANSPORT_API GNUNET_EXTRA_LOGGING | ||
41 | 36 | ||
42 | /** | 37 | /** |
43 | * For how long do we allow unused bandwidth | 38 | * For how long do we allow unused bandwidth |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index e7f2327d9..b97a24596 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -342,10 +342,8 @@ neighbour_add (struct GNUNET_TRANSPORT_Handle *h, | |||
342 | { | 342 | { |
343 | struct Neighbour *n; | 343 | struct Neighbour *n; |
344 | 344 | ||
345 | #if DEBUG_TRANSPORT_API | ||
346 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n", | 345 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n", |
347 | GNUNET_i2s (pid)); | 346 | GNUNET_i2s (pid)); |
348 | #endif | ||
349 | n = GNUNET_malloc (sizeof (struct Neighbour)); | 347 | n = GNUNET_malloc (sizeof (struct Neighbour)); |
350 | n->id = *pid; | 348 | n->id = *pid; |
351 | n->h = h; | 349 | n->h = h; |
@@ -416,10 +414,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
416 | GNUNET_assert (h->client != NULL); | 414 | GNUNET_assert (h->client != NULL); |
417 | if (msg == NULL) | 415 | if (msg == NULL) |
418 | { | 416 | { |
419 | #if DEBUG_TRANSPORT_API | 417 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
420 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
421 | "Error receiving from transport service, disconnecting temporarily.\n"); | 418 | "Error receiving from transport service, disconnecting temporarily.\n"); |
422 | #endif | ||
423 | disconnect_and_schedule_reconnect (h); | 419 | disconnect_and_schedule_reconnect (h); |
424 | return; | 420 | return; |
425 | } | 421 | } |
@@ -435,11 +431,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
435 | GNUNET_break (0); | 431 | GNUNET_break (0); |
436 | break; | 432 | break; |
437 | } | 433 | } |
438 | #if DEBUG_TRANSPORT_API | ||
439 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 434 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
440 | "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO", | 435 | "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO", |
441 | GNUNET_i2s (&me)); | 436 | GNUNET_i2s (&me)); |
442 | #endif | ||
443 | GNUNET_free_non_null (h->my_hello); | 437 | GNUNET_free_non_null (h->my_hello); |
444 | h->my_hello = NULL; | 438 | h->my_hello = NULL; |
445 | if (size < sizeof (struct GNUNET_MessageHeader)) | 439 | if (size < sizeof (struct GNUNET_MessageHeader)) |
@@ -474,10 +468,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
474 | break; | 468 | break; |
475 | } | 469 | } |
476 | ats = (const struct GNUNET_ATS_Information *) &cim[1]; | 470 | ats = (const struct GNUNET_ATS_Information *) &cim[1]; |
477 | #if DEBUG_TRANSPORT_API | ||
478 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", | 471 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", |
479 | "CONNECT", GNUNET_i2s (&cim->id)); | 472 | "CONNECT", GNUNET_i2s (&cim->id)); |
480 | #endif | ||
481 | n = neighbour_find (h, &cim->id); | 473 | n = neighbour_find (h, &cim->id); |
482 | if (n != NULL) | 474 | if (n != NULL) |
483 | { | 475 | { |
@@ -496,10 +488,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
496 | } | 488 | } |
497 | dim = (const struct DisconnectInfoMessage *) msg; | 489 | dim = (const struct DisconnectInfoMessage *) msg; |
498 | GNUNET_break (ntohl (dim->reserved) == 0); | 490 | GNUNET_break (ntohl (dim->reserved) == 0); |
499 | #if DEBUG_TRANSPORT_API_DISCONNECT | ||
500 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", | 491 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", |
501 | "DISCONNECT", GNUNET_i2s (&dim->peer)); | 492 | "DISCONNECT", GNUNET_i2s (&dim->peer)); |
502 | #endif | ||
503 | n = neighbour_find (h, &dim->peer); | 493 | n = neighbour_find (h, &dim->peer); |
504 | if (n == NULL) | 494 | if (n == NULL) |
505 | { | 495 | { |
@@ -515,10 +505,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
515 | break; | 505 | break; |
516 | } | 506 | } |
517 | okm = (const struct SendOkMessage *) msg; | 507 | okm = (const struct SendOkMessage *) msg; |
518 | #if DEBUG_TRANSPORT_API | ||
519 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message, transmission %s.\n", | 508 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message, transmission %s.\n", |
520 | "SEND_OK", ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); | 509 | "SEND_OK", ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); |
521 | #endif | ||
522 | n = neighbour_find (h, &okm->peer); | 510 | n = neighbour_find (h, &okm->peer); |
523 | if (n == NULL) | 511 | if (n == NULL) |
524 | break; | 512 | break; |
@@ -536,9 +524,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
536 | } | 524 | } |
537 | break; | 525 | break; |
538 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: | 526 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: |
539 | #if DEBUG_TRANSPORT_API | ||
540 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV"); | 527 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV"); |
541 | #endif | ||
542 | if (size < | 528 | if (size < |
543 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) | 529 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) |
544 | { | 530 | { |
@@ -555,10 +541,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
555 | GNUNET_break (0); | 541 | GNUNET_break (0); |
556 | break; | 542 | break; |
557 | } | 543 | } |
558 | #if DEBUG_TRANSPORT_API | ||
559 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s'.\n", | 544 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s'.\n", |
560 | ntohs (imm->type), GNUNET_i2s (&im->peer)); | 545 | ntohs (imm->type), GNUNET_i2s (&im->peer)); |
561 | #endif | ||
562 | n = neighbour_find (h, &im->peer); | 546 | n = neighbour_find (h, &im->peer); |
563 | if (n == NULL) | 547 | if (n == NULL) |
564 | { | 548 | { |
@@ -569,9 +553,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
569 | h->rec (h->cls, &im->peer, imm, ats, ats_count); | 553 | h->rec (h->cls, &im->peer, imm, ats, ats_count); |
570 | break; | 554 | break; |
571 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: | 555 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: |
572 | #if DEBUG_TRANSPORT_API | ||
573 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); | 556 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); |
574 | #endif | ||
575 | if (size != sizeof (struct QuotaSetMessage)) | 557 | if (size != sizeof (struct QuotaSetMessage)) |
576 | { | 558 | { |
577 | GNUNET_break (0); | 559 | GNUNET_break (0); |
@@ -653,10 +635,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
653 | { | 635 | { |
654 | GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); | 636 | GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); |
655 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); | 637 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); |
656 | #if DEBUG_TRANSPORT_API | ||
657 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Added %u bytes of control message at %u\n", | 638 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Added %u bytes of control message at %u\n", |
658 | nret, ret); | 639 | nret, ret); |
659 | #endif | ||
660 | GNUNET_free (th); | 640 | GNUNET_free (th); |
661 | ret += nret; | 641 | ret += nret; |
662 | size -= nret; | 642 | size -= nret; |
@@ -714,10 +694,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
714 | } | 694 | } |
715 | /* if there are more pending messages, try to schedule those */ | 695 | /* if there are more pending messages, try to schedule those */ |
716 | schedule_transmission (h); | 696 | schedule_transmission (h); |
717 | #if DEBUG_TRANSPORT_API | ||
718 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to transport service\n", | 697 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to transport service\n", |
719 | ret); | 698 | ret); |
720 | #endif | ||
721 | return ret; | 699 | return ret; |
722 | } | 700 | } |
723 | 701 | ||
@@ -750,11 +728,9 @@ schedule_transmission_task (void *cls, | |||
750 | n->th = NULL; | 728 | n->th = NULL; |
751 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); | 729 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); |
752 | n->hn = NULL; | 730 | n->hn = NULL; |
753 | #if DEBUG_TRANSPORT_API | ||
754 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 731 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
755 | "Signalling timeout for transmission to peer %s due to congestion\n", | 732 | "Signalling timeout for transmission to peer %s due to congestion\n", |
756 | GNUNET_i2s (&n->id)); | 733 | GNUNET_i2s (&n->id)); |
757 | #endif | ||
758 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); | 734 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); |
759 | GNUNET_free (th); | 735 | GNUNET_free (th); |
760 | } | 736 | } |
@@ -771,9 +747,7 @@ schedule_transmission_task (void *cls, | |||
771 | return; /* no pending messages */ | 747 | return; /* no pending messages */ |
772 | size = n->th->notify_size + sizeof (struct OutboundMessage); | 748 | size = n->th->notify_size + sizeof (struct OutboundMessage); |
773 | } | 749 | } |
774 | #if DEBUG_TRANSPORT_API | ||
775 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n"); | 750 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n"); |
776 | #endif | ||
777 | h->cth = | 751 | h->cth = |
778 | GNUNET_CLIENT_notify_transmit_ready (h->client, size, | 752 | GNUNET_CLIENT_notify_transmit_ready (h->client, size, |
779 | GNUNET_TIME_UNIT_FOREVER_REL, | 753 | GNUNET_TIME_UNIT_FOREVER_REL, |
@@ -809,11 +783,9 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h) | |||
809 | n->th->notify_size); | 783 | n->th->notify_size); |
810 | else | 784 | else |
811 | return; /* no work to be done */ | 785 | return; /* no work to be done */ |
812 | #if DEBUG_TRANSPORT_API | ||
813 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 786 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
814 | "Scheduling next transmission to service in %llu ms\n", | 787 | "Scheduling next transmission to service in %llu ms\n", |
815 | (unsigned long long) delay.rel_value); | 788 | (unsigned long long) delay.rel_value); |
816 | #endif | ||
817 | h->quota_task = | 789 | h->quota_task = |
818 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h); | 790 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h); |
819 | } | 791 | } |
@@ -835,10 +807,8 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h, size_t size, | |||
835 | { | 807 | { |
836 | struct GNUNET_TRANSPORT_TransmitHandle *th; | 808 | struct GNUNET_TRANSPORT_TransmitHandle *th; |
837 | 809 | ||
838 | #if DEBUG_TRANSPORT_API | ||
839 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes requested\n", | 810 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes requested\n", |
840 | size); | 811 | size); |
841 | #endif | ||
842 | th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle)); | 812 | th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle)); |
843 | th->notify = notify; | 813 | th->notify = notify; |
844 | th->notify_cls = notify_cls; | 814 | th->notify_cls = notify_cls; |
@@ -866,15 +836,11 @@ send_start (void *cls, size_t size, void *buf) | |||
866 | if (buf == NULL) | 836 | if (buf == NULL) |
867 | { | 837 | { |
868 | /* Can only be shutdown, just give up */ | 838 | /* Can only be shutdown, just give up */ |
869 | #if DEBUG_TRANSPORT_API | ||
870 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 839 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
871 | "Shutdown while trying to transmit `%s' request.\n", "START"); | 840 | "Shutdown while trying to transmit `%s' request.\n", "START"); |
872 | #endif | ||
873 | return 0; | 841 | return 0; |
874 | } | 842 | } |
875 | #if DEBUG_TRANSPORT_API | ||
876 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); | 843 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); |
877 | #endif | ||
878 | GNUNET_assert (size >= sizeof (struct StartMessage)); | 844 | GNUNET_assert (size >= sizeof (struct StartMessage)); |
879 | s.header.size = htons (sizeof (struct StartMessage)); | 845 | s.header.size = htons (sizeof (struct StartMessage)); |
880 | s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); | 846 | s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); |
@@ -909,9 +875,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
909 | /* shutdown, just give up */ | 875 | /* shutdown, just give up */ |
910 | return; | 876 | return; |
911 | } | 877 | } |
912 | #if DEBUG_TRANSPORT_API | ||
913 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); | 878 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); |
914 | #endif | ||
915 | GNUNET_assert (h->client == NULL); | 879 | GNUNET_assert (h->client == NULL); |
916 | GNUNET_assert (h->control_head == NULL); | 880 | GNUNET_assert (h->control_head == NULL); |
917 | GNUNET_assert (h->control_tail == NULL); | 881 | GNUNET_assert (h->control_tail == NULL); |
@@ -956,11 +920,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h) | |||
956 | th->notify (th->notify_cls, 0, NULL); | 920 | th->notify (th->notify_cls, 0, NULL); |
957 | GNUNET_free (th); | 921 | GNUNET_free (th); |
958 | } | 922 | } |
959 | #if DEBUG_TRANSPORT_API | ||
960 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 923 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
961 | "Scheduling task to reconnect to transport service in %llu ms.\n", | 924 | "Scheduling task to reconnect to transport service in %llu ms.\n", |
962 | h->reconnect_delay.rel_value); | 925 | h->reconnect_delay.rel_value); |
963 | #endif | ||
964 | h->reconnect_task = | 926 | h->reconnect_task = |
965 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); | 927 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); |
966 | if (h->reconnect_delay.rel_value == 0) | 928 | if (h->reconnect_delay.rel_value == 0) |
@@ -995,11 +957,9 @@ send_try_connect (void *cls, size_t size, void *buf) | |||
995 | GNUNET_free (pid); | 957 | GNUNET_free (pid); |
996 | return 0; | 958 | return 0; |
997 | } | 959 | } |
998 | #if DEBUG_TRANSPORT_API | ||
999 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 960 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1000 | "Transmitting `%s' request with respect to `%4s'.\n", "REQUEST_CONNECT", | 961 | "Transmitting `%s' request with respect to `%4s'.\n", "REQUEST_CONNECT", |
1001 | GNUNET_i2s (pid)); | 962 | GNUNET_i2s (pid)); |
1002 | #endif | ||
1003 | GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage)); | 963 | GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage)); |
1004 | msg.header.size = htons (sizeof (struct TransportRequestConnectMessage)); | 964 | msg.header.size = htons (sizeof (struct TransportRequestConnectMessage)); |
1005 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT); | 965 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT); |
@@ -1050,16 +1010,12 @@ send_hello (void *cls, size_t size, void *buf) | |||
1050 | 1010 | ||
1051 | if (buf == NULL) | 1011 | if (buf == NULL) |
1052 | { | 1012 | { |
1053 | #if DEBUG_TRANSPORT_TIMEOUT | ||
1054 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1013 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1055 | "Timeout while trying to transmit `%s' request.\n", "HELLO"); | 1014 | "Timeout while trying to transmit `%s' request.\n", "HELLO"); |
1056 | #endif | ||
1057 | GNUNET_free (msg); | 1015 | GNUNET_free (msg); |
1058 | return 0; | 1016 | return 0; |
1059 | } | 1017 | } |
1060 | #if DEBUG_TRANSPORT_API | ||
1061 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO"); | 1018 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO"); |
1062 | #endif | ||
1063 | ssize = ntohs (msg->size); | 1019 | ssize = ntohs (msg->size); |
1064 | GNUNET_assert (size >= ssize); | 1020 | GNUNET_assert (size >= ssize); |
1065 | memcpy (buf, msg, ssize); | 1021 | memcpy (buf, msg, ssize); |
@@ -1101,11 +1057,9 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
1101 | } | 1057 | } |
1102 | msg = GNUNET_malloc (size); | 1058 | msg = GNUNET_malloc (size); |
1103 | memcpy (msg, hello, size); | 1059 | memcpy (msg, hello, size); |
1104 | #if DEBUG_TRANSPORT_API | ||
1105 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1060 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1106 | "Offering `%s' message of `%4s' to transport for validation.\n", "HELLO", | 1061 | "Offering `%s' message of `%4s' to transport for validation.\n", "HELLO", |
1107 | GNUNET_i2s (&peer)); | 1062 | GNUNET_i2s (&peer)); |
1108 | #endif | ||
1109 | schedule_control_transmit (handle, size, &send_hello, msg); | 1063 | schedule_control_transmit (handle, size, &send_hello, msg); |
1110 | } | 1064 | } |
1111 | 1065 | ||
@@ -1204,9 +1158,7 @@ GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1204 | void | 1158 | void |
1205 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) | 1159 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) |
1206 | { | 1160 | { |
1207 | #if DEBUG_TRANSPORT_API | ||
1208 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n"); | 1161 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n"); |
1209 | #endif | ||
1210 | /* this disconnects all neighbours... */ | 1162 | /* this disconnects all neighbours... */ |
1211 | if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) | 1163 | if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) |
1212 | disconnect_and_schedule_reconnect (handle); | 1164 | disconnect_and_schedule_reconnect (handle); |
@@ -1291,11 +1243,9 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, | |||
1291 | delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size); | 1243 | delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size); |
1292 | if (delay.rel_value > timeout.rel_value) | 1244 | if (delay.rel_value > timeout.rel_value) |
1293 | delay.rel_value = 0; /* notify immediately (with failure) */ | 1245 | delay.rel_value = 0; /* notify immediately (with failure) */ |
1294 | #if DEBUG_TRANSPORT_API | ||
1295 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1246 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1296 | "Bandwidth tracker allows next transmission to peer %s in %llu ms\n", | 1247 | "Bandwidth tracker allows next transmission to peer %s in %llu ms\n", |
1297 | GNUNET_i2s (target), (unsigned long long) delay.rel_value); | 1248 | GNUNET_i2s (target), (unsigned long long) delay.rel_value); |
1298 | #endif | ||
1299 | n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value); | 1249 | n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value); |
1300 | schedule_transmission (handle); | 1250 | schedule_transmission (handle); |
1301 | return th; | 1251 | return th; |