diff options
Diffstat (limited to 'src/transport/transport_api_cmd_connecting_peers.c')
-rw-r--r-- | src/transport/transport_api_cmd_connecting_peers.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c index fc925675d..296a98147 100644 --- a/src/transport/transport_api_cmd_connecting_peers.c +++ b/src/transport/transport_api_cmd_connecting_peers.c | |||
@@ -54,17 +54,25 @@ connect_peers_run (void *cls, | |||
54 | const struct GNUNET_TRANSPORT_ApplicationHandle *ah; | 54 | const struct GNUNET_TRANSPORT_ApplicationHandle *ah; |
55 | struct GNUNET_PeerIdentity *peer; | 55 | struct GNUNET_PeerIdentity *peer; |
56 | char *addr; | 56 | char *addr; |
57 | char *addr_and_port; | ||
57 | enum GNUNET_NetworkType nt = 0; | 58 | enum GNUNET_NetworkType nt = 0; |
58 | uint32_t num; | 59 | uint32_t num; |
59 | struct GNUNET_TESTING_NodeConnection *pos_connection; | 60 | struct GNUNET_TESTING_NodeConnection *pos_connection; |
60 | struct GNUNET_TESTING_AddressPrefix *pos_prefix; | 61 | struct GNUNET_TESTING_AddressPrefix *pos_prefix; |
61 | unsigned int con_num = 0; | 62 | unsigned int con_num = 0; |
63 | const enum GNUNET_GenericReturnValue *broadcast; | ||
64 | const enum GNUNET_GenericReturnValue *broadcast_pointer; | ||
65 | char *port; | ||
62 | 66 | ||
63 | cps->is = is; | 67 | cps->is = is; |
64 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 68 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
65 | cps->start_peer_label); | 69 | cps->start_peer_label); |
66 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, | 70 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, |
67 | &ah); | 71 | &ah); |
72 | GNUNET_TRANSPORT_get_trait_broadcast (peer1_cmd, | ||
73 | &broadcast); | ||
74 | |||
75 | // broadcast = *broadcast_pointer; | ||
68 | 76 | ||
69 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 77 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
70 | cps->create_label); | 78 | cps->create_label); |
@@ -93,19 +101,38 @@ connect_peers_run (void *cls, | |||
93 | pos_prefix->address_prefix); | 101 | pos_prefix->address_prefix); |
94 | if (NULL != addr) | 102 | if (NULL != addr) |
95 | { | 103 | { |
104 | if (0 == GNUNET_memcmp (pos_prefix->address_prefix, "udp")) | ||
105 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
106 | "validating memcmp\n"); | ||
107 | if (GNUNET_YES == *broadcast) | ||
108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
109 | "validating broadcast\n"); | ||
110 | if ((0 == GNUNET_memcmp (pos_prefix->address_prefix, "udp")) && | ||
111 | (GNUNET_YES == *broadcast) ) | ||
112 | GNUNET_asprintf (&addr_and_port, | ||
113 | "%s:2086", | ||
114 | addr); | ||
115 | else | ||
116 | GNUNET_asprintf (&addr_and_port, | ||
117 | "%s:60002", | ||
118 | addr); | ||
96 | peer = GNUNET_TESTING_get_pub_key (num, tl_system); | 119 | peer = GNUNET_TESTING_get_pub_key (num, tl_system); |
97 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
98 | "validating peer number %u with identity %s\n", | 121 | "validating peer number %u with identity %s and address %s %u %s\n", |
99 | num, | 122 | num, |
100 | GNUNET_i2s (peer)); | 123 | GNUNET_i2s (peer), |
124 | addr_and_port, | ||
125 | *broadcast, | ||
126 | pos_prefix->address_prefix); | ||
101 | GNUNET_TRANSPORT_application_validate ((struct | 127 | GNUNET_TRANSPORT_application_validate ((struct |
102 | GNUNET_TRANSPORT_ApplicationHandle | 128 | GNUNET_TRANSPORT_ApplicationHandle |
103 | *) ah, | 129 | *) ah, |
104 | peer, | 130 | peer, |
105 | nt, | 131 | nt, |
106 | addr); | 132 | addr_and_port); |
107 | GNUNET_free (peer); | 133 | GNUNET_free (peer); |
108 | GNUNET_free (addr); | 134 | GNUNET_free (addr); |
135 | GNUNET_free (addr_and_port); | ||
109 | } | 136 | } |
110 | } | 137 | } |
111 | } | 138 | } |
@@ -146,6 +173,12 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
146 | if (cps->con_num == con_num) | 173 | if (cps->con_num == con_num) |
147 | cps->additional_connects_notified++; | 174 | cps->additional_connects_notified++; |
148 | 175 | ||
176 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
177 | "con_num: %u add: %u num_notified: %u add_notified: %u\n", | ||
178 | cps->con_num, | ||
179 | cps->additional_connects, | ||
180 | cps->con_num_notified, | ||
181 | cps->additional_connects_notified); | ||
149 | if (cps->con_num + cps->additional_connects == cps->con_num_notified | 182 | if (cps->con_num + cps->additional_connects == cps->con_num_notified |
150 | + cps->additional_connects_notified) | 183 | + cps->additional_connects_notified) |
151 | { | 184 | { |