api changes
[oweals/gnunet.git] / src / integration-tests / connection_watchdog.c
index b0efb3941c4738f7ef57ddd18befa48c92375717..942059c915587635bde741d6b7b85a4c2085db17 100644 (file)
@@ -452,23 +452,25 @@ int map_ping_it (void *cls,
 {
   struct PeerContainer *pc = value;
 
-  if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping))
-    pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id,
-        sizeof (struct PING), UINT_MAX,
-        GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc);
-  else
-    GNUNET_break(0);
-
-  if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping))
-    pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
-                                             GNUNET_NO, UINT_MAX,
-                                             GNUNET_TIME_relative_get_forever(),
-                                             &pc->id,
-                                             sizeof (struct PING),
-                                             send_core_ping_cb, pc);
-  else
-    GNUNET_break (0);
+  if (ping == GNUNET_YES)
+  {
+    if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping))
+      pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id,
+          sizeof (struct PING), UINT_MAX,
+          GNUNET_TIME_relative_get_forever(), &send_transport_ping_cb, pc);
+    else
+      GNUNET_break(0);
 
+    if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping))
+      pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch,
+                                               GNUNET_NO, UINT_MAX,
+                                               GNUNET_TIME_relative_get_forever(),
+                                               &pc->id,
+                                               sizeof (struct PING),
+                                               send_core_ping_cb, pc);
+    else
+      GNUNET_break (0);
+  }
   return GNUNET_OK;
 }