diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-12 08:33:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-12 08:33:23 +0000 |
commit | f29d8a789665fc11cf0bba8dfd90546dc0e5f737 (patch) | |
tree | 54b36063528e08590b6c2ebe0d2e3081dfb60a8b /src/integration-tests | |
parent | 1190d519e10ce36d662fd47b00bece99956a492c (diff) | |
download | gnunet-f29d8a789665fc11cf0bba8dfd90546dc0e5f737.tar.gz gnunet-f29d8a789665fc11cf0bba8dfd90546dc0e5f737.zip |
- cmd line arg
Diffstat (limited to 'src/integration-tests')
-rw-r--r-- | src/integration-tests/connection_watchdog.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c index ef1023a41..7ee858cfa 100644 --- a/src/integration-tests/connection_watchdog.c +++ b/src/integration-tests/connection_watchdog.c | |||
@@ -44,6 +44,7 @@ | |||
44 | * Final status code. | 44 | * Final status code. |
45 | */ | 45 | */ |
46 | static int ret; | 46 | static int ret; |
47 | static int ping; | ||
47 | 48 | ||
48 | static int have_tcp; | 49 | static int have_tcp; |
49 | static int have_udp; | 50 | static int have_udp; |
@@ -569,7 +570,7 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source) | |||
569 | if (GNUNET_NO == pc->transport_connected) | 570 | if (GNUNET_NO == pc->transport_connected) |
570 | { | 571 | { |
571 | pc->transport_connected = GNUNET_YES; | 572 | pc->transport_connected = GNUNET_YES; |
572 | if (NULL == pc->th_ping) | 573 | if ((GNUNET_YES == ping) && (NULL == pc->th_ping)) |
573 | pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, peer, sizeof (struct PING), UINT_MAX, GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc); | 574 | pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, peer, sizeof (struct PING), UINT_MAX, GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc); |
574 | else | 575 | else |
575 | GNUNET_break(0); | 576 | GNUNET_break(0); |
@@ -589,7 +590,7 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source) | |||
589 | if (GNUNET_NO == pc->core_connected) | 590 | if (GNUNET_NO == pc->core_connected) |
590 | { | 591 | { |
591 | pc->core_connected = GNUNET_YES; | 592 | pc->core_connected = GNUNET_YES; |
592 | if (NULL == pc->ch_ping) | 593 | if ((GNUNET_YES == ping) && (NULL == pc->ch_ping)) |
593 | pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, | 594 | pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, |
594 | GNUNET_NO, UINT_MAX, | 595 | GNUNET_NO, UINT_MAX, |
595 | GNUNET_TIME_relative_get_forever(), | 596 | GNUNET_TIME_relative_get_forever(), |
@@ -823,7 +824,7 @@ transport_notify_receive_cb (void *cls, | |||
823 | "TRANSPORT", | 824 | "TRANSPORT", |
824 | "PING", | 825 | "PING", |
825 | GNUNET_i2s (peer)) ; | 826 | GNUNET_i2s (peer)) ; |
826 | if (NULL == pc->th_pong) | 827 | if ((GNUNET_YES == ping) && (NULL == pc->th_pong)) |
827 | pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th, | 828 | pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th, |
828 | peer, sizeof (struct PONG), | 829 | peer, sizeof (struct PONG), |
829 | UINT_MAX, GNUNET_TIME_relative_get_forever(), | 830 | UINT_MAX, GNUNET_TIME_relative_get_forever(), |
@@ -863,7 +864,7 @@ int core_notify_receive_cb (void *cls, | |||
863 | "CORE", | 864 | "CORE", |
864 | "PING", | 865 | "PING", |
865 | GNUNET_i2s (peer)); | 866 | GNUNET_i2s (peer)); |
866 | if (NULL == pc->ch_pong) | 867 | if ((GNUNET_YES == ping) && (NULL == pc->ch_pong)) |
867 | pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch, | 868 | pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch, |
868 | GNUNET_NO, UINT_MAX, | 869 | GNUNET_NO, UINT_MAX, |
869 | GNUNET_TIME_relative_get_forever(), | 870 | GNUNET_TIME_relative_get_forever(), |
@@ -1056,8 +1057,10 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1056 | int | 1057 | int |
1057 | main (int argc, char *const *argv) | 1058 | main (int argc, char *const *argv) |
1058 | { | 1059 | { |
1060 | ping = GNUNET_NO; | ||
1059 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 1061 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
1060 | /* FIMXE: add options here */ | 1062 | {'p', "ping", NULL, gettext_noop ("Send ping messages to test connectivity (default == NO)"), |
1063 | GNUNET_NO, &GNUNET_GETOPT_set_one, &ping}, | ||
1061 | GNUNET_GETOPT_OPTION_END | 1064 | GNUNET_GETOPT_OPTION_END |
1062 | }; | 1065 | }; |
1063 | return (GNUNET_OK == | 1066 | return (GNUNET_OK == |