diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-17 07:12:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-17 07:12:23 +0000 |
commit | e2c7b8d6fe1bf17fe61686db3132fd909588fcdb (patch) | |
tree | dbd98c5ef40c865803081fa96292e13a7c7f59e5 | |
parent | b7adb36ac171d486b788f9f6272d43fcaad172ae (diff) | |
download | gnunet-e2c7b8d6fe1bf17fe61686db3132fd909588fcdb.tar.gz gnunet-e2c7b8d6fe1bf17fe61686db3132fd909588fcdb.zip |
removing breaks, adding stats
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 17 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 11 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index be1076ea1..f5d226f08 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1410,9 +1410,10 @@ tcp_plugin_get_session (void *cls, | |||
1410 | } | 1410 | } |
1411 | else | 1411 | else |
1412 | { | 1412 | { |
1413 | LOG (GNUNET_ERROR_TYPE_WARNING, | 1413 | GNUNET_STATISTICS_update (plugin->env->stats, |
1414 | _("Trying to create session for address of unexpected length %u (should be %u or %u)\n"), | 1414 | gettext_noop |
1415 | addrlen, sizeof (struct IPv4TcpAddress), sizeof (struct IPv6TcpAddress)); | 1415 | ("# requests to create session with invalid address"), |
1416 | 1, GNUNET_NO); | ||
1416 | return NULL; | 1417 | return NULL; |
1417 | } | 1418 | } |
1418 | 1419 | ||
@@ -1629,7 +1630,7 @@ void | |||
1629 | ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1630 | ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1630 | { | 1631 | { |
1631 | struct PrettyPrinterContext *ppc = cls; | 1632 | struct PrettyPrinterContext *ppc = cls; |
1632 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC %p was not removed!\n", ppc); | 1633 | /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC %p was not removed!\n", ppc); */ |
1633 | ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1634 | ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1634 | if (NULL != ppc->resolver_handle) | 1635 | if (NULL != ppc->resolver_handle) |
1635 | { | 1636 | { |
@@ -1654,7 +1655,7 @@ append_port (void *cls, const char *hostname) | |||
1654 | struct PrettyPrinterContext *ppc = cls; | 1655 | struct PrettyPrinterContext *ppc = cls; |
1655 | struct PrettyPrinterContext *cur; | 1656 | struct PrettyPrinterContext *cur; |
1656 | char *ret; | 1657 | char *ret; |
1657 | 1658 | /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC callback: %p `%s'\n",ppc, hostname); */ | |
1658 | if (hostname == NULL) | 1659 | if (hostname == NULL) |
1659 | { | 1660 | { |
1660 | ppc->asc (ppc->asc_cls, NULL); | 1661 | ppc->asc (ppc->asc_cls, NULL); |
@@ -1819,11 +1820,11 @@ tcp_plugin_check_address (void *cls, const void *addr, size_t addrlen) | |||
1819 | if ((addrlen != sizeof (struct IPv4TcpAddress)) && | 1820 | if ((addrlen != sizeof (struct IPv4TcpAddress)) && |
1820 | (addrlen != sizeof (struct IPv6TcpAddress))) | 1821 | (addrlen != sizeof (struct IPv6TcpAddress))) |
1821 | { | 1822 | { |
1822 | GNUNET_break_op (0); | ||
1823 | return GNUNET_SYSERR; | ||
1824 | } | ||
1825 | 1823 | ||
1826 | 1824 | ||
1825 | return GNUNET_SYSERR; | ||
1826 | } | ||
1827 | |||
1827 | if (addrlen == sizeof (struct IPv4TcpAddress)) | 1828 | if (addrlen == sizeof (struct IPv4TcpAddress)) |
1828 | { | 1829 | { |
1829 | v4 = (struct IPv4TcpAddress *) addr; | 1830 | v4 = (struct IPv4TcpAddress *) addr; |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index dcf47b7fa..be19c5de3 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -584,7 +584,6 @@ udp_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
584 | } | 584 | } |
585 | else | 585 | else |
586 | { | 586 | { |
587 | GNUNET_break_op (0); | ||
588 | return NULL; | 587 | return NULL; |
589 | } | 588 | } |
590 | inet_ntop (af, sb, buf, INET6_ADDRSTRLEN); | 589 | inet_ntop (af, sb, buf, INET6_ADDRSTRLEN); |
@@ -706,7 +705,7 @@ void | |||
706 | ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 705 | ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
707 | { | 706 | { |
708 | struct PrettyPrinterContext *ppc = cls; | 707 | struct PrettyPrinterContext *ppc = cls; |
709 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PPC %p was not removed!\n", ppc); | 708 | /* GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PPC %p was not removed!\n", ppc); */ |
710 | ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 709 | ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
711 | if (NULL != ppc->resolver_handle) | 710 | if (NULL != ppc->resolver_handle) |
712 | { | 711 | { |
@@ -731,7 +730,7 @@ append_port (void *cls, const char *hostname) | |||
731 | struct PrettyPrinterContext *ppc = cls; | 730 | struct PrettyPrinterContext *ppc = cls; |
732 | struct PrettyPrinterContext *cur; | 731 | struct PrettyPrinterContext *cur; |
733 | char *ret; | 732 | char *ret; |
734 | 733 | /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC callback: %p `%s'\n",ppc, hostname); */ | |
735 | if (hostname == NULL) | 734 | if (hostname == NULL) |
736 | { | 735 | { |
737 | ppc->asc (ppc->asc_cls, NULL); | 736 | ppc->asc (ppc->asc_cls, NULL); |
@@ -1069,7 +1068,6 @@ udp_plugin_check_address (void *cls, const void *addr, size_t addrlen) | |||
1069 | if ((addrlen != sizeof (struct IPv4UdpAddress)) && | 1068 | if ((addrlen != sizeof (struct IPv4UdpAddress)) && |
1070 | (addrlen != sizeof (struct IPv6UdpAddress))) | 1069 | (addrlen != sizeof (struct IPv6UdpAddress))) |
1071 | { | 1070 | { |
1072 | GNUNET_break_op (0); | ||
1073 | return GNUNET_SYSERR; | 1071 | return GNUNET_SYSERR; |
1074 | } | 1072 | } |
1075 | if (addrlen == sizeof (struct IPv4UdpAddress)) | 1073 | if (addrlen == sizeof (struct IPv4UdpAddress)) |
@@ -1451,7 +1449,10 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target, | |||
1451 | break; | 1449 | break; |
1452 | default: | 1450 | default: |
1453 | /* Must have a valid address to send to */ | 1451 | /* Must have a valid address to send to */ |
1454 | GNUNET_break_op (0); | 1452 | GNUNET_STATISTICS_update (plugin->env->stats, |
1453 | gettext_noop | ||
1454 | ("# requests to create session with invalid address"), | ||
1455 | 1, GNUNET_NO); | ||
1455 | return NULL; | 1456 | return NULL; |
1456 | } | 1457 | } |
1457 | s->addrlen = len; | 1458 | s->addrlen = len; |