summaryrefslogtreecommitdiff
path: root/src/transport/transport-testing2.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-26 15:14:03 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-26 15:14:03 +0100
commitb2ef30b3eb815fbb34a519581e1afc8bac393269 (patch)
treea47374db9d377a98eb3e5863ec532f550ebf8a16 /src/transport/transport-testing2.c
parent6edac715d38f2126ea7316373cfd27c3d76b05cf (diff)
-First message through TNG test done
Diffstat (limited to 'src/transport/transport-testing2.c')
-rw-r--r--src/transport/transport-testing2.c67
1 files changed, 37 insertions, 30 deletions
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index 1461915f0..789181d1f 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -328,6 +328,8 @@ notify_disconnect (void *cls,
}
}
+static void
+retrieve_hello (void *cls);
static void
hello_iter_cb (void *cb_cls,
@@ -339,6 +341,12 @@ hello_iter_cb (void *cb_cls,
{
p->pic = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Iteration End\n");
+ if (NULL != p->start_cb)
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Did not yet get my hello. Retrying...\n");
+ p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p);
+ }
return;
}
// Check record type et al?
@@ -536,12 +544,8 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct
// FIXME Error handling
p->ah = GNUNET_TRANSPORT_application_init (p->cfg);
GNUNET_assert (NULL != p->ah);
- // FIXME Error handleing
- p->rh_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (
- GNUNET_TIME_UNIT_SECONDS, 10),
- retrieve_hello,
- p);
- // GNUNET_assert (NULL != p->pic);
+ // FIXME Error handling
+ p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p);
return p;
}
@@ -667,7 +671,7 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
}
if (NULL != p->pic)
{
- // GNUNET_PEERSTORE_iterate_cancel (p->pic);
+ GNUNET_PEERSTORE_iterate_cancel (p->pic);
p->pic = NULL;
}
if (NULL != p->th)
@@ -675,19 +679,6 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
GNUNET_TRANSPORT_core_disconnect (p->th);
p->th = NULL;
}
- if (NULL != p->peer)
- {
- if (GNUNET_OK !=
- GNUNET_TESTING_peer_stop (p->peer))
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Testing lib failed to stop peer %u (`%s')\n",
- p->no,
- GNUNET_i2s (&p->id));
- }
- GNUNET_TESTING_peer_destroy (p->peer);
- p->peer = NULL;
- }
if (NULL != p->ats)
{
GNUNET_ATS_connectivity_done (p->ats);
@@ -700,9 +691,25 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
}
if (NULL != p->ph)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Disconnecting from PEERSTORE service\n");
GNUNET_PEERSTORE_disconnect (p->ph, GNUNET_NO);
p->ph = NULL;
}
+
+ if (NULL != p->peer)
+ {
+ if (GNUNET_OK !=
+ GNUNET_TESTING_peer_stop (p->peer))
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Testing lib failed to stop peer %u (`%s')\n",
+ p->no,
+ GNUNET_i2s (&p->id));
+ }
+ GNUNET_TESTING_peer_destroy (p->peer);
+ p->peer = NULL;
+ }
if (NULL != p->hello)
{
GNUNET_free (p->hello);
@@ -738,16 +745,16 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
* FIXME maybe schedule the application_validate somehow
*/
/*
-static void
-hello_offered (void *cls)
-{
- struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
-
- cc->oh = NULL;
- cc->tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
- &offer_hello,
- cc);
-}*/
+ static void
+ hello_offered (void *cls)
+ {
+ struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
+
+ cc->oh = NULL;
+ cc->tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ &offer_hello,
+ cc);
+ }*/
/**