diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-01 17:59:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-01 17:59:35 +0000 |
commit | f5d1568921ff07fa104e4417dec0ed33b02e6a64 (patch) | |
tree | 71ab190176fe6464b807d364f53339965648817d /src/transport | |
parent | 9c22a5acbf2ae9eecc83fa616a2e80b5351908f0 (diff) | |
download | gnunet-f5d1568921ff07fa104e4417dec0ed33b02e6a64.tar.gz gnunet-f5d1568921ff07fa104e4417dec0ed33b02e6a64.zip |
-fixing #2290
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 25 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 25 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 36 | ||||
-rw-r--r-- | src/transport/plugin_transport_unix.c | 35 |
4 files changed, 1 insertions, 120 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index c64a594cd..cf21a425a 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -157,10 +157,8 @@ client_send (struct Session *s, struct HTTP_Message *msg) | |||
157 | 157 | ||
158 | if (s->client_put_paused == GNUNET_YES) | 158 | if (s->client_put_paused == GNUNET_YES) |
159 | { | 159 | { |
160 | #if VERBOSE_CLIENT | ||
161 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, s->plugin->name, | 160 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, s->plugin->name, |
162 | "Client: %X was suspended, unpausing\n", s->client_put); | 161 | "Client: %X was suspended, unpausing\n", s->client_put); |
163 | #endif | ||
164 | s->client_put_paused = GNUNET_NO; | 162 | s->client_put_paused = GNUNET_NO; |
165 | curl_easy_pause (s->client_put, CURLPAUSE_CONT); | 163 | curl_easy_pause (s->client_put, CURLPAUSE_CONT); |
166 | } | 164 | } |
@@ -354,14 +352,12 @@ client_receive_mst_cb (void *cls, void *client, | |||
354 | 352 | ||
355 | if (GNUNET_TIME_absolute_get ().abs_value < s->next_receive.abs_value) | 353 | if (GNUNET_TIME_absolute_get ().abs_value < s->next_receive.abs_value) |
356 | { | 354 | { |
357 | #if VERBOSE_CLIENT | ||
358 | struct Plugin *plugin = s->plugin; | 355 | struct Plugin *plugin = s->plugin; |
359 | 356 | ||
360 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 357 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
361 | "Client: peer `%s' address `%s' next read delayed for %llu ms\n", | 358 | "Client: peer `%s' address `%s' next read delayed for %llu ms\n", |
362 | GNUNET_i2s (&s->target), GNUNET_a2s (s->addr, s->addrlen), | 359 | GNUNET_i2s (&s->target), GNUNET_a2s (s->addr, s->addrlen), |
363 | delay); | 360 | delay); |
364 | #endif | ||
365 | } | 361 | } |
366 | } | 362 | } |
367 | 363 | ||
@@ -404,29 +400,20 @@ client_receive (void *stream, size_t size, size_t nmemb, void *cls) | |||
404 | struct Session *s = cls; | 400 | struct Session *s = cls; |
405 | struct GNUNET_TIME_Absolute now; | 401 | struct GNUNET_TIME_Absolute now; |
406 | size_t len = size * nmemb; | 402 | size_t len = size * nmemb; |
407 | |||
408 | |||
409 | |||
410 | |||
411 | #if VERBOSE_CLIENT | ||
412 | struct Plugin *plugin = s->plugin; | 403 | struct Plugin *plugin = s->plugin; |
413 | 404 | ||
414 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 405 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
415 | "Client: Received %Zu bytes from peer `%s'\n", len, | 406 | "Client: Received %Zu bytes from peer `%s'\n", len, |
416 | GNUNET_i2s (&s->target)); | 407 | GNUNET_i2s (&s->target)); |
417 | #endif | ||
418 | |||
419 | now = GNUNET_TIME_absolute_get (); | 408 | now = GNUNET_TIME_absolute_get (); |
420 | if (now.abs_value < s->next_receive.abs_value) | 409 | if (now.abs_value < s->next_receive.abs_value) |
421 | { | 410 | { |
422 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); | 411 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); |
423 | struct GNUNET_TIME_Relative delta = | 412 | struct GNUNET_TIME_Relative delta = |
424 | GNUNET_TIME_absolute_get_difference (now, s->next_receive); | 413 | GNUNET_TIME_absolute_get_difference (now, s->next_receive); |
425 | #if DEBUG_CLIENT | ||
426 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 414 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
427 | "Client: %X No inbound bandwidth available! Next read was delayed for %llu ms\n", | 415 | "Client: %X No inbound bandwidth available! Next read was delayed for %llu ms\n", |
428 | s->client_get, delta.rel_value); | 416 | s->client_get, delta.rel_value); |
429 | #endif | ||
430 | if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK) | 417 | if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK) |
431 | { | 418 | { |
432 | GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); | 419 | GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); |
@@ -459,10 +446,7 @@ static size_t | |||
459 | client_send_cb (void *stream, size_t size, size_t nmemb, void *cls) | 446 | client_send_cb (void *stream, size_t size, size_t nmemb, void *cls) |
460 | { | 447 | { |
461 | struct Session *s = cls; | 448 | struct Session *s = cls; |
462 | |||
463 | #if VERBOSE_CLIENT | ||
464 | struct Plugin *plugin = s->plugin; | 449 | struct Plugin *plugin = s->plugin; |
465 | #endif | ||
466 | size_t bytes_sent = 0; | 450 | size_t bytes_sent = 0; |
467 | size_t len; | 451 | size_t len; |
468 | 452 | ||
@@ -476,11 +460,9 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls) | |||
476 | 460 | ||
477 | if (msg == NULL) | 461 | if (msg == NULL) |
478 | { | 462 | { |
479 | #if VERBOSE_CLIENT | ||
480 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 463 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
481 | "Client: %X Nothing to send! Suspending PUT handle!\n", | 464 | "Client: %X Nothing to send! Suspending PUT handle!\n", |
482 | s->client_put); | 465 | s->client_put); |
483 | #endif | ||
484 | s->client_put_paused = GNUNET_YES; | 466 | s->client_put_paused = GNUNET_YES; |
485 | return CURL_READFUNC_PAUSE; | 467 | return CURL_READFUNC_PAUSE; |
486 | } | 468 | } |
@@ -514,11 +496,9 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls) | |||
514 | 496 | ||
515 | if (msg->pos == msg->size) | 497 | if (msg->pos == msg->size) |
516 | { | 498 | { |
517 | #if VERBOSE_CLIENT | ||
518 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 499 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
519 | "Client: %X Message with %u bytes sent, removing message from queue\n", | 500 | "Client: %X Message with %u bytes sent, removing message from queue\n", |
520 | s->client_put, msg->size, msg->pos); | 501 | s->client_put, msg->size, msg->pos); |
521 | #endif | ||
522 | /* Calling transmit continuation */ | 502 | /* Calling transmit continuation */ |
523 | if (NULL != msg->transmit_cont) | 503 | if (NULL != msg->transmit_cont) |
524 | msg->transmit_cont (msg->transmit_cont_cls, &s->target, GNUNET_OK); | 504 | msg->transmit_cont (msg->transmit_cont_cls, &s->target, GNUNET_OK); |
@@ -536,15 +516,10 @@ client_connect (struct Session *s) | |||
536 | char *url; | 516 | char *url; |
537 | CURLMcode mret; | 517 | CURLMcode mret; |
538 | 518 | ||
539 | #if VERBOSE_CLIENT | ||
540 | #endif | ||
541 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 519 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
542 | "Initiating outbound session peer `%s'\n", | 520 | "Initiating outbound session peer `%s'\n", |
543 | GNUNET_i2s (&s->target)); | 521 | GNUNET_i2s (&s->target)); |
544 | |||
545 | |||
546 | s->inbound = GNUNET_NO; | 522 | s->inbound = GNUNET_NO; |
547 | |||
548 | plugin->last_tag++; | 523 | plugin->last_tag++; |
549 | /* create url */ | 524 | /* create url */ |
550 | GNUNET_asprintf (&url, "%s%s;%u", | 525 | GNUNET_asprintf (&url, "%s%s;%u", |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index c5682e16a..1ab6bac7e 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -39,10 +39,6 @@ | |||
39 | #include "gnunet_transport_plugin.h" | 39 | #include "gnunet_transport_plugin.h" |
40 | #include "transport.h" | 40 | #include "transport.h" |
41 | 41 | ||
42 | #define DEBUG_TCP GNUNET_EXTRA_LOGGING | ||
43 | |||
44 | #define DEBUG_TCP_NAT GNUNET_EXTRA_LOGGING | ||
45 | |||
46 | 42 | ||
47 | /** | 43 | /** |
48 | * How long until we give up on establishing an NAT connection? | 44 | * How long until we give up on establishing an NAT connection? |
@@ -764,11 +760,9 @@ do_transmit (void *cls, size_t size, void *buf) | |||
764 | plugin = session->plugin; | 760 | plugin = session->plugin; |
765 | if (buf == NULL) | 761 | if (buf == NULL) |
766 | { | 762 | { |
767 | #if DEBUG_TCP | ||
768 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 763 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
769 | "Timeout trying to transmit to peer `%4s', discarding message queue.\n", | 764 | "Timeout trying to transmit to peer `%4s', discarding message queue.\n", |
770 | GNUNET_i2s (&session->target)); | 765 | GNUNET_i2s (&session->target)); |
771 | #endif | ||
772 | /* timeout; cancel all messages that have already expired */ | 766 | /* timeout; cancel all messages that have already expired */ |
773 | hd = NULL; | 767 | hd = NULL; |
774 | tl = NULL; | 768 | tl = NULL; |
@@ -779,11 +773,9 @@ do_transmit (void *cls, size_t size, void *buf) | |||
779 | { | 773 | { |
780 | GNUNET_CONTAINER_DLL_remove (session->pending_messages_head, | 774 | GNUNET_CONTAINER_DLL_remove (session->pending_messages_head, |
781 | session->pending_messages_tail, pos); | 775 | session->pending_messages_tail, pos); |
782 | #if DEBUG_TCP | ||
783 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 776 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
784 | "Failed to transmit %u byte message to `%4s'.\n", | 777 | "Failed to transmit %u byte message to `%4s'.\n", |
785 | pos->message_size, GNUNET_i2s (&session->target)); | 778 | pos->message_size, GNUNET_i2s (&session->target)); |
786 | #endif | ||
787 | ret += pos->message_size; | 779 | ret += pos->message_size; |
788 | GNUNET_CONTAINER_DLL_insert_after (hd, tl, tl, pos); | 780 | GNUNET_CONTAINER_DLL_insert_after (hd, tl, tl, pos); |
789 | } | 781 | } |
@@ -849,10 +841,8 @@ do_transmit (void *cls, size_t size, void *buf) | |||
849 | } | 841 | } |
850 | GNUNET_assert (hd == NULL); | 842 | GNUNET_assert (hd == NULL); |
851 | GNUNET_assert (tl == NULL); | 843 | GNUNET_assert (tl == NULL); |
852 | #if DEBUG_TCP > 1 | ||
853 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", "Transmitting %u bytes\n", | 844 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", "Transmitting %u bytes\n", |
854 | ret); | 845 | ret); |
855 | #endif | ||
856 | GNUNET_STATISTICS_update (plugin->env->stats, | 846 | GNUNET_STATISTICS_update (plugin->env->stats, |
857 | gettext_noop ("# bytes currently in TCP buffers"), | 847 | gettext_noop ("# bytes currently in TCP buffers"), |
858 | -(int64_t) ret, GNUNET_NO); | 848 | -(int64_t) ret, GNUNET_NO); |
@@ -933,13 +923,11 @@ disconnect_session (struct Session *session) | |||
933 | 923 | ||
934 | while (NULL != (pm = session->pending_messages_head)) | 924 | while (NULL != (pm = session->pending_messages_head)) |
935 | { | 925 | { |
936 | #if DEBUG_TCP | ||
937 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 926 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
938 | pm->transmit_cont != | 927 | pm->transmit_cont != |
939 | NULL ? "Could not deliver message to `%4s'.\n" : | 928 | NULL ? "Could not deliver message to `%4s'.\n" : |
940 | "Could not deliver message to `%4s', notifying.\n", | 929 | "Could not deliver message to `%4s', notifying.\n", |
941 | GNUNET_i2s (&session->target)); | 930 | GNUNET_i2s (&session->target)); |
942 | #endif | ||
943 | GNUNET_STATISTICS_update (session->plugin->env->stats, | 931 | GNUNET_STATISTICS_update (session->plugin->env->stats, |
944 | gettext_noop ("# bytes currently in TCP buffers"), | 932 | gettext_noop ("# bytes currently in TCP buffers"), |
945 | -(int64_t) pm->message_size, GNUNET_NO); | 933 | -(int64_t) pm->message_size, GNUNET_NO); |
@@ -1268,10 +1256,8 @@ tcp_plugin_get_session (void *cls, | |||
1268 | GNUNET_CONTAINER_multihashmap_contains (plugin->nat_wait_conns, | 1256 | GNUNET_CONTAINER_multihashmap_contains (plugin->nat_wait_conns, |
1269 | &address->peer.hashPubKey))) | 1257 | &address->peer.hashPubKey))) |
1270 | { | 1258 | { |
1271 | #if DEBUG_TCP_NAT | ||
1272 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1259 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1273 | _("Found valid IPv4 NAT address (creating session)!\n")); | 1260 | _("Found valid IPv4 NAT address (creating session)!\n")); |
1274 | #endif | ||
1275 | session = create_session (plugin, &address->peer, NULL, GNUNET_YES); | 1261 | session = create_session (plugin, &address->peer, NULL, GNUNET_YES); |
1276 | session->addrlen = 0; | 1262 | session->addrlen = 0; |
1277 | session->addr = NULL; | 1263 | session->addr = NULL; |
@@ -1307,11 +1293,9 @@ tcp_plugin_get_session (void *cls, | |||
1307 | sa = GNUNET_CONNECTION_create_from_sockaddr (af, sb, sbs); | 1293 | sa = GNUNET_CONNECTION_create_from_sockaddr (af, sb, sbs); |
1308 | if (sa == NULL) | 1294 | if (sa == NULL) |
1309 | { | 1295 | { |
1310 | #if DEBUG_TCP | ||
1311 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1296 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1312 | "Failed to create connection to `%4s' at `%s'\n", | 1297 | "Failed to create connection to `%4s' at `%s'\n", |
1313 | GNUNET_i2s (&session->target), GNUNET_a2s (sb, sbs)); | 1298 | GNUNET_i2s (&session->target), GNUNET_a2s (sb, sbs)); |
1314 | #endif | ||
1315 | return NULL; | 1299 | return NULL; |
1316 | } | 1300 | } |
1317 | plugin->max_connections--; | 1301 | plugin->max_connections--; |
@@ -1680,12 +1664,9 @@ handle_tcp_nat_probe (void *cls, struct GNUNET_SERVER_Client *client, | |||
1680 | session->client = client; | 1664 | session->client = client; |
1681 | session->last_activity = GNUNET_TIME_absolute_get (); | 1665 | session->last_activity = GNUNET_TIME_absolute_get (); |
1682 | session->inbound = GNUNET_NO; | 1666 | session->inbound = GNUNET_NO; |
1683 | |||
1684 | #if DEBUG_TCP_NAT | ||
1685 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1667 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1686 | "Found address `%s' for incoming connection\n", | 1668 | "Found address `%s' for incoming connection\n", |
1687 | GNUNET_a2s (vaddr, alen)); | 1669 | GNUNET_a2s (vaddr, alen)); |
1688 | #endif | ||
1689 | switch (((const struct sockaddr *) vaddr)->sa_family) | 1670 | switch (((const struct sockaddr *) vaddr)->sa_family) |
1690 | { | 1671 | { |
1691 | case AF_INET: | 1672 | case AF_INET: |
@@ -1813,10 +1794,8 @@ handle_tcp_welcome (void *cls, struct GNUNET_SERVER_Client *client, | |||
1813 | } | 1794 | } |
1814 | else | 1795 | else |
1815 | { | 1796 | { |
1816 | #if DEBUG_TCP | ||
1817 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1797 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1818 | "Did not obtain TCP socket address for incoming connection\n"); | 1798 | "Did not obtain TCP socket address for incoming connection\n"); |
1819 | #endif | ||
1820 | } | 1799 | } |
1821 | GNUNET_CONTAINER_multihashmap_put(plugin->sessionmap, &wm->clientIdentity.hashPubKey, session, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 1800 | GNUNET_CONTAINER_multihashmap_put(plugin->sessionmap, &wm->clientIdentity.hashPubKey, session, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
1822 | inc_sessions (plugin, session, __LINE__); | 1801 | inc_sessions (plugin, session, __LINE__); |
@@ -1958,12 +1937,10 @@ handle_tcp_data (void *cls, struct GNUNET_SERVER_Client *client, | |||
1958 | } | 1937 | } |
1959 | else | 1938 | else |
1960 | { | 1939 | { |
1961 | #if DEBUG_TCP | ||
1962 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1940 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1963 | "Throttling receiving from `%s' for %llu ms\n", | 1941 | "Throttling receiving from `%s' for %llu ms\n", |
1964 | GNUNET_i2s (&session->target), | 1942 | GNUNET_i2s (&session->target), |
1965 | (unsigned long long) delay.rel_value); | 1943 | (unsigned long long) delay.rel_value); |
1966 | #endif | ||
1967 | GNUNET_SERVER_disable_receive_done_warning (client); | 1944 | GNUNET_SERVER_disable_receive_done_warning (client); |
1968 | session->receive_delay_task = | 1945 | session->receive_delay_task = |
1969 | GNUNET_SCHEDULER_add_delayed (delay, &delayed_done, session); | 1946 | GNUNET_SCHEDULER_add_delayed (delay, &delayed_done, session); |
@@ -1990,7 +1967,6 @@ disconnect_notify (void *cls, struct GNUNET_SERVER_Client *client) | |||
1990 | session = lookup_session_by_client (plugin, client); | 1967 | session = lookup_session_by_client (plugin, client); |
1991 | if (session == NULL) | 1968 | if (session == NULL) |
1992 | return; /* unknown, nothing to do */ | 1969 | return; /* unknown, nothing to do */ |
1993 | #if DEBUG_TCP | ||
1994 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1970 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1995 | "Destroying session of `%4s' with %s due to network-level disconnect.\n", | 1971 | "Destroying session of `%4s' with %s due to network-level disconnect.\n", |
1996 | GNUNET_i2s (&session->target), | 1972 | GNUNET_i2s (&session->target), |
@@ -1999,7 +1975,6 @@ disconnect_notify (void *cls, struct GNUNET_SERVER_Client *client) | |||
1999 | session->addr, | 1975 | session->addr, |
2000 | session->addrlen) : | 1976 | session->addrlen) : |
2001 | "*"); | 1977 | "*"); |
2002 | #endif | ||
2003 | GNUNET_STATISTICS_update (session->plugin->env->stats, | 1978 | GNUNET_STATISTICS_update (session->plugin->env->stats, |
2004 | gettext_noop | 1979 | gettext_noop |
2005 | ("# network-level TCP disconnect events"), 1, | 1980 | ("# network-level TCP disconnect events"), 1, |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 5d512d9e4..b1da80431 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -601,14 +601,11 @@ disconnect_and_free_it (void *cls, const GNUNET_HashCode * key, void *value) | |||
601 | struct UDPMessageWrapper *udpw; | 601 | struct UDPMessageWrapper *udpw; |
602 | struct UDPMessageWrapper *next; | 602 | struct UDPMessageWrapper *next; |
603 | 603 | ||
604 | #if DEBUG_UDP | ||
605 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 604 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
606 | "Session %p to peer `%s' address ended \n", | 605 | "Session %p to peer `%s' address ended \n", |
607 | s, | 606 | s, |
608 | GNUNET_i2s (&s->target), | 607 | GNUNET_i2s (&s->target), |
609 | GNUNET_a2s (s->sock_addr, s->addrlen)); | 608 | GNUNET_a2s (s->sock_addr, s->addrlen)); |
610 | #endif | ||
611 | |||
612 | if (s->frag_ctx != NULL) | 609 | if (s->frag_ctx != NULL) |
613 | { | 610 | { |
614 | GNUNET_FRAGMENT_context_destroy(s->frag_ctx->frag); | 611 | GNUNET_FRAGMENT_context_destroy(s->frag_ctx->frag); |
@@ -677,10 +674,8 @@ udp_disconnect (void *cls, const struct GNUNET_PeerIdentity *target) | |||
677 | GNUNET_assert (plugin != NULL); | 674 | GNUNET_assert (plugin != NULL); |
678 | 675 | ||
679 | GNUNET_assert (target != NULL); | 676 | GNUNET_assert (target != NULL); |
680 | #if DEBUG_UDP | ||
681 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 677 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
682 | "Disconnecting from peer `%s'\n", GNUNET_i2s (target)); | 678 | "Disconnecting from peer `%s'\n", GNUNET_i2s (target)); |
683 | #endif | ||
684 | /* Clean up sessions */ | 679 | /* Clean up sessions */ |
685 | GNUNET_CONTAINER_multihashmap_get_multiple (plugin->sessions, &target->hashPubKey, &disconnect_and_free_it, plugin); | 680 | GNUNET_CONTAINER_multihashmap_get_multiple (plugin->sessions, &target->hashPubKey, &disconnect_and_free_it, plugin); |
686 | } | 681 | } |
@@ -1267,12 +1262,10 @@ process_udp_message (struct Plugin *plugin, const struct UDPMessage *msg, | |||
1267 | GNUNET_break (0); | 1262 | GNUNET_break (0); |
1268 | return; | 1263 | return; |
1269 | } | 1264 | } |
1270 | #if DEBUG_UDP | ||
1271 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1265 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1272 | "Received message with %u bytes from peer `%s' at `%s'\n", | 1266 | "Received message with %u bytes from peer `%s' at `%s'\n", |
1273 | (unsigned int) ntohs (msg->header.size), GNUNET_i2s (&msg->sender), | 1267 | (unsigned int) ntohs (msg->header.size), GNUNET_i2s (&msg->sender), |
1274 | GNUNET_a2s (sender_addr, sender_addr_len)); | 1268 | GNUNET_a2s (sender_addr, sender_addr_len)); |
1275 | #endif | ||
1276 | 1269 | ||
1277 | struct GNUNET_HELLO_Address * address = GNUNET_HELLO_address_allocate(&msg->sender, "udp", arg, args); | 1270 | struct GNUNET_HELLO_Address * address = GNUNET_HELLO_address_allocate(&msg->sender, "udp", arg, args); |
1278 | s = udp_plugin_get_session(plugin, address); | 1271 | s = udp_plugin_get_session(plugin, address); |
@@ -1398,7 +1391,6 @@ ack_proc (void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg) | |||
1398 | if (s->flow_delay_for_other_peer.rel_value <= UINT32_MAX) | 1391 | if (s->flow_delay_for_other_peer.rel_value <= UINT32_MAX) |
1399 | delay = s->flow_delay_for_other_peer.rel_value; | 1392 | delay = s->flow_delay_for_other_peer.rel_value; |
1400 | 1393 | ||
1401 | #if DEBUG_UDP | ||
1402 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1394 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1403 | "Sending ACK to `%s' including delay of %u ms\n", | 1395 | "Sending ACK to `%s' including delay of %u ms\n", |
1404 | GNUNET_a2s (rc->src_addr, | 1396 | GNUNET_a2s (rc->src_addr, |
@@ -1406,7 +1398,6 @@ ack_proc (void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg) | |||
1406 | AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct | 1398 | AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct |
1407 | sockaddr_in6)), | 1399 | sockaddr_in6)), |
1408 | delay); | 1400 | delay); |
1409 | #endif | ||
1410 | udpw = GNUNET_malloc (sizeof (struct UDPMessageWrapper) + msize); | 1401 | udpw = GNUNET_malloc (sizeof (struct UDPMessageWrapper) + msize); |
1411 | udpw->cont = NULL; | 1402 | udpw->cont = NULL; |
1412 | udpw->cont_cls = NULL; | 1403 | udpw->cont_cls = NULL; |
@@ -1489,21 +1480,17 @@ static void read_process_ack (struct Plugin *plugin, | |||
1489 | 1480 | ||
1490 | if (GNUNET_OK != GNUNET_FRAGMENT_process_ack (s->frag_ctx->frag, ack)) | 1481 | if (GNUNET_OK != GNUNET_FRAGMENT_process_ack (s->frag_ctx->frag, ack)) |
1491 | { | 1482 | { |
1492 | #if DEBUG_UDP | ||
1493 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1483 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1494 | "UDP processes %u-byte acknowledgement from `%s' at `%s'\n", | 1484 | "UDP processes %u-byte acknowledgement from `%s' at `%s'\n", |
1495 | (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender), | 1485 | (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender), |
1496 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); | 1486 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); |
1497 | #endif | ||
1498 | return; | 1487 | return; |
1499 | } | 1488 | } |
1500 | 1489 | ||
1501 | #if DEBUG_UDP | ||
1502 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1490 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1503 | "FULL MESSAGE ACKed\n", | 1491 | "FULL MESSAGE ACKed\n", |
1504 | (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender), | 1492 | (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender), |
1505 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); | 1493 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); |
1506 | #endif | ||
1507 | s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag); | 1494 | s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag); |
1508 | 1495 | ||
1509 | struct UDPMessageWrapper * udpw = NULL; | 1496 | struct UDPMessageWrapper * udpw = NULL; |
@@ -1556,12 +1543,9 @@ static void read_process_fragment (struct Plugin *plugin, | |||
1556 | frc.addr = (const struct sockaddr *) addr; | 1543 | frc.addr = (const struct sockaddr *) addr; |
1557 | frc.addr_len = fromlen; | 1544 | frc.addr_len = fromlen; |
1558 | 1545 | ||
1559 | #if DEBUG_UDP | ||
1560 | LOG (GNUNET_ERROR_TYPE_DEBUG, "UDP processes %u-byte fragment from `%s'\n", | 1546 | LOG (GNUNET_ERROR_TYPE_DEBUG, "UDP processes %u-byte fragment from `%s'\n", |
1561 | (unsigned int) ntohs (msg->size), | 1547 | (unsigned int) ntohs (msg->size), |
1562 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); | 1548 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); |
1563 | #endif | ||
1564 | |||
1565 | /* Lookup existing receive context for this address */ | 1549 | /* Lookup existing receive context for this address */ |
1566 | GNUNET_CONTAINER_heap_iterate (plugin->defrag_ctxs, | 1550 | GNUNET_CONTAINER_heap_iterate (plugin->defrag_ctxs, |
1567 | &find_receive_context, | 1551 | &find_receive_context, |
@@ -1585,19 +1569,15 @@ static void read_process_fragment (struct Plugin *plugin, | |||
1585 | GNUNET_CONTAINER_heap_insert (plugin->defrag_ctxs, d_ctx, | 1569 | GNUNET_CONTAINER_heap_insert (plugin->defrag_ctxs, d_ctx, |
1586 | (GNUNET_CONTAINER_HeapCostType) | 1570 | (GNUNET_CONTAINER_HeapCostType) |
1587 | now.abs_value); | 1571 | now.abs_value); |
1588 | #if DEBUG_UDP | ||
1589 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Created new defragmentation context for %u-byte fragment from `%s'\n", | 1572 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Created new defragmentation context for %u-byte fragment from `%s'\n", |
1590 | (unsigned int) ntohs (msg->size), | 1573 | (unsigned int) ntohs (msg->size), |
1591 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); | 1574 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); |
1592 | #endif | ||
1593 | } | 1575 | } |
1594 | else | 1576 | else |
1595 | { | 1577 | { |
1596 | #if DEBUG_UDP | ||
1597 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Found existing defragmentation context for %u-byte fragment from `%s'\n", | 1578 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Found existing defragmentation context for %u-byte fragment from `%s'\n", |
1598 | (unsigned int) ntohs (msg->size), | 1579 | (unsigned int) ntohs (msg->size), |
1599 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); | 1580 | GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); |
1600 | #endif | ||
1601 | } | 1581 | } |
1602 | 1582 | ||
1603 | if (GNUNET_OK == GNUNET_DEFRAGMENT_process_fragment (d_ctx->defrag, msg)) | 1583 | if (GNUNET_OK == GNUNET_DEFRAGMENT_process_fragment (d_ctx->defrag, msg)) |
@@ -1718,20 +1698,16 @@ udp_select_send (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *sock) | |||
1718 | udpw->cont (udpw->cont_cls, &udpw->session->target, GNUNET_SYSERR); | 1698 | udpw->cont (udpw->cont_cls, &udpw->session->target, GNUNET_SYSERR); |
1719 | if (udpw->frag_ctx != NULL) | 1699 | if (udpw->frag_ctx != NULL) |
1720 | { | 1700 | { |
1721 | #if DEBUG_UDP | ||
1722 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fragmented message for peer `%s' with size %u timed out\n", | 1701 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fragmented message for peer `%s' with size %u timed out\n", |
1723 | GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->bytes_to_send); | 1702 | GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->bytes_to_send); |
1724 | #endif | ||
1725 | udpw->session->last_expected_delay = GNUNET_FRAGMENT_context_destroy(udpw->frag_ctx->frag); | 1703 | udpw->session->last_expected_delay = GNUNET_FRAGMENT_context_destroy(udpw->frag_ctx->frag); |
1726 | GNUNET_free (udpw->frag_ctx); | 1704 | GNUNET_free (udpw->frag_ctx); |
1727 | udpw->session->frag_ctx = NULL; | 1705 | udpw->session->frag_ctx = NULL; |
1728 | } | 1706 | } |
1729 | else | 1707 | else |
1730 | { | 1708 | { |
1731 | #if DEBUG_UDP | ||
1732 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message for peer `%s' with size %u timed out\n", | 1709 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message for peer `%s' with size %u timed out\n", |
1733 | GNUNET_i2s(&udpw->session->target), udpw->msg_size); | 1710 | GNUNET_i2s(&udpw->session->target), udpw->msg_size); |
1734 | #endif | ||
1735 | } | 1711 | } |
1736 | 1712 | ||
1737 | if (sock == plugin->sockv4) | 1713 | if (sock == plugin->sockv4) |
@@ -1939,20 +1915,16 @@ setup_sockets (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struct | |||
1939 | serverAddrv6->sin6_port = htons (plugin->port); | 1915 | serverAddrv6->sin6_port = htons (plugin->port); |
1940 | addrlen = sizeof (struct sockaddr_in6); | 1916 | addrlen = sizeof (struct sockaddr_in6); |
1941 | serverAddr = (struct sockaddr *) serverAddrv6; | 1917 | serverAddr = (struct sockaddr *) serverAddrv6; |
1942 | #if DEBUG_UDP | ||
1943 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Binding to IPv6 port %d\n", | 1918 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Binding to IPv6 port %d\n", |
1944 | ntohs (serverAddrv6->sin6_port)); | 1919 | ntohs (serverAddrv6->sin6_port)); |
1945 | #endif | ||
1946 | tries = 0; | 1920 | tries = 0; |
1947 | while (GNUNET_NETWORK_socket_bind (plugin->sockv6, serverAddr, addrlen) != | 1921 | while (GNUNET_NETWORK_socket_bind (plugin->sockv6, serverAddr, addrlen) != |
1948 | GNUNET_OK) | 1922 | GNUNET_OK) |
1949 | { | 1923 | { |
1950 | serverAddrv6->sin6_port = htons (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, 33537) + 32000); /* Find a good, non-root port */ | 1924 | serverAddrv6->sin6_port = htons (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, 33537) + 32000); /* Find a good, non-root port */ |
1951 | #if DEBUG_UDP | ||
1952 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1925 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1953 | "IPv6 Binding failed, trying new port %d\n", | 1926 | "IPv6 Binding failed, trying new port %d\n", |
1954 | ntohs (serverAddrv6->sin6_port)); | 1927 | ntohs (serverAddrv6->sin6_port)); |
1955 | #endif | ||
1956 | tries++; | 1928 | tries++; |
1957 | if (tries > 10) | 1929 | if (tries > 10) |
1958 | { | 1930 | { |
@@ -1963,11 +1935,9 @@ setup_sockets (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struct | |||
1963 | } | 1935 | } |
1964 | if (plugin->sockv6 != NULL) | 1936 | if (plugin->sockv6 != NULL) |
1965 | { | 1937 | { |
1966 | #if DEBUG_UDP | ||
1967 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1938 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1968 | "IPv6 socket created on port %d\n", | 1939 | "IPv6 socket created on port %d\n", |
1969 | ntohs (serverAddrv6->sin6_port)); | 1940 | ntohs (serverAddrv6->sin6_port)); |
1970 | #endif | ||
1971 | addrs[sockets_created] = (struct sockaddr *) serverAddrv6; | 1941 | addrs[sockets_created] = (struct sockaddr *) serverAddrv6; |
1972 | addrlens[sockets_created] = sizeof (struct sockaddr_in6); | 1942 | addrlens[sockets_created] = sizeof (struct sockaddr_in6); |
1973 | sockets_created++; | 1943 | sockets_created++; |
@@ -1992,19 +1962,15 @@ setup_sockets (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struct | |||
1992 | addrlen = sizeof (struct sockaddr_in); | 1962 | addrlen = sizeof (struct sockaddr_in); |
1993 | serverAddr = (struct sockaddr *) serverAddrv4; | 1963 | serverAddr = (struct sockaddr *) serverAddrv4; |
1994 | 1964 | ||
1995 | #if DEBUG_UDP | ||
1996 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Binding to IPv4 port %d\n", | 1965 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Binding to IPv4 port %d\n", |
1997 | ntohs (serverAddrv4->sin_port)); | 1966 | ntohs (serverAddrv4->sin_port)); |
1998 | #endif | ||
1999 | tries = 0; | 1967 | tries = 0; |
2000 | while (GNUNET_NETWORK_socket_bind (plugin->sockv4, serverAddr, addrlen) != | 1968 | while (GNUNET_NETWORK_socket_bind (plugin->sockv4, serverAddr, addrlen) != |
2001 | GNUNET_OK) | 1969 | GNUNET_OK) |
2002 | { | 1970 | { |
2003 | serverAddrv4->sin_port = htons (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, 33537) + 32000); /* Find a good, non-root port */ | 1971 | serverAddrv4->sin_port = htons (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG, 33537) + 32000); /* Find a good, non-root port */ |
2004 | #if DEBUG_UDP | ||
2005 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv4 Binding failed, trying new port %d\n", | 1972 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv4 Binding failed, trying new port %d\n", |
2006 | ntohs (serverAddrv4->sin_port)); | 1973 | ntohs (serverAddrv4->sin_port)); |
2007 | #endif | ||
2008 | tries++; | 1974 | tries++; |
2009 | if (tries > 10) | 1975 | if (tries > 10) |
2010 | { | 1976 | { |
@@ -2353,10 +2319,8 @@ libgnunet_plugin_transport_udp_done (void *cls) | |||
2353 | } | 2319 | } |
2354 | 2320 | ||
2355 | /* Clean up sessions */ | 2321 | /* Clean up sessions */ |
2356 | #if DEBUG_UDP | ||
2357 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2322 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2358 | "Cleaning up sessions\n"); | 2323 | "Cleaning up sessions\n"); |
2359 | #endif | ||
2360 | GNUNET_CONTAINER_multihashmap_iterate (plugin->sessions, &disconnect_and_free_it, plugin); | 2324 | GNUNET_CONTAINER_multihashmap_iterate (plugin->sessions, &disconnect_and_free_it, plugin); |
2361 | GNUNET_CONTAINER_multihashmap_destroy (plugin->sessions); | 2325 | GNUNET_CONTAINER_multihashmap_destroy (plugin->sessions); |
2362 | 2326 | ||
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 64c2683c8..2aa987914 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -42,9 +42,6 @@ | |||
42 | #include "gnunet_transport_plugin.h" | 42 | #include "gnunet_transport_plugin.h" |
43 | #include "transport.h" | 43 | #include "transport.h" |
44 | 44 | ||
45 | #define DEBUG_UNIX GNUNET_EXTRALOGGING | ||
46 | #define DETAILS GNUNET_NO | ||
47 | |||
48 | #define MAX_PROBES 20 | 45 | #define MAX_PROBES 20 |
49 | 46 | ||
50 | /* | 47 | /* |
@@ -254,10 +251,7 @@ get_session_delete_it (void *cls, const GNUNET_HashCode * key, void *value) | |||
254 | struct Plugin *plugin = cls; | 251 | struct Plugin *plugin = cls; |
255 | GNUNET_assert (plugin != NULL); | 252 | GNUNET_assert (plugin != NULL); |
256 | 253 | ||
257 | #if DEBUG_UNIX | ||
258 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting session for peer `%s' `%s' \n", GNUNET_i2s (&s->target), s->addr); | 254 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting session for peer `%s' `%s' \n", GNUNET_i2s (&s->target), s->addr); |
259 | #endif | ||
260 | |||
261 | plugin->env->session_end (plugin->env->cls, &s->target, s); | 255 | plugin->env->session_end (plugin->env->cls, &s->target, s); |
262 | 256 | ||
263 | GNUNET_assert (GNUNET_YES == | 257 | GNUNET_assert (GNUNET_YES == |
@@ -389,10 +383,8 @@ unix_real_send (void *cls, | |||
389 | 383 | ||
390 | if (send_handle == NULL) | 384 | if (send_handle == NULL) |
391 | { | 385 | { |
392 | #if DEBUG_UNIX | ||
393 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 386 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
394 | "unix_real_send with send_handle NULL!\n"); | 387 | "unix_real_send with send_handle NULL!\n"); |
395 | #endif | ||
396 | /* failed to open send socket for AF */ | 388 | /* failed to open send socket for AF */ |
397 | if (cont != NULL) | 389 | if (cont != NULL) |
398 | cont (cont_cls, target, GNUNET_SYSERR); | 390 | cont (cont_cls, target, GNUNET_SYSERR); |
@@ -400,10 +392,8 @@ unix_real_send (void *cls, | |||
400 | } | 392 | } |
401 | if ((addr == NULL) || (addrlen == 0)) | 393 | if ((addr == NULL) || (addrlen == 0)) |
402 | { | 394 | { |
403 | #if DEBUG_UNIX | ||
404 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 395 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
405 | "unix_real_send called without address, returning!\n"); | 396 | "unix_real_send called without address, returning!\n"); |
406 | #endif | ||
407 | if (cont != NULL) | 397 | if (cont != NULL) |
408 | cont (cont_cls, target, GNUNET_SYSERR); | 398 | cont (cont_cls, target, GNUNET_SYSERR); |
409 | return 0; /* Can never send if we don't have an address!! */ | 399 | return 0; /* Can never send if we don't have an address!! */ |
@@ -460,13 +450,10 @@ unix_real_send (void *cls, | |||
460 | } | 450 | } |
461 | } | 451 | } |
462 | } | 452 | } |
463 | |||
464 | #if DEBUG_UNIX | ||
465 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 453 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
466 | "UNIX transmit %u-byte message to %s (%d: %s)\n", | 454 | "UNIX transmit %u-byte message to %s (%d: %s)\n", |
467 | (unsigned int) msgbuf_size, GNUNET_a2s (sb, sbs), (int) sent, | 455 | (unsigned int) msgbuf_size, GNUNET_a2s (sb, sbs), (int) sent, |
468 | (sent < 0) ? STRERROR (errno) : "ok"); | 456 | (sent < 0) ? STRERROR (errno) : "ok"); |
469 | #endif | ||
470 | /* Calling continuation */ | 457 | /* Calling continuation */ |
471 | if (cont != NULL) | 458 | if (cont != NULL) |
472 | { | 459 | { |
@@ -502,9 +489,7 @@ get_session_it (void *cls, const GNUNET_HashCode * key, void *value) | |||
502 | struct gsi_ctx *gsi = cls; | 489 | struct gsi_ctx *gsi = cls; |
503 | struct Session *s = value; | 490 | struct Session *s = value; |
504 | 491 | ||
505 | #if DEBUG_UNIX | ||
506 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Comparing session %s %s\n", gsi->address, s->addr); | 492 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Comparing session %s %s\n", gsi->address, s->addr); |
507 | #endif | ||
508 | if ((gsi->addrlen == s->addrlen) && | 493 | if ((gsi->addrlen == s->addrlen) && |
509 | (0 == memcmp (gsi->address, s->addr, s->addrlen))) | 494 | (0 == memcmp (gsi->address, s->addr, s->addrlen))) |
510 | { | 495 | { |
@@ -541,9 +526,7 @@ unix_plugin_get_session (void *cls, | |||
541 | GNUNET_CONTAINER_multihashmap_get_multiple (plugin->session_map, &address->peer.hashPubKey, &get_session_it, &gsi); | 526 | GNUNET_CONTAINER_multihashmap_get_multiple (plugin->session_map, &address->peer.hashPubKey, &get_session_it, &gsi); |
542 | if (gsi.res != NULL) | 527 | if (gsi.res != NULL) |
543 | { | 528 | { |
544 | #if DEBUG_UNIX | ||
545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found existing session\n"); | 529 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found existing session\n"); |
546 | #endif | ||
547 | return gsi.res; | 530 | return gsi.res; |
548 | } | 531 | } |
549 | 532 | ||
@@ -563,11 +546,7 @@ unix_plugin_get_session (void *cls, | |||
563 | "# UNIX sessions active", | 546 | "# UNIX sessions active", |
564 | GNUNET_CONTAINER_multihashmap_size(plugin->session_map), | 547 | GNUNET_CONTAINER_multihashmap_size(plugin->session_map), |
565 | GNUNET_NO); | 548 | GNUNET_NO); |
566 | 549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating new session\n"); | |
567 | #if DEBUG_UNIX | ||
568 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating new session\n"); | ||
569 | #endif | ||
570 | |||
571 | return s; | 550 | return s; |
572 | } | 551 | } |
573 | 552 | ||
@@ -657,11 +636,8 @@ unix_plugin_send (void *cls, | |||
657 | GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue", | 636 | GNUNET_STATISTICS_set (plugin->env->stats,"# UNIX bytes in send queue", |
658 | plugin->bytes_in_queue, GNUNET_NO); | 637 | plugin->bytes_in_queue, GNUNET_NO); |
659 | 638 | ||
660 | #if DEBUG_UNIX | ||
661 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent %d bytes to `%s'\n", ssize, | 639 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent %d bytes to `%s'\n", ssize, |
662 | (char *) session->addr); | 640 | (char *) session->addr); |
663 | #endif | ||
664 | |||
665 | if (plugin->with_ws == GNUNET_NO) | 641 | if (plugin->with_ws == GNUNET_NO) |
666 | { | 642 | { |
667 | if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK) | 643 | if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -702,10 +678,8 @@ unix_demultiplexer (struct Plugin *plugin, struct GNUNET_PeerIdentity *sender, | |||
702 | 678 | ||
703 | GNUNET_assert (fromlen >= sizeof (struct sockaddr_un)); | 679 | GNUNET_assert (fromlen >= sizeof (struct sockaddr_un)); |
704 | 680 | ||
705 | #if DEBUG_UNIX | ||
706 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from %s\n", | 681 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from %s\n", |
707 | un->sun_path); | 682 | un->sun_path); |
708 | #endif | ||
709 | plugin->env->receive (plugin->env->cls, sender, currhdr, | 683 | plugin->env->receive (plugin->env->cls, sender, currhdr, |
710 | (const struct GNUNET_ATS_Information *) &ats, 2, | 684 | (const struct GNUNET_ATS_Information *) &ats, 2, |
711 | NULL, un->sun_path, strlen (un->sun_path) + 1); | 685 | NULL, un->sun_path, strlen (un->sun_path) + 1); |
@@ -747,10 +721,8 @@ unix_plugin_select_read (struct Plugin * plugin) | |||
747 | #if LINUX | 721 | #if LINUX |
748 | un.sun_path[0] = '/'; | 722 | un.sun_path[0] = '/'; |
749 | #endif | 723 | #endif |
750 | #if DEBUG_UNIX | ||
751 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %d bytes from socket %s\n", ret, | 724 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %d bytes from socket %s\n", ret, |
752 | &un.sun_path[0]); | 725 | &un.sun_path[0]); |
753 | #endif | ||
754 | } | 726 | } |
755 | 727 | ||
756 | GNUNET_assert (AF_UNIX == (un.sun_family)); | 728 | GNUNET_assert (AF_UNIX == (un.sun_family)); |
@@ -928,10 +900,8 @@ unix_transport_server_start (void *cls) | |||
928 | plugin->unix_sock.desc = NULL; | 900 | plugin->unix_sock.desc = NULL; |
929 | return GNUNET_SYSERR; | 901 | return GNUNET_SYSERR; |
930 | } | 902 | } |
931 | #if DEBUG_UNIX | ||
932 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "unix", "Bound to `%s'\n", | 903 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "unix", "Bound to `%s'\n", |
933 | &un.sun_path[0]); | 904 | &un.sun_path[0]); |
934 | #endif | ||
935 | plugin->rs = GNUNET_NETWORK_fdset_create (); | 905 | plugin->rs = GNUNET_NETWORK_fdset_create (); |
936 | plugin->ws = GNUNET_NETWORK_fdset_create (); | 906 | plugin->ws = GNUNET_NETWORK_fdset_create (); |
937 | GNUNET_NETWORK_fdset_zero (plugin->rs); | 907 | GNUNET_NETWORK_fdset_zero (plugin->rs); |
@@ -970,12 +940,9 @@ unix_transport_server_start (void *cls) | |||
970 | static int | 940 | static int |
971 | unix_check_address (void *cls, const void *addr, size_t addrlen) | 941 | unix_check_address (void *cls, const void *addr, size_t addrlen) |
972 | { | 942 | { |
973 | |||
974 | #if DEBUG_UNIX | ||
975 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 943 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
976 | "Informing transport service about my address `%s'\n", | 944 | "Informing transport service about my address `%s'\n", |
977 | (char *) addr); | 945 | (char *) addr); |
978 | #endif | ||
979 | return GNUNET_OK; | 946 | return GNUNET_OK; |
980 | } | 947 | } |
981 | 948 | ||