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