diff options
author | ng0 <ng0@n0.is> | 2019-09-06 22:46:29 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-06 22:46:29 +0000 |
commit | 6e599264ad13e8fc105493d74d7c11d46f8739ed (patch) | |
tree | 169bef1ecbade5a659831fb169f3ae6943af127f /src/transport/gnunet-transport.c | |
parent | 4f13bc15113021ebf71d5d81e99bc29f8a07fc9c (diff) | |
download | gnunet-6e599264ad13e8fc105493d74d7c11d46f8739ed.tar.gz gnunet-6e599264ad13e8fc105493d74d7c11d46f8739ed.zip |
first step to remove plibc
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r-- | src/transport/gnunet-transport.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 36c8fc451..ebc3f402d 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -402,7 +402,7 @@ shutdown_task (void *cls) | |||
402 | if (benchmark_send) | 402 | if (benchmark_send) |
403 | { | 403 | { |
404 | duration = GNUNET_TIME_absolute_get_duration (start_time); | 404 | duration = GNUNET_TIME_absolute_get_duration (start_time); |
405 | FPRINTF (stdout, | 405 | fprintf (stdout, |
406 | _ ("Transmitted %llu bytes/s (%llu bytes in %s)\n"), | 406 | _ ("Transmitted %llu bytes/s (%llu bytes in %s)\n"), |
407 | 1000LL * 1000LL * traffic_sent / (1 + duration.rel_value_us), | 407 | 1000LL * 1000LL * traffic_sent / (1 + duration.rel_value_us), |
408 | traffic_sent, | 408 | traffic_sent, |
@@ -411,7 +411,7 @@ shutdown_task (void *cls) | |||
411 | if (benchmark_receive) | 411 | if (benchmark_receive) |
412 | { | 412 | { |
413 | duration = GNUNET_TIME_absolute_get_duration (start_time); | 413 | duration = GNUNET_TIME_absolute_get_duration (start_time); |
414 | FPRINTF (stdout, | 414 | fprintf (stdout, |
415 | _ ("Received %llu bytes/s (%llu bytes in %s)\n"), | 415 | _ ("Received %llu bytes/s (%llu bytes in %s)\n"), |
416 | 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us), | 416 | 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us), |
417 | traffic_received, | 417 | traffic_received, |
@@ -451,7 +451,7 @@ operation_timeout (void *cls) | |||
451 | op_timeout = NULL; | 451 | op_timeout = NULL; |
452 | if ((benchmark_send) || (benchmark_receive)) | 452 | if ((benchmark_send) || (benchmark_receive)) |
453 | { | 453 | { |
454 | FPRINTF (stdout, _ ("Failed to connect to `%s'\n"), GNUNET_i2s_full (&pid)); | 454 | fprintf (stdout, _ ("Failed to connect to `%s'\n"), GNUNET_i2s_full (&pid)); |
455 | GNUNET_SCHEDULER_shutdown (); | 455 | GNUNET_SCHEDULER_shutdown (); |
456 | ret = 1; | 456 | ret = 1; |
457 | return; | 457 | return; |
@@ -462,7 +462,7 @@ operation_timeout (void *cls) | |||
462 | while (NULL != (cur = next)) | 462 | while (NULL != (cur = next)) |
463 | { | 463 | { |
464 | next = cur->next; | 464 | next = cur->next; |
465 | FPRINTF (stdout, | 465 | fprintf (stdout, |
466 | _ ("Failed to resolve address for peer `%s'\n"), | 466 | _ ("Failed to resolve address for peer `%s'\n"), |
467 | GNUNET_i2s (&cur->addrcp->peer)); | 467 | GNUNET_i2s (&cur->addrcp->peer)); |
468 | 468 | ||
@@ -472,7 +472,7 @@ operation_timeout (void *cls) | |||
472 | GNUNET_free (cur->addrcp); | 472 | GNUNET_free (cur->addrcp); |
473 | GNUNET_free (cur); | 473 | GNUNET_free (cur); |
474 | } | 474 | } |
475 | FPRINTF (stdout, | 475 | fprintf (stdout, |
476 | "%s", | 476 | "%s", |
477 | _ ("Failed to list connections, timeout occurred\n")); | 477 | _ ("Failed to list connections, timeout occurred\n")); |
478 | GNUNET_SCHEDULER_shutdown (); | 478 | GNUNET_SCHEDULER_shutdown (); |
@@ -500,7 +500,7 @@ do_send (void *cls) | |||
500 | traffic_sent += BLOCKSIZE * 1024; | 500 | traffic_sent += BLOCKSIZE * 1024; |
501 | GNUNET_MQ_notify_sent (env, &do_send, mq); | 501 | GNUNET_MQ_notify_sent (env, &do_send, mq); |
502 | if (verbosity > 0) | 502 | if (verbosity > 0) |
503 | FPRINTF (stdout, | 503 | fprintf (stdout, |
504 | _ ("Transmitting %u bytes\n"), | 504 | _ ("Transmitting %u bytes\n"), |
505 | (unsigned int) BLOCKSIZE * 1024); | 505 | (unsigned int) BLOCKSIZE * 1024); |
506 | GNUNET_MQ_send (mq, env); | 506 | GNUNET_MQ_send (mq, env); |
@@ -531,7 +531,7 @@ notify_connect (void *cls, | |||
531 | op_timeout = NULL; | 531 | op_timeout = NULL; |
532 | } | 532 | } |
533 | if (verbosity > 0) | 533 | if (verbosity > 0) |
534 | FPRINTF ( | 534 | fprintf ( |
535 | stdout, | 535 | stdout, |
536 | _ ( | 536 | _ ( |
537 | "Successfully connected to `%s', starting to send benchmark data in %u Kb blocks\n"), | 537 | "Successfully connected to `%s', starting to send benchmark data in %u Kb blocks\n"), |
@@ -562,7 +562,7 @@ notify_disconnect (void *cls, | |||
562 | return; /* not about target peer */ | 562 | return; /* not about target peer */ |
563 | if (! benchmark_send) | 563 | if (! benchmark_send) |
564 | return; /* not transmitting */ | 564 | return; /* not transmitting */ |
565 | FPRINTF (stdout, | 565 | fprintf (stdout, |
566 | _ ("Disconnected from peer `%s' while benchmarking\n"), | 566 | _ ("Disconnected from peer `%s' while benchmarking\n"), |
567 | GNUNET_i2s (&pid)); | 567 | GNUNET_i2s (&pid)); |
568 | } | 568 | } |
@@ -586,7 +586,7 @@ monitor_notify_connect (void *cls, | |||
586 | const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now); | 586 | const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now); |
587 | 587 | ||
588 | monitor_connect_counter++; | 588 | monitor_connect_counter++; |
589 | FPRINTF (stdout, | 589 | fprintf (stdout, |
590 | _ ("%24s: %-17s %4s (%u connections in total)\n"), | 590 | _ ("%24s: %-17s %4s (%u connections in total)\n"), |
591 | now_str, | 591 | now_str, |
592 | _ ("Connected to"), | 592 | _ ("Connected to"), |
@@ -615,7 +615,7 @@ monitor_notify_disconnect (void *cls, | |||
615 | GNUNET_assert (monitor_connect_counter > 0); | 615 | GNUNET_assert (monitor_connect_counter > 0); |
616 | monitor_connect_counter--; | 616 | monitor_connect_counter--; |
617 | 617 | ||
618 | FPRINTF (stdout, | 618 | fprintf (stdout, |
619 | _ ("%24s: %-17s %4s (%u connections in total)\n"), | 619 | _ ("%24s: %-17s %4s (%u connections in total)\n"), |
620 | now_str, | 620 | now_str, |
621 | _ ("Disconnected from"), | 621 | _ ("Disconnected from"), |
@@ -650,7 +650,7 @@ handle_dummy (void *cls, const struct GNUNET_MessageHeader *message) | |||
650 | if (! benchmark_receive) | 650 | if (! benchmark_receive) |
651 | return; | 651 | return; |
652 | if (verbosity > 0) | 652 | if (verbosity > 0) |
653 | FPRINTF (stdout, | 653 | fprintf (stdout, |
654 | _ ("Received %u bytes\n"), | 654 | _ ("Received %u bytes\n"), |
655 | (unsigned int) ntohs (message->size)); | 655 | (unsigned int) ntohs (message->size)); |
656 | if (0 == traffic_received) | 656 | if (0 == traffic_received) |
@@ -686,7 +686,7 @@ print_info (const struct GNUNET_PeerIdentity *id, | |||
686 | if (((GNUNET_YES == iterate_connections) && (GNUNET_YES == iterate_all)) || | 686 | if (((GNUNET_YES == iterate_connections) && (GNUNET_YES == iterate_all)) || |
687 | (GNUNET_YES == monitor_connections)) | 687 | (GNUNET_YES == monitor_connections)) |
688 | { | 688 | { |
689 | FPRINTF (stdout, | 689 | fprintf (stdout, |
690 | _ ("Peer `%s': %s %s in state `%s' until %s\n"), | 690 | _ ("Peer `%s': %s %s in state `%s' until %s\n"), |
691 | GNUNET_i2s (id), | 691 | GNUNET_i2s (id), |
692 | (NULL == transport) ? "<none>" : transport, | 692 | (NULL == transport) ? "<none>" : transport, |
@@ -698,7 +698,7 @@ print_info (const struct GNUNET_PeerIdentity *id, | |||
698 | (GNUNET_TRANSPORT_is_connected (state))) | 698 | (GNUNET_TRANSPORT_is_connected (state))) |
699 | { | 699 | { |
700 | /* Only connected peers, skip state */ | 700 | /* Only connected peers, skip state */ |
701 | FPRINTF (stdout, | 701 | fprintf (stdout, |
702 | _ ("Peer `%s': %s %s\n"), | 702 | _ ("Peer `%s': %s %s\n"), |
703 | GNUNET_i2s (id), | 703 | GNUNET_i2s (id), |
704 | transport, | 704 | transport, |
@@ -732,7 +732,7 @@ process_peer_string (void *cls, const char *address, int res) | |||
732 | { | 732 | { |
733 | if (GNUNET_SYSERR == res) | 733 | if (GNUNET_SYSERR == res) |
734 | { | 734 | { |
735 | FPRINTF ( | 735 | fprintf ( |
736 | stderr, | 736 | stderr, |
737 | "Failed to convert address for peer `%s' plugin `%s' length %u to string \n", | 737 | "Failed to convert address for peer `%s' plugin `%s' length %u to string \n", |
738 | GNUNET_i2s (&rc->addrcp->peer), | 738 | GNUNET_i2s (&rc->addrcp->peer), |
@@ -1094,7 +1094,7 @@ process_peer_monitoring_cb (void *cls, | |||
1094 | 1094 | ||
1095 | if (NULL == peer) | 1095 | if (NULL == peer) |
1096 | { | 1096 | { |
1097 | FPRINTF (stdout, | 1097 | fprintf (stdout, |
1098 | "%s", | 1098 | "%s", |
1099 | _ ( | 1099 | _ ( |
1100 | "Monitor disconnected from transport service. Reconnecting.\n")); | 1100 | "Monitor disconnected from transport service. Reconnecting.\n")); |
@@ -1189,7 +1189,7 @@ run (void *cls, | |||
1189 | 1189 | ||
1190 | if (1 < counter) | 1190 | if (1 < counter) |
1191 | { | 1191 | { |
1192 | FPRINTF ( | 1192 | fprintf ( |
1193 | stderr, | 1193 | stderr, |
1194 | _ ( | 1194 | _ ( |
1195 | "Multiple operations given. Please choose only one operation: %s, %s, %s, %s, %s, %s %s\n"), | 1195 | "Multiple operations given. Please choose only one operation: %s, %s, %s, %s, %s, %s %s\n"), |
@@ -1204,7 +1204,7 @@ run (void *cls, | |||
1204 | } | 1204 | } |
1205 | if (0 == counter) | 1205 | if (0 == counter) |
1206 | { | 1206 | { |
1207 | FPRINTF ( | 1207 | fprintf ( |
1208 | stderr, | 1208 | stderr, |
1209 | _ ( | 1209 | _ ( |
1210 | "No operation given. Please choose one operation: %s, %s, %s, %s, %s, %s, %s\n"), | 1210 | "No operation given. Please choose one operation: %s, %s, %s, %s, %s, %s, %s\n"), |
@@ -1222,7 +1222,7 @@ run (void *cls, | |||
1222 | { | 1222 | { |
1223 | if (0 == memcmp (&zero_pid, &pid, sizeof (pid))) | 1223 | if (0 == memcmp (&zero_pid, &pid, sizeof (pid))) |
1224 | { | 1224 | { |
1225 | FPRINTF (stderr, | 1225 | fprintf (stderr, |
1226 | _ ("Option `%s' makes no sense without option `%s'.\n"), | 1226 | _ ("Option `%s' makes no sense without option `%s'.\n"), |
1227 | "-D", | 1227 | "-D", |
1228 | "-p"); | 1228 | "-p"); |
@@ -1232,14 +1232,14 @@ run (void *cls, | |||
1232 | blacklist = GNUNET_TRANSPORT_blacklist (cfg, &blacklist_cb, NULL); | 1232 | blacklist = GNUNET_TRANSPORT_blacklist (cfg, &blacklist_cb, NULL); |
1233 | if (NULL == blacklist) | 1233 | if (NULL == blacklist) |
1234 | { | 1234 | { |
1235 | FPRINTF (stderr, | 1235 | fprintf (stderr, |
1236 | "%s", | 1236 | "%s", |
1237 | _ ( | 1237 | _ ( |
1238 | "Failed to connect to transport service for disconnection\n")); | 1238 | "Failed to connect to transport service for disconnection\n")); |
1239 | ret = 1; | 1239 | ret = 1; |
1240 | return; | 1240 | return; |
1241 | } | 1241 | } |
1242 | FPRINTF (stdout, | 1242 | fprintf (stdout, |
1243 | "%s", | 1243 | "%s", |
1244 | _ ("Blacklisting request in place, stop with CTRL-C\n")); | 1244 | _ ("Blacklisting request in place, stop with CTRL-C\n")); |
1245 | } | 1245 | } |
@@ -1247,7 +1247,7 @@ run (void *cls, | |||
1247 | { | 1247 | { |
1248 | if (0 == memcmp (&zero_pid, &pid, sizeof (pid))) | 1248 | if (0 == memcmp (&zero_pid, &pid, sizeof (pid))) |
1249 | { | 1249 | { |
1250 | FPRINTF (stderr, | 1250 | fprintf (stderr, |
1251 | _ ("Option `%s' makes no sense without option `%s'.\n"), | 1251 | _ ("Option `%s' makes no sense without option `%s'.\n"), |
1252 | "-s", | 1252 | "-s", |
1253 | "-p"); | 1253 | "-p"); |
@@ -1263,7 +1263,7 @@ run (void *cls, | |||
1263 | NULL); | 1263 | NULL); |
1264 | if (NULL == handle) | 1264 | if (NULL == handle) |
1265 | { | 1265 | { |
1266 | FPRINTF (stderr, "%s", _ ("Failed to connect to transport service\n")); | 1266 | fprintf (stderr, "%s", _ ("Failed to connect to transport service\n")); |
1267 | ret = 1; | 1267 | ret = 1; |
1268 | return; | 1268 | return; |
1269 | } | 1269 | } |
@@ -1289,12 +1289,12 @@ run (void *cls, | |||
1289 | NULL); | 1289 | NULL); |
1290 | if (NULL == handle) | 1290 | if (NULL == handle) |
1291 | { | 1291 | { |
1292 | FPRINTF (stderr, "%s", _ ("Failed to connect to transport service\n")); | 1292 | fprintf (stderr, "%s", _ ("Failed to connect to transport service\n")); |
1293 | ret = 1; | 1293 | ret = 1; |
1294 | return; | 1294 | return; |
1295 | } | 1295 | } |
1296 | if (verbosity > 0) | 1296 | if (verbosity > 0) |
1297 | FPRINTF (stdout, "%s", _ ("Starting to receive benchmark data\n")); | 1297 | fprintf (stdout, "%s", _ ("Starting to receive benchmark data\n")); |
1298 | start_time = GNUNET_TIME_absolute_get (); | 1298 | start_time = GNUNET_TIME_absolute_get (); |
1299 | } | 1299 | } |
1300 | else if (iterate_connections) /* -i: List information about peers once */ | 1300 | else if (iterate_connections) /* -i: List information about peers once */ |
@@ -1335,7 +1335,7 @@ run (void *cls, | |||
1335 | NULL); | 1335 | NULL); |
1336 | if (NULL == handle) | 1336 | if (NULL == handle) |
1337 | { | 1337 | { |
1338 | FPRINTF (stderr, "%s", _ ("Failed to connect to transport service\n")); | 1338 | fprintf (stderr, "%s", _ ("Failed to connect to transport service\n")); |
1339 | ret = 1; | 1339 | ret = 1; |
1340 | return; | 1340 | return; |
1341 | } | 1341 | } |