diff options
author | Gabor X Toth <*@tg-x.net> | 2016-09-23 14:26:55 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-09-23 14:26:55 +0000 |
commit | 451fd32170103921993d876d765a8755ce737a0b (patch) | |
tree | ad41cd960f7f8b0f80d9967332ffc0a85e9cb0c1 /src/social | |
parent | 3e872864741aaa83be947b614eafb4fef2c74253 (diff) | |
download | gnunet-451fd32170103921993d876d765a8755ce737a0b.tar.gz gnunet-451fd32170103921993d876d765a8755ce737a0b.zip |
multicast,psyc,social: remove core dependencny
Diffstat (limited to 'src/social')
-rw-r--r-- | src/social/Makefile.am | 3 | ||||
-rw-r--r-- | src/social/gnunet-service-social.c | 19 | ||||
-rw-r--r-- | src/social/gnunet-social.c | 22 | ||||
-rw-r--r-- | src/social/test_social.c | 31 |
4 files changed, 9 insertions, 66 deletions
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 = \ | |||
41 | gnunet_social_LDADD = \ | 41 | gnunet_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 | ||
47 | gnunet_service_social_SOURCES = \ | 46 | gnunet_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 | ||
81 | EXTRA_DIST = \ | 78 | EXTRA_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 @@ | |||
48 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 47 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
49 | 48 | ||
50 | /* Handles to other services */ | 49 | /* Handles to other services */ |
51 | static struct GNUNET_CORE_Handle *core; | ||
52 | static struct GNUNET_IDENTITY_Handle *id; | 50 | static struct GNUNET_IDENTITY_Handle *id; |
53 | static struct GNUNET_GNS_Handle *gns; | 51 | static struct GNUNET_GNS_Handle *gns; |
54 | static struct GNUNET_NAMESTORE_Handle *namestore; | 52 | static 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 | */ | ||
3473 | static void | ||
3474 | core_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 | ||
140 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 139 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
141 | 140 | ||
142 | struct GNUNET_CORE_Handle *core; | ||
143 | struct GNUNET_PeerIdentity peer, this_peer; | 141 | struct GNUNET_PeerIdentity peer, this_peer; |
144 | 142 | ||
145 | struct GNUNET_SOCIAL_App *app; | 143 | struct GNUNET_SOCIAL_App *app; |
@@ -1086,9 +1084,6 @@ app_recv_ego (void *cls, | |||
1086 | static void | 1084 | static void |
1087 | app_connect (void *cls) | 1085 | app_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 | |||
1104 | static void | ||
1105 | core_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 | ||
55 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 54 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
56 | 55 | ||
57 | struct GNUNET_CORE_Handle *core; | ||
58 | struct GNUNET_PeerIdentity this_peer; | 56 | struct GNUNET_PeerIdentity this_peer; |
59 | 57 | ||
60 | struct GNUNET_IDENTITY_Handle *id; | 58 | struct GNUNET_IDENTITY_Handle *id; |
@@ -185,12 +183,6 @@ host_announce2 (); | |||
185 | static void | 183 | static void |
186 | cleanup () | 184 | cleanup () |
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 | ||
1317 | static void | ||
1318 | core_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 | ||