#define DEFAULT_NUM_PEERS 2
/* test records to resolve */
-#define TEST_DOMAIN "_sip._tcp.bob.gnunet"
+#define TEST_DOMAIN "_sip._tcp.bob.gads"
#define TEST_IP "127.0.0.1"
#define TEST_RECORD_NAME "sipserver"
#define TEST_RECORD_NAME_SRV "_sip._tcp"
#define TEST_SRV_NAME "sipserver.+"
-#define TEST_EXPECTED_SRV "sipserver.bob.gnunet"
+#define TEST_EXPECTED_SRV "sipserver.bob.gads"
#define TEST_AUTHORITY_NAME "bob"
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ die_task = GNUNET_SCHEDULER_NO_TASK;
if (NULL != gns_handle)
{
GNUNET_GNS_disconnect(gns_handle);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
+static void shutdown_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_GNS_disconnect(gns_handle);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
+ GNUNET_SCHEDULER_shutdown ();
+}
+
static void
on_lookup_result(void *cls, uint32_t rd_count,
const struct GNUNET_NAMESTORE_RecordData *rd)
}
}
- GNUNET_GNS_disconnect(gns_handle);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
- GNUNET_SCHEDULER_shutdown ();
+ GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+
}
sig,
NULL,
NULL);
+ GNUNET_free (sig);
rd.data_size = sizeof (struct srv_data)+strlen(TEST_SRV_NAME)+1;
srv_data->port = srv_port;
sig,
&commence_testing,
NULL);
- GNUNET_free(srv_data);
- GNUNET_free(sipserver);
- GNUNET_free(sig);
- GNUNET_CRYPTO_rsa_key_free(bob_key);
- GNUNET_CRYPTO_rsa_key_free(alice_key);
+ GNUNET_free (alice_keyfile);
+ GNUNET_free (srv_data);
+ GNUNET_free (sipserver);
+ GNUNET_free (sig);
+ GNUNET_CRYPTO_rsa_key_free (bob_key);
+ GNUNET_CRYPTO_rsa_key_free (alice_key);
}
#endif
NULL);
GNUNET_TESTING_peer_run ("test-gns-simple-srv-lookup", "test_gns_simple_lookup.conf", &do_check, NULL);
+ GNUNET_DISK_directory_remove ("test-gns-simple-srv-lookup");
return ok;
}