aboutsummaryrefslogtreecommitdiff
path: root/src/integration-tests
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-04-12 08:40:08 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-04-12 08:40:08 +0000
commitc43c8adf0db4bcb8f2ab9837fdf4b9eaa7d140d2 (patch)
tree6c89e1991cfcf5eee917d5f84efff673ed648fe2 /src/integration-tests
parentf29d8a789665fc11cf0bba8dfd90546dc0e5f737 (diff)
downloadgnunet-c43c8adf0db4bcb8f2ab9837fdf4b9eaa7d140d2.tar.gz
gnunet-c43c8adf0db4bcb8f2ab9837fdf4b9eaa7d140d2.zip
- fix
Diffstat (limited to 'src/integration-tests')
-rw-r--r--src/integration-tests/connection_watchdog.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c
index 7ee858cfa..b0efb3941 100644
--- a/src/integration-tests/connection_watchdog.c
+++ b/src/integration-tests/connection_watchdog.c
@@ -570,10 +570,13 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source)
570 if (GNUNET_NO == pc->transport_connected) 570 if (GNUNET_NO == pc->transport_connected)
571 { 571 {
572 pc->transport_connected = GNUNET_YES; 572 pc->transport_connected = GNUNET_YES;
573 if ((GNUNET_YES == ping) && (NULL == pc->th_ping)) 573 if (GNUNET_YES == ping)
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 {
575 else 575 if (NULL == pc->th_ping)
576 GNUNET_break(0); 576 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);
577 else
578 GNUNET_break(0);
579 }
577 } 580 }
578 else 581 else
579 { 582 {
@@ -590,15 +593,18 @@ map_connect (const struct GNUNET_PeerIdentity *peer, void * source)
590 if (GNUNET_NO == pc->core_connected) 593 if (GNUNET_NO == pc->core_connected)
591 { 594 {
592 pc->core_connected = GNUNET_YES; 595 pc->core_connected = GNUNET_YES;
593 if ((GNUNET_YES == ping) && (NULL == pc->ch_ping)) 596 if (GNUNET_YES == ping)
594 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, 597 {
598 if (NULL == pc->ch_ping)
599 pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
595 GNUNET_NO, UINT_MAX, 600 GNUNET_NO, UINT_MAX,
596 GNUNET_TIME_relative_get_forever(), 601 GNUNET_TIME_relative_get_forever(),
597 peer, 602 peer,
598 sizeof (struct PING), 603 sizeof (struct PING),
599 send_core_ping_cb, pc); 604 send_core_ping_cb, pc);
600 else 605 else
601 GNUNET_break (0); 606 GNUNET_break (0);
607 }
602 } 608 }
603 else 609 else
604 { 610 {
@@ -824,13 +830,16 @@ transport_notify_receive_cb (void *cls,
824 "TRANSPORT", 830 "TRANSPORT",
825 "PING", 831 "PING",
826 GNUNET_i2s (peer)) ; 832 GNUNET_i2s (peer)) ;
827 if ((GNUNET_YES == ping) && (NULL == pc->th_pong)) 833 if (GNUNET_YES == ping)
828 pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th, 834 {
835 if (NULL == pc->th_pong)
836 pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th,
829 peer, sizeof (struct PONG), 837 peer, sizeof (struct PONG),
830 UINT_MAX, GNUNET_TIME_relative_get_forever(), 838 UINT_MAX, GNUNET_TIME_relative_get_forever(),
831 &send_transport_pong_cb, pc); 839 &send_transport_pong_cb, pc);
832 else 840 else
833 GNUNET_break (0); 841 GNUNET_break (0);
842 }
834 843
835 } 844 }
836 if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321))) 845 if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321)))
@@ -864,15 +873,18 @@ int core_notify_receive_cb (void *cls,
864 "CORE", 873 "CORE",
865 "PING", 874 "PING",
866 GNUNET_i2s (peer)); 875 GNUNET_i2s (peer));
867 if ((GNUNET_YES == ping) && (NULL == pc->ch_pong)) 876 if (GNUNET_YES == ping)
868 pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch, 877 {
878 if (NULL == pc->ch_pong)
879 pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch,
869 GNUNET_NO, UINT_MAX, 880 GNUNET_NO, UINT_MAX,
870 GNUNET_TIME_relative_get_forever(), 881 GNUNET_TIME_relative_get_forever(),
871 peer, 882 peer,
872 sizeof (struct PONG), 883 sizeof (struct PONG),
873 send_core_pong_cb, pc); 884 send_core_pong_cb, pc);
874 else 885 else
875 GNUNET_break (0); 886 GNUNET_break (0);
887 }
876 } 888 }
877 889
878 if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321))) 890 if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321)))