aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-09-23 14:26:55 +0000
committerGabor X Toth <*@tg-x.net>2016-09-23 14:26:55 +0000
commit451fd32170103921993d876d765a8755ce737a0b (patch)
treead41cd960f7f8b0f80d9967332ffc0a85e9cb0c1 /src
parent3e872864741aaa83be947b614eafb4fef2c74253 (diff)
downloadgnunet-451fd32170103921993d876d765a8755ce737a0b.tar.gz
gnunet-451fd32170103921993d876d765a8755ce737a0b.zip
multicast,psyc,social: remove core dependencny
Diffstat (limited to 'src')
-rw-r--r--src/multicast/Makefile.am7
-rw-r--r--src/multicast/gnunet-service-multicast.c46
-rw-r--r--src/multicast/test_multicast.c23
-rw-r--r--src/multicast/test_multicast_multipeer.c1
-rw-r--r--src/psyc/Makefile.am1
-rw-r--r--src/psyc/test_psyc.c32
-rw-r--r--src/social/Makefile.am3
-rw-r--r--src/social/gnunet-service-social.c19
-rw-r--r--src/social/gnunet-social.c22
-rw-r--r--src/social/test_social.c31
10 files changed, 36 insertions, 149 deletions
diff --git a/src/multicast/Makefile.am b/src/multicast/Makefile.am
index 64c0bfe1d..b1f422765 100644
--- a/src/multicast/Makefile.am
+++ b/src/multicast/Makefile.am
@@ -45,7 +45,6 @@ gnunet_service_multicast_SOURCES = \
45 gnunet-service-multicast.c 45 gnunet-service-multicast.c
46gnunet_service_multicast_LDADD = \ 46gnunet_service_multicast_LDADD = \
47 $(top_builddir)/src/util/libgnunetutil.la \ 47 $(top_builddir)/src/util/libgnunetutil.la \
48 $(top_builddir)/src/core/libgnunetcore.la \
49 $(top_builddir)/src/cadet/libgnunetcadet.la \ 48 $(top_builddir)/src/cadet/libgnunetcadet.la \
50 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 49 $(top_builddir)/src/statistics/libgnunetstatistics.la \
51 $(GN_LIBINTL) 50 $(GN_LIBINTL)
@@ -65,13 +64,11 @@ test_multicast_SOURCES = \
65test_multicast_LDADD = \ 64test_multicast_LDADD = \
66 libgnunetmulticast.la \ 65 libgnunetmulticast.la \
67 $(top_builddir)/src/testing/libgnunettesting.la \ 66 $(top_builddir)/src/testing/libgnunettesting.la \
68 $(top_builddir)/src/util/libgnunetutil.la \ 67 $(top_builddir)/src/util/libgnunetutil.la
69 $(top_builddir)/src/core/libgnunetcore.la
70 68
71test_multicast_multipeer_SOURCE = \ 69test_multicast_multipeer_SOURCE = \
72 test_multicast_multipeer.c 70 test_multicast_multipeer.c
73test_multicast_multipeer_LDADD = \ 71test_multicast_multipeer_LDADD = \
74 libgnunetmulticast.la \ 72 libgnunetmulticast.la \
75 $(top_builddir)/src/testbed/libgnunettestbed.la \ 73 $(top_builddir)/src/testbed/libgnunettestbed.la \
76 $(top_builddir)/src/util/libgnunetutil.la \ 74 $(top_builddir)/src/util/libgnunetutil.la
77 $(top_builddir)/src/core/libgnunetcore.la
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index af530e27a..5f8b1cdb6 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -28,7 +28,6 @@
28#include "gnunet_signatures.h" 28#include "gnunet_signatures.h"
29#include "gnunet_applications.h" 29#include "gnunet_applications.h"
30#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
31#include "gnunet_core_service.h"
32#include "gnunet_cadet_service.h" 31#include "gnunet_cadet_service.h"
33#include "gnunet_multicast_service.h" 32#include "gnunet_multicast_service.h"
34#include "multicast.h" 33#include "multicast.h"
@@ -44,12 +43,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
44static struct GNUNET_SERVER_Handle *server; 43static struct GNUNET_SERVER_Handle *server;
45 44
46/** 45/**
47 * Core handle.
48 * Only used during initialization.
49 */
50static struct GNUNET_CORE_Handle *core;
51
52/**
53 * CADET handle. 46 * CADET handle.
54 */ 47 */
55static struct GNUNET_CADET_Handle *cadet; 48static struct GNUNET_CADET_Handle *cadet;
@@ -341,11 +334,6 @@ struct ReplayRequestKey
341static void 334static void
342shutdown_task (void *cls) 335shutdown_task (void *cls)
343{ 336{
344 if (NULL != core)
345 {
346 GNUNET_CORE_disconnecT (core);
347 core = NULL;
348 }
349 if (NULL != cadet) 337 if (NULL != cadet)
350 { 338 {
351 GNUNET_CADET_disconnect (cadet); 339 GNUNET_CADET_disconnect (cadet);
@@ -1846,12 +1834,21 @@ static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
1846 1834
1847 1835
1848/** 1836/**
1849 * Connected to core service. 1837 * Service started.
1838 *
1839 * @param cls closure
1840 * @param server the initialized server
1841 * @param cfg configuration to use
1850 */ 1842 */
1851static void 1843static void
1852core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity) 1844run (void *cls,
1845 struct GNUNET_SERVER_Handle *srv,
1846 const struct GNUNET_CONFIGURATION_Handle *c)
1853{ 1847{
1854 this_peer = *my_identity; 1848 cfg = c;
1849 server = srv;
1850 GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
1851 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
1855 1852
1856 stats = GNUNET_STATISTICS_create ("multicast", cfg); 1853 stats = GNUNET_STATISTICS_create ("multicast", cfg);
1857 origins = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); 1854 origins = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
@@ -1877,25 +1874,6 @@ core_connected_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1877 1874
1878 1875
1879/** 1876/**
1880 * Service started.
1881 *
1882 * @param cls closure
1883 * @param server the initialized server
1884 * @param cfg configuration to use
1885 */
1886static void
1887run (void *cls,
1888 struct GNUNET_SERVER_Handle *srv,
1889 const struct GNUNET_CONFIGURATION_Handle *c)
1890{
1891 cfg = c;
1892 server = srv;
1893 GNUNET_SERVER_connect_notify (server, &client_notify_connect, NULL);
1894 core = GNUNET_CORE_connecT (cfg, NULL, &core_connected_cb, NULL, NULL, NULL);
1895}
1896
1897
1898/**
1899 * The main function for the multicast service. 1877 * The main function for the multicast service.
1900 * 1878 *
1901 * @param argc number of arguments from the command line 1879 * @param argc number of arguments from the command line
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c
index 44c62f677..1e3a4922b 100644
--- a/src/multicast/test_multicast.c
+++ b/src/multicast/test_multicast.c
@@ -31,7 +31,6 @@
31#include "gnunet_common.h" 31#include "gnunet_common.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_testing_lib.h" 33#include "gnunet_testing_lib.h"
34#include "gnunet_core_service.h"
35#include "gnunet_multicast_service.h" 34#include "gnunet_multicast_service.h"
36 35
37#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 36#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
@@ -48,7 +47,6 @@ static struct GNUNET_SCHEDULER_Task * end_badly_task;
48 47
49static const struct GNUNET_CONFIGURATION_Handle *cfg; 48static const struct GNUNET_CONFIGURATION_Handle *cfg;
50 49
51struct GNUNET_CORE_Handle *core;
52struct GNUNET_PeerIdentity this_peer; 50struct GNUNET_PeerIdentity this_peer;
53 51
54struct GNUNET_MULTICAST_Origin *origin; 52struct GNUNET_MULTICAST_Origin *origin;
@@ -110,11 +108,6 @@ member_join (int t);
110static void 108static void
111cleanup () 109cleanup ()
112{ 110{
113 if (NULL != core)
114 {
115 GNUNET_CORE_disconnecT (core);
116 core = NULL;
117 }
118 if (NULL != member) 111 if (NULL != member)
119 { 112 {
120 GNUNET_MULTICAST_member_part (member, NULL, NULL); 113 GNUNET_MULTICAST_member_part (member, NULL, NULL);
@@ -705,16 +698,6 @@ origin_start ()
705} 698}
706 699
707 700
708static void
709core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
710{
711 this_peer = *my_identity;
712
713 // Test 1 starts here
714 origin_start ();
715}
716
717
718/** 701/**
719 * Main function of the test, run from scheduler. 702 * Main function of the test, run from scheduler.
720 * 703 *
@@ -737,8 +720,10 @@ run (void *cls,
737 cfg = c; 720 cfg = c;
738 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 721 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
739 &end_badly, NULL); 722 &end_badly, NULL);
740 core = GNUNET_CORE_connecT (cfg, NULL, 723 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
741 &core_connected, NULL, NULL, NULL); 724
725 // Test 1 starts here
726 origin_start ();
742} 727}
743 728
744 729
diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c
index 2e8b9818d..3edf0153e 100644
--- a/src/multicast/test_multicast_multipeer.c
+++ b/src/multicast/test_multicast_multipeer.c
@@ -31,7 +31,6 @@
31#include "gnunet_common.h" 31#include "gnunet_common.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_testbed_service.h" 33#include "gnunet_testbed_service.h"
34#include "gnunet_core_service.h"
35#include "gnunet_multicast_service.h" 34#include "gnunet_multicast_service.h"
36 35
37#define NUM_PEERS 2 36#define NUM_PEERS 2
diff --git a/src/psyc/Makefile.am b/src/psyc/Makefile.am
index e00537e73..0016b1b3b 100644
--- a/src/psyc/Makefile.am
+++ b/src/psyc/Makefile.am
@@ -63,7 +63,6 @@ test_psyc_LDADD = \
63 libgnunetpsyc.la \ 63 libgnunetpsyc.la \
64 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ 64 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
65 $(top_builddir)/src/testing/libgnunettesting.la \ 65 $(top_builddir)/src/testing/libgnunettesting.la \
66 $(top_builddir)/src/core/libgnunetcore.la \
67 $(top_builddir)/src/util/libgnunetutil.la 66 $(top_builddir)/src/util/libgnunetutil.la
68 67
69EXTRA_DIST = \ 68EXTRA_DIST = \
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c
index d1846b8cc..03a1890b1 100644
--- a/src/psyc/test_psyc.c
+++ b/src/psyc/test_psyc.c
@@ -34,7 +34,6 @@
34#include "gnunet_testing_lib.h" 34#include "gnunet_testing_lib.h"
35#include "gnunet_psyc_util_lib.h" 35#include "gnunet_psyc_util_lib.h"
36#include "gnunet_psyc_service.h" 36#include "gnunet_psyc_service.h"
37#include "gnunet_core_service.h"
38 37
39#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 38#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
40 39
@@ -45,7 +44,6 @@ static int res;
45 44
46static const struct GNUNET_CONFIGURATION_Handle *cfg; 45static const struct GNUNET_CONFIGURATION_Handle *cfg;
47 46
48static struct GNUNET_CORE_Handle *core;
49static struct GNUNET_PeerIdentity this_peer; 47static struct GNUNET_PeerIdentity this_peer;
50 48
51/** 49/**
@@ -143,11 +141,6 @@ slave_parted (void *cls)
143static void 141static void
144cleanup () 142cleanup ()
145{ 143{
146 if (NULL != core)
147 {
148 GNUNET_CORE_disconnecT (core);
149 core = NULL;
150 }
151 if (NULL != slv) 144 if (NULL != slv)
152 { 145 {
153 GNUNET_PSYC_slave_part (slv, GNUNET_NO, &slave_parted, NULL); 146 GNUNET_PSYC_slave_part (slv, GNUNET_NO, &slave_parted, NULL);
@@ -951,21 +944,6 @@ schedule_master_start (void *cls)
951} 944}
952 945
953 946
954static void
955core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
956{
957 this_peer = *my_identity;
958
959#if DEBUG_TEST_PSYC
960 master_start ();
961#else
962 /* Allow some time for the services to initialize. */
963 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
964 &schedule_master_start, NULL);
965#endif
966
967}
968
969/** 947/**
970 * Main function of the test, run from scheduler. 948 * Main function of the test, run from scheduler.
971 * 949 *
@@ -986,13 +964,21 @@ run (void *cls,
986 cfg = c; 964 cfg = c;
987 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); 965 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
988 966
967 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
968
989 channel_key = GNUNET_CRYPTO_eddsa_key_create (); 969 channel_key = GNUNET_CRYPTO_eddsa_key_create ();
990 slave_key = GNUNET_CRYPTO_ecdsa_key_create (); 970 slave_key = GNUNET_CRYPTO_ecdsa_key_create ();
991 971
992 GNUNET_CRYPTO_eddsa_key_get_public (channel_key, &channel_pub_key); 972 GNUNET_CRYPTO_eddsa_key_get_public (channel_key, &channel_pub_key);
993 GNUNET_CRYPTO_ecdsa_key_get_public (slave_key, &slave_pub_key); 973 GNUNET_CRYPTO_ecdsa_key_get_public (slave_key, &slave_pub_key);
994 974
995 core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL); 975#if DEBUG_TEST_PSYC
976 master_start ();
977#else
978 /* Allow some time for the services to initialize. */
979 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
980 &schedule_master_start, NULL);
981#endif
996} 982}
997 983
998 984
diff --git a/src/social/Makefile.am b/src/social/Makefile.am
index fb761dcae..693a61411 100644
--- a/src/social/Makefile.am
+++ b/src/social/Makefile.am
@@ -41,7 +41,6 @@ gnunet_social_SOURCES = \
41gnunet_social_LDADD = \ 41gnunet_social_LDADD = \
42 libgnunetsocial.la \ 42 libgnunetsocial.la \
43 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ 43 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
44 $(top_builddir)/src/core/libgnunetcore.la \
45 $(top_builddir)/src/util/libgnunetutil.la 44 $(top_builddir)/src/util/libgnunetutil.la
46 45
47gnunet_service_social_SOURCES = \ 46gnunet_service_social_SOURCES = \
@@ -51,7 +50,6 @@ gnunet_service_social_LDADD = \
51 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 50 $(top_builddir)/src/statistics/libgnunetstatistics.la \
52 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ 51 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
53 $(top_builddir)/src/psyc/libgnunetpsyc.la \ 52 $(top_builddir)/src/psyc/libgnunetpsyc.la \
54 $(top_builddir)/src/core/libgnunetcore.la \
55 $(top_builddir)/src/identity/libgnunetidentity.la \ 53 $(top_builddir)/src/identity/libgnunetidentity.la \
56 $(top_builddir)/src/gns/libgnunetgns.la \ 54 $(top_builddir)/src/gns/libgnunetgns.la \
57 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 55 $(top_builddir)/src/namestore/libgnunetnamestore.la \
@@ -75,7 +73,6 @@ test_social_LDADD = \
75 $(top_builddir)/src/testing/libgnunettesting.la \ 73 $(top_builddir)/src/testing/libgnunettesting.la \
76 $(top_builddir)/src/util/libgnunetutil.la \ 74 $(top_builddir)/src/util/libgnunetutil.la \
77 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ 75 $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
78 $(top_builddir)/src/core/libgnunetcore.la \
79 $(top_builddir)/src/identity/libgnunetidentity.la 76 $(top_builddir)/src/identity/libgnunetidentity.la
80 77
81EXTRA_DIST = \ 78EXTRA_DIST = \
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index 01a624e2a..681d469bc 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -31,7 +31,6 @@
31#include "gnunet_util_lib.h" 31#include "gnunet_util_lib.h"
32#include "gnunet_constants.h" 32#include "gnunet_constants.h"
33#include "gnunet_protocols.h" 33#include "gnunet_protocols.h"
34#include "gnunet_core_service.h"
35#include "gnunet_identity_service.h" 34#include "gnunet_identity_service.h"
36#include "gnunet_namestore_service.h" 35#include "gnunet_namestore_service.h"
37#include "gnunet_gns_service.h" 36#include "gnunet_gns_service.h"
@@ -48,7 +47,6 @@
48static const struct GNUNET_CONFIGURATION_Handle *cfg; 47static const struct GNUNET_CONFIGURATION_Handle *cfg;
49 48
50/* Handles to other services */ 49/* Handles to other services */
51static struct GNUNET_CORE_Handle *core;
52static struct GNUNET_IDENTITY_Handle *id; 50static struct GNUNET_IDENTITY_Handle *id;
53static struct GNUNET_GNS_Handle *gns; 51static struct GNUNET_GNS_Handle *gns;
54static struct GNUNET_NAMESTORE_Handle *namestore; 52static struct GNUNET_NAMESTORE_Handle *namestore;
@@ -454,11 +452,6 @@ shutdown_task (void *cls)
454 GNUNET_SERVER_notification_context_destroy (nc); 452 GNUNET_SERVER_notification_context_destroy (nc);
455 nc = NULL; 453 nc = NULL;
456 } 454 }
457 if (NULL != core)
458 {
459 GNUNET_CORE_disconnecT (core);
460 core = NULL;
461 }
462 if (NULL != id) 455 if (NULL != id)
463 { 456 {
464 GNUNET_IDENTITY_disconnect (id); 457 GNUNET_IDENTITY_disconnect (id);
@@ -3468,16 +3461,6 @@ identity_recv_ego (void *cls, struct GNUNET_IDENTITY_Ego *id_ego,
3468 3461
3469 3462
3470/** 3463/**
3471 * Connected to core service.
3472 */
3473static void
3474core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
3475{
3476 this_peer = *my_identity;
3477}
3478
3479
3480/**
3481 * Initialize the PSYC service. 3464 * Initialize the PSYC service.
3482 * 3465 *
3483 * @param cls Closure. 3466 * @param cls Closure.
@@ -3489,6 +3472,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
3489 const struct GNUNET_CONFIGURATION_Handle *c) 3472 const struct GNUNET_CONFIGURATION_Handle *c)
3490{ 3473{
3491 cfg = c; 3474 cfg = c;
3475 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
3492 3476
3493 hosts = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); 3477 hosts = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
3494 guests = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); 3478 guests = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
@@ -3500,7 +3484,6 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
3500 apps_places = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO); 3484 apps_places = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO);
3501 places_apps = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO); 3485 places_apps = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_NO);
3502 3486
3503 core = GNUNET_CORE_connecT (cfg, NULL, core_connected, NULL, NULL, NULL);
3504 id = GNUNET_IDENTITY_connect (cfg, &identity_recv_ego, NULL); 3487 id = GNUNET_IDENTITY_connect (cfg, &identity_recv_ego, NULL);
3505 gns = GNUNET_GNS_connect (cfg); 3488 gns = GNUNET_GNS_connect (cfg);
3506 namestore = GNUNET_NAMESTORE_connect (cfg); 3489 namestore = GNUNET_NAMESTORE_connect (cfg);
diff --git a/src/social/gnunet-social.c b/src/social/gnunet-social.c
index 98a48c294..afd06028c 100644
--- a/src/social/gnunet-social.c
+++ b/src/social/gnunet-social.c
@@ -29,7 +29,6 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_social_service.h" 31#include "gnunet_social_service.h"
32#include "gnunet_core_service.h"
33 32
34#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
35 34
@@ -139,7 +138,6 @@ struct GNUNET_SCHEDULER_Task *timeout_task;
139 138
140const struct GNUNET_CONFIGURATION_Handle *cfg; 139const struct GNUNET_CONFIGURATION_Handle *cfg;
141 140
142struct GNUNET_CORE_Handle *core;
143struct GNUNET_PeerIdentity peer, this_peer; 141struct GNUNET_PeerIdentity peer, this_peer;
144 142
145struct GNUNET_SOCIAL_App *app; 143struct GNUNET_SOCIAL_App *app;
@@ -1086,9 +1084,6 @@ app_recv_ego (void *cls,
1086static void 1084static void
1087app_connect (void *cls) 1085app_connect (void *cls)
1088{ 1086{
1089 GNUNET_CORE_disconnecT (core);
1090 core = NULL;
1091
1092 app = GNUNET_SOCIAL_app_connect (cfg, opt_app, 1087 app = GNUNET_SOCIAL_app_connect (cfg, opt_app,
1093 app_recv_ego, 1088 app_recv_ego,
1094 app_recv_host, 1089 app_recv_host,
@@ -1098,20 +1093,6 @@ app_connect (void *cls)
1098} 1093}
1099 1094
1100 1095
1101/* CORE */
1102
1103
1104static void
1105core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1106{
1107 this_peer = *my_identity;
1108 GNUNET_SCHEDULER_add_now (app_connect, NULL);
1109}
1110
1111
1112/* RUN */
1113
1114
1115/** 1096/**
1116 * Main function run by the scheduler. 1097 * Main function run by the scheduler.
1117 * 1098 *
@@ -1125,6 +1106,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1125 const struct GNUNET_CONFIGURATION_Handle *c) 1106 const struct GNUNET_CONFIGURATION_Handle *c)
1126{ 1107{
1127 cfg = c; 1108 cfg = c;
1109 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
1128 1110
1129 if (!opt_method) 1111 if (!opt_method)
1130 opt_method = "message"; 1112 opt_method = "message";
@@ -1181,7 +1163,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1181 } 1163 }
1182 } 1164 }
1183 1165
1184 core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL); 1166 GNUNET_SCHEDULER_add_now (app_connect, NULL);
1185} 1167}
1186 1168
1187 1169
diff --git a/src/social/test_social.c b/src/social/test_social.c
index 4960b8820..0dc2a9d30 100644
--- a/src/social/test_social.c
+++ b/src/social/test_social.c
@@ -32,7 +32,6 @@
32#include "gnunet_testing_lib.h" 32#include "gnunet_testing_lib.h"
33#include "gnunet_psyc_util_lib.h" 33#include "gnunet_psyc_util_lib.h"
34#include "gnunet_social_service.h" 34#include "gnunet_social_service.h"
35#include "gnunet_core_service.h"
36#include "gnunet_identity_service.h" 35#include "gnunet_identity_service.h"
37 36
38#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 37#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
@@ -54,7 +53,6 @@ struct GNUNET_SCHEDULER_Task *end_badly_task;
54 53
55const struct GNUNET_CONFIGURATION_Handle *cfg; 54const struct GNUNET_CONFIGURATION_Handle *cfg;
56 55
57struct GNUNET_CORE_Handle *core;
58struct GNUNET_PeerIdentity this_peer; 56struct GNUNET_PeerIdentity this_peer;
59 57
60struct GNUNET_IDENTITY_Handle *id; 58struct GNUNET_IDENTITY_Handle *id;
@@ -185,12 +183,6 @@ host_announce2 ();
185static void 183static void
186cleanup () 184cleanup ()
187{ 185{
188 if (NULL != core)
189 {
190 GNUNET_CORE_disconnecT (core);
191 core = NULL;
192 }
193
194 if (NULL != id) 186 if (NULL != id)
195 { 187 {
196 GNUNET_IDENTITY_disconnect (id); 188 GNUNET_IDENTITY_disconnect (id);
@@ -406,11 +398,6 @@ app_connected (void *cls)
406{ 398{
407 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 399 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
408 "Test #%u: App connected: %p\n", test, cls); 400 "Test #%u: App connected: %p\n", test, cls);
409 if (NULL != core)
410 {
411 GNUNET_CORE_disconnecT (core);
412 core = NULL;
413 }
414} 401}
415 402
416 403
@@ -1314,17 +1301,6 @@ identity_ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego,
1314} 1301}
1315 1302
1316 1303
1317static void
1318core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1319{
1320 this_peer = *my_identity;
1321 id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL);
1322
1323 test = TEST_HOST_CREATE;
1324 GNUNET_IDENTITY_create (id, host_name, &id_host_created, NULL);
1325}
1326
1327
1328/** 1304/**
1329 * Main function of the test, run from scheduler. 1305 * Main function of the test, run from scheduler.
1330 * 1306 *
@@ -1346,7 +1322,12 @@ run (void *cls,
1346 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 1322 end_badly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
1347 &end_badly, NULL); 1323 &end_badly, NULL);
1348 1324
1349 core = GNUNET_CORE_connecT (cfg, NULL, &core_connected, NULL, NULL, NULL); 1325 GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer);
1326
1327 id = GNUNET_IDENTITY_connect (cfg, &identity_ego_cb, NULL);
1328
1329 test = TEST_HOST_CREATE;
1330 GNUNET_IDENTITY_create (id, host_name, &id_host_created, NULL);
1350} 1331}
1351 1332
1352 1333