diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
commit | 7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 (patch) | |
tree | 5f1b18463f641f24fad519e0aefb60b97d707b52 /src/transport/gnunet-communicator-tcp.c | |
parent | 28ab2c446fba4980a8295d59fdf203a028a35dd6 (diff) | |
download | gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.tar.gz gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.zip |
merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188
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 e25cdf139..177b5c26c 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -577,7 +577,6 @@ struct Addresses | |||
577 | }; | 577 | }; |
578 | 578 | ||
579 | 579 | ||
580 | |||
581 | /** | 580 | /** |
582 | * Maximum queue length before we stop reading towards the transport service. | 581 | * Maximum queue length before we stop reading towards the transport service. |
583 | */ | 582 | */ |
@@ -1203,6 +1202,7 @@ queue_read (void *cls) | |||
1203 | queue_finish (queue); | 1202 | queue_finish (queue); |
1204 | } | 1203 | } |
1205 | 1204 | ||
1205 | |||
1206 | /** | 1206 | /** |
1207 | * Convert a `struct sockaddr_in6 to a `struct sockaddr *` | 1207 | * Convert a `struct sockaddr_in6 to a `struct sockaddr *` |
1208 | * | 1208 | * |
@@ -1234,6 +1234,7 @@ tcp_address_to_sockaddr_numeric_v6 (socklen_t *sock_len, struct sockaddr_in6 v6, | |||
1234 | return in; | 1234 | return in; |
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | |||
1237 | /** | 1238 | /** |
1238 | * Convert a `struct sockaddr_in4 to a `struct sockaddr *` | 1239 | * Convert a `struct sockaddr_in4 to a `struct sockaddr *` |
1239 | * | 1240 | * |
@@ -1257,6 +1258,7 @@ tcp_address_to_sockaddr_numeric_v4 (socklen_t *sock_len, struct sockaddr_in v4, | |||
1257 | return in; | 1258 | return in; |
1258 | } | 1259 | } |
1259 | 1260 | ||
1261 | |||
1260 | /** | 1262 | /** |
1261 | * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` | 1263 | * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` |
1262 | * | 1264 | * |
@@ -1318,6 +1320,7 @@ tcp_address_to_sockaddr_port_only (const char *bindto, unsigned int *port) | |||
1318 | return po; | 1320 | return po; |
1319 | } | 1321 | } |
1320 | 1322 | ||
1323 | |||
1321 | /** | 1324 | /** |
1322 | * This Method extracts the address part of the BINDTO string. | 1325 | * This Method extracts the address part of the BINDTO string. |
1323 | * | 1326 | * |
@@ -1344,7 +1347,8 @@ extract_address (const char *bindto) | |||
1344 | start++; /* skip over '['*/ | 1347 | start++; /* skip over '['*/ |
1345 | cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ | 1348 | cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ |
1346 | } | 1349 | } |
1347 | else { | 1350 | else |
1351 | { | ||
1348 | token = strtok_r (cp, "]", &rest); | 1352 | token = strtok_r (cp, "]", &rest); |
1349 | if (strlen (bindto) == strlen (token)) | 1353 | if (strlen (bindto) == strlen (token)) |
1350 | { | 1354 | { |
@@ -1362,6 +1366,7 @@ extract_address (const char *bindto) | |||
1362 | return start; | 1366 | return start; |
1363 | } | 1367 | } |
1364 | 1368 | ||
1369 | |||
1365 | /** | 1370 | /** |
1366 | * This Method extracts the port part of the BINDTO string. | 1371 | * This Method extracts the port part of the BINDTO string. |
1367 | * | 1372 | * |
@@ -1440,6 +1445,7 @@ extract_port (const char *addr_and_port) | |||
1440 | return port; | 1445 | return port; |
1441 | } | 1446 | } |
1442 | 1447 | ||
1448 | |||
1443 | /** | 1449 | /** |
1444 | * Convert TCP bind specification to a `struct sockaddr *` | 1450 | * Convert TCP bind specification to a `struct sockaddr *` |
1445 | * | 1451 | * |
@@ -2140,6 +2146,7 @@ queue_read_kx (void *cls) | |||
2140 | queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); | 2146 | queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); |
2141 | } | 2147 | } |
2142 | 2148 | ||
2149 | |||
2143 | /** | 2150 | /** |
2144 | * Function called by the transport service to initialize a | 2151 | * Function called by the transport service to initialize a |
2145 | * message queue given address information about another peer. | 2152 | * message queue given address information about another peer. |
@@ -2229,6 +2236,7 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address) | |||
2229 | return GNUNET_OK; | 2236 | return GNUNET_OK; |
2230 | } | 2237 | } |
2231 | 2238 | ||
2239 | |||
2232 | /** | 2240 | /** |
2233 | * Iterator over all message queues to clean up. | 2241 | * Iterator over all message queues to clean up. |
2234 | * | 2242 | * |
@@ -2367,6 +2375,7 @@ nat_address_cb (void *cls, | |||
2367 | } | 2375 | } |
2368 | } | 2376 | } |
2369 | 2377 | ||
2378 | |||
2370 | /** | 2379 | /** |
2371 | * This method launch network interactions for each address we like to bind to. | 2380 | * This method launch network interactions for each address we like to bind to. |
2372 | * | 2381 | * |
@@ -2474,7 +2483,7 @@ init_socket (const struct sockaddr *addr, | |||
2474 | if (NULL == queue_map) | 2483 | if (NULL == queue_map) |
2475 | queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); | 2484 | queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); |
2476 | 2485 | ||
2477 | if (NULL == ch ) | 2486 | if (NULL == ch) |
2478 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, | 2487 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, |
2479 | COMMUNICATOR_CONFIG_SECTION, | 2488 | COMMUNICATOR_CONFIG_SECTION, |
2480 | COMMUNICATOR_ADDRESS_PREFIX, | 2489 | COMMUNICATOR_ADDRESS_PREFIX, |
@@ -2496,6 +2505,7 @@ init_socket (const struct sockaddr *addr, | |||
2496 | 2505 | ||
2497 | } | 2506 | } |
2498 | 2507 | ||
2508 | |||
2499 | /** | 2509 | /** |
2500 | * This method reads from the DLL addrs_head to register them at the NAT service. | 2510 | * This method reads from the DLL addrs_head to register them at the NAT service. |
2501 | */ | 2511 | */ |
@@ -2557,6 +2567,7 @@ nat_register () | |||
2557 | } | 2567 | } |
2558 | } | 2568 | } |
2559 | 2569 | ||
2570 | |||
2560 | /** | 2571 | /** |
2561 | * This method adds addresses to the DLL, that are later register at the NAT service. | 2572 | * This method adds addresses to the DLL, that are later register at the NAT service. |
2562 | */ | 2573 | */ |
@@ -2573,6 +2584,7 @@ add_addr (struct sockaddr *in, socklen_t in_len) | |||
2573 | addrs_lens++; | 2584 | addrs_lens++; |
2574 | } | 2585 | } |
2575 | 2586 | ||
2587 | |||
2576 | /** | 2588 | /** |
2577 | * This method is the callback called by the resolver API, and wraps method init_socket. | 2589 | * This method is the callback called by the resolver API, and wraps method init_socket. |
2578 | * | 2590 | * |
@@ -2625,6 +2637,7 @@ init_socket_resolv (void *cls, | |||
2625 | } | 2637 | } |
2626 | } | 2638 | } |
2627 | 2639 | ||
2640 | |||
2628 | /** | 2641 | /** |
2629 | * Setup communicator and launch network interactions. | 2642 | * Setup communicator and launch network interactions. |
2630 | * | 2643 | * |