diff options
author | t3sserakt <t3ss@posteo.de> | 2020-07-21 12:54:09 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2020-07-21 12:54:09 +0200 |
commit | 422e7a0319bbb6e8ae87d5d37ed5674b4daf1bcb (patch) | |
tree | 7d6110f17c24f98cf9f29721e0b8a74c93cb5af9 /src | |
parent | 5fa1c7dc809aebb55ef062cb3a2757c54eb6b7e7 (diff) | |
download | gnunet-422e7a0319bbb6e8ae87d5d37ed5674b4daf1bcb.tar.gz gnunet-422e7a0319bbb6e8ae87d5d37ed5674b4daf1bcb.zip |
- removed use of GNUNET_free_non_null
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index ec9f5986a..880145424 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -707,6 +707,7 @@ struct Addresses | |||
707 | }; | 707 | }; |
708 | 708 | ||
709 | 709 | ||
710 | |||
710 | /** | 711 | /** |
711 | * Maximum queue length before we stop reading towards the transport service. | 712 | * Maximum queue length before we stop reading towards the transport service. |
712 | */ | 713 | */ |
@@ -1617,7 +1618,6 @@ queue_read (void *cls) | |||
1617 | queue_finish (queue); | 1618 | queue_finish (queue); |
1618 | } | 1619 | } |
1619 | 1620 | ||
1620 | |||
1621 | /** | 1621 | /** |
1622 | * Convert a `struct sockaddr_in6 to a `struct sockaddr *` | 1622 | * Convert a `struct sockaddr_in6 to a `struct sockaddr *` |
1623 | * | 1623 | * |
@@ -1642,7 +1642,6 @@ tcp_address_to_sockaddr_numeric_v6 (socklen_t *sock_len, struct sockaddr_in6 v6, | |||
1642 | return in; | 1642 | return in; |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | |||
1646 | /** | 1645 | /** |
1647 | * Convert a `struct sockaddr_in4 to a `struct sockaddr *` | 1646 | * Convert a `struct sockaddr_in4 to a `struct sockaddr *` |
1648 | * | 1647 | * |
@@ -1666,7 +1665,6 @@ tcp_address_to_sockaddr_numeric_v4 (socklen_t *sock_len, struct sockaddr_in v4, | |||
1666 | return in; | 1665 | return in; |
1667 | } | 1666 | } |
1668 | 1667 | ||
1669 | |||
1670 | /** | 1668 | /** |
1671 | * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` | 1669 | * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` |
1672 | * | 1670 | * |
@@ -1726,7 +1724,6 @@ tcp_address_to_sockaddr_port_only (const char *bindto, unsigned int *port) | |||
1726 | return po; | 1724 | return po; |
1727 | } | 1725 | } |
1728 | 1726 | ||
1729 | |||
1730 | /** | 1727 | /** |
1731 | * This Method extracts the address part of the BINDTO string. | 1728 | * This Method extracts the address part of the BINDTO string. |
1732 | * | 1729 | * |
@@ -1753,8 +1750,7 @@ extract_address (const char *bindto) | |||
1753 | start++; /* skip over '['*/ | 1750 | start++; /* skip over '['*/ |
1754 | cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ | 1751 | cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ |
1755 | } | 1752 | } |
1756 | else | 1753 | else { |
1757 | { | ||
1758 | token = strtok_r (cp, "]", &rest); | 1754 | token = strtok_r (cp, "]", &rest); |
1759 | if (strlen (bindto) == strlen (token)) | 1755 | if (strlen (bindto) == strlen (token)) |
1760 | { | 1756 | { |
@@ -1772,7 +1768,6 @@ extract_address (const char *bindto) | |||
1772 | return start; | 1768 | return start; |
1773 | } | 1769 | } |
1774 | 1770 | ||
1775 | |||
1776 | /** | 1771 | /** |
1777 | * This Method extracts the port part of the BINDTO string. | 1772 | * This Method extracts the port part of the BINDTO string. |
1778 | * | 1773 | * |
@@ -1851,7 +1846,6 @@ extract_port (const char *addr_and_port) | |||
1851 | return port; | 1846 | return port; |
1852 | } | 1847 | } |
1853 | 1848 | ||
1854 | |||
1855 | /** | 1849 | /** |
1856 | * Convert TCP bind specification to a `struct sockaddr *` | 1850 | * Convert TCP bind specification to a `struct sockaddr *` |
1857 | * | 1851 | * |
@@ -2689,7 +2683,6 @@ queue_read_kx (void *cls) | |||
2689 | queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); | 2683 | queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); |
2690 | } | 2684 | } |
2691 | 2685 | ||
2692 | |||
2693 | /** | 2686 | /** |
2694 | * Function called by the transport service to initialize a | 2687 | * Function called by the transport service to initialize a |
2695 | * message queue given address information about another peer. | 2688 | * message queue given address information about another peer. |
@@ -2784,7 +2777,6 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address) | |||
2784 | return GNUNET_OK; | 2777 | return GNUNET_OK; |
2785 | } | 2778 | } |
2786 | 2779 | ||
2787 | |||
2788 | /** | 2780 | /** |
2789 | * Iterator over all message queues to clean up. | 2781 | * Iterator over all message queues to clean up. |
2790 | * | 2782 | * |
@@ -2919,7 +2911,6 @@ nat_address_cb (void *cls, | |||
2919 | } | 2911 | } |
2920 | } | 2912 | } |
2921 | 2913 | ||
2922 | |||
2923 | /** | 2914 | /** |
2924 | * This method launch network interactions for each address we like to bind to. | 2915 | * This method launch network interactions for each address we like to bind to. |
2925 | * | 2916 | * |
@@ -3024,7 +3015,7 @@ init_socket (const struct sockaddr *addr, | |||
3024 | if (NULL == queue_map) | 3015 | if (NULL == queue_map) |
3025 | queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); | 3016 | queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); |
3026 | 3017 | ||
3027 | if (NULL == ch) | 3018 | if (NULL == ch ) |
3028 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, | 3019 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, |
3029 | COMMUNICATOR_CONFIG_SECTION, | 3020 | COMMUNICATOR_CONFIG_SECTION, |
3030 | COMMUNICATOR_ADDRESS_PREFIX, | 3021 | COMMUNICATOR_ADDRESS_PREFIX, |
@@ -3047,7 +3038,6 @@ init_socket (const struct sockaddr *addr, | |||
3047 | 3038 | ||
3048 | } | 3039 | } |
3049 | 3040 | ||
3050 | |||
3051 | /** | 3041 | /** |
3052 | * This method reads from the DLL addrs_head to register them at the NAT service. | 3042 | * This method reads from the DLL addrs_head to register them at the NAT service. |
3053 | */ | 3043 | */ |
@@ -3090,8 +3080,8 @@ nat_register () | |||
3090 | 3080 | ||
3091 | /*for (i = addrs_lens - 1; i >= 0; i--) | 3081 | /*for (i = addrs_lens - 1; i >= 0; i--) |
3092 | GNUNET_free (saddrs[i]);*/ | 3082 | GNUNET_free (saddrs[i]);*/ |
3093 | GNUNET_free_non_null (saddrs); | 3083 | GNUNET_free (saddrs); |
3094 | GNUNET_free_non_null (saddr_lens); | 3084 | GNUNET_free (saddr_lens); |
3095 | 3085 | ||
3096 | if (NULL == nat) | 3086 | if (NULL == nat) |
3097 | { | 3087 | { |
@@ -3102,7 +3092,6 @@ nat_register () | |||
3102 | } | 3092 | } |
3103 | } | 3093 | } |
3104 | 3094 | ||
3105 | |||
3106 | /** | 3095 | /** |
3107 | * This method adds addresses to the DLL, that are later register at the NAT service. | 3096 | * This method adds addresses to the DLL, that are later register at the NAT service. |
3108 | */ | 3097 | */ |
@@ -3119,7 +3108,6 @@ add_addr (struct sockaddr *in, socklen_t in_len) | |||
3119 | addrs_lens++; | 3108 | addrs_lens++; |
3120 | } | 3109 | } |
3121 | 3110 | ||
3122 | |||
3123 | /** | 3111 | /** |
3124 | * This method is the callback called by the resolver API, and wraps method init_socket. | 3112 | * This method is the callback called by the resolver API, and wraps method init_socket. |
3125 | * | 3113 | * |
@@ -3172,7 +3160,6 @@ init_socket_resolv (void *cls, | |||
3172 | } | 3160 | } |
3173 | } | 3161 | } |
3174 | 3162 | ||
3175 | |||
3176 | /** | 3163 | /** |
3177 | * Setup communicator and launch network interactions. | 3164 | * Setup communicator and launch network interactions. |
3178 | * | 3165 | * |