[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 61/64: consider entry decision while re-entering a
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 61/64: consider entry decision while re-entering a place |
Date: |
Sat, 30 Dec 2017 20:58:46 +0100 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
commit 682bf4377d630f63912c0cdc7f612e9df9c82a33
Author: lurchi <address@hidden>
AuthorDate: Sat Dec 30 19:10:40 2017 +0100
consider entry decision while re-entering a place
---
src/social/social_api.c | 109 ++++++++++++++++++++++++++----------------------
1 file changed, 58 insertions(+), 51 deletions(-)
diff --git a/src/social/social_api.c b/src/social/social_api.c
index 4e305b867..48e376404 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -1921,52 +1921,52 @@ struct ReconnectContext
};
-//static void
-//guest_enter_reconnect_cb (void *cls,
-// int result,
-// const struct GNUNET_CRYPTO_EddsaPublicKey
*place_pub_key,
-// uint64_t max_message_id)
-//{
-// struct ReconnectContext *reconnect_ctx = cls;
-//
-// GNUNET_assert (NULL != reconnect_ctx);
-// reconnect_ctx->result = GNUNET_new (int);
-// *(reconnect_ctx->result) = result;
-// reconnect_ctx->max_message_id = GNUNET_new (int64_t);
-// *(reconnect_ctx->max_message_id) = max_message_id;
-//}
-//
-//
-//static void
-//guest_entry_dcsn_reconnect_cb (void *cls,
-// int is_admitted,
-// const struct GNUNET_PSYC_Message *entry_resp)
-//{
-// struct ReconnectContext *reconnect_ctx = cls;
-// struct GNUNET_SOCIAL_Guest *gst = reconnect_ctx->guest;
-//
-// GNUNET_assert (NULL != reconnect_ctx);
-// GNUNET_assert (NULL != reconnect_ctx->result);
-// GNUNET_assert (NULL != reconnect_ctx->max_message_id);
-// if (GNUNET_YES != is_admitted)
-// {
-// GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-// "Guest was rejected after calling "
-// "GNUNET_SOCIAL_guest_enter_reconnect ()\n");
-// }
-// else if (NULL != reconnect_ctx->enter_cb)
-// {
-// GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-// "guest reconnected!\n");
-// reconnect_ctx->enter_cb (reconnect_ctx->enter_cls,
-// *(reconnect_ctx->result),
-// &gst->plc.pub_key,
-// *(reconnect_ctx->max_message_id));
-// }
-// GNUNET_free (reconnect_ctx->result);
-// GNUNET_free (reconnect_ctx->max_message_id);
-// GNUNET_free (reconnect_ctx);
-//}
+static void
+guest_enter_reconnect_cb (void *cls,
+ int result,
+ const struct GNUNET_CRYPTO_EddsaPublicKey
*place_pub_key,
+ uint64_t max_message_id)
+{
+ struct ReconnectContext *reconnect_ctx = cls;
+
+ GNUNET_assert (NULL != reconnect_ctx);
+ reconnect_ctx->result = GNUNET_new (int);
+ *(reconnect_ctx->result) = result;
+ reconnect_ctx->max_message_id = GNUNET_new (int64_t);
+ *(reconnect_ctx->max_message_id) = max_message_id;
+}
+
+
+static void
+guest_entry_dcsn_reconnect_cb (void *cls,
+ int is_admitted,
+ const struct GNUNET_PSYC_Message *entry_resp)
+{
+ struct ReconnectContext *reconnect_ctx = cls;
+ struct GNUNET_SOCIAL_Guest *gst = reconnect_ctx->guest;
+
+ GNUNET_assert (NULL != reconnect_ctx);
+ GNUNET_assert (NULL != reconnect_ctx->result);
+ GNUNET_assert (NULL != reconnect_ctx->max_message_id);
+ if (GNUNET_YES != is_admitted)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Guest was rejected after calling "
+ "GNUNET_SOCIAL_guest_enter_reconnect ()\n");
+ }
+ else if (NULL != reconnect_ctx->enter_cb)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "guest reconnected!\n");
+ reconnect_ctx->enter_cb (reconnect_ctx->enter_cls,
+ *(reconnect_ctx->result),
+ &gst->plc.pub_key,
+ *(reconnect_ctx->max_message_id));
+ }
+ GNUNET_free (reconnect_ctx->result);
+ GNUNET_free (reconnect_ctx->max_message_id);
+ GNUNET_free (reconnect_ctx);
+}
/**
@@ -1979,8 +1979,8 @@ struct ReconnectContext
* Flags for the entry.
* @param slicer
* Slicer to use for processing incoming requests from guests.
- * @param local_enter_cb
- * Called upon connection established to the social service.
+ * @param enter_cb
+ * Called upon re-entering is complete.
* @param entry_decision_cb
* Called upon receiving entry decision.
*
@@ -1990,11 +1990,12 @@ struct GNUNET_SOCIAL_Guest *
GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection
*gconn,
enum GNUNET_PSYC_SlaveJoinFlags flags,
struct GNUNET_PSYC_Slicer *slicer,
- GNUNET_SOCIAL_GuestEnterCallback
local_enter_cb,
+ GNUNET_SOCIAL_GuestEnterCallback enter_cb,
void *cls)
{
struct GNUNET_SOCIAL_Guest *gst = GNUNET_malloc (sizeof (*gst));
struct GNUNET_SOCIAL_Place *plc = &gst->plc;
+ struct ReconnectContext *reconnect_ctx;
uint16_t app_id_size = strlen (gconn->app->id) + 1;
struct GuestEnterRequest *greq;
@@ -2013,9 +2014,15 @@ GNUNET_SOCIAL_guest_enter_reconnect (struct
GNUNET_SOCIAL_GuestConnection *gconn
plc->pub_key = gconn->plc_msg.place_pub_key;
plc->ego_pub_key = gconn->plc_msg.ego_pub_key;
+ reconnect_ctx = GNUNET_new (struct ReconnectContext);
+ reconnect_ctx->guest = gst;
+ reconnect_ctx->enter_cb = enter_cb;
+ reconnect_ctx->enter_cls = cls;
+
plc->op = GNUNET_OP_create ();
- gst->enter_cb = local_enter_cb;
- gst->cb_cls = cls;
+ gst->enter_cb = &guest_enter_reconnect_cb;
+ gst->entry_dcsn_cb = &guest_entry_dcsn_reconnect_cb;
+ gst->cb_cls = reconnect_ctx;
guest_connect (gst);
return gst;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 30/64: Introduce PART/PART_ACK messages (tests will fail until multicast module is adapted, too), (continued)
- [GNUnet-SVN] [gnunet] 30/64: Introduce PART/PART_ACK messages (tests will fail until multicast module is adapted, too), gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 22/64: protocol change: add ack message for guests/hosts leaving a place, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 44/64: tried to print out stacktrace, not working. removed., gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 50/64: remove debug assertion; add debug output, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 59/64: master/slave pointers must not be NULL immediatly after sending leave request, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 58/64: fixing the place leave logic after protocol change, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 55/64: test_psyc: less services and less noise in the output, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 60/64: actually test reconnecting; result in enter callback must always be GNUNET_OK, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 56/64: result is a boolean; stylistic changes, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 52/64: stylistic fix, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 61/64: consider entry decision while re-entering a place,
gnunet <=
- [GNUnet-SVN] [gnunet] 27/64: Use MQ API instead of manually allocating messages; simplify logic in handle_client_psyc_message; cleanup, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 45/64: actually use the is_disconnecting flag; debug output; remove dead code, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 46/64: don't shutdown before all members and origin have disconnected, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 38/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 48/64: we have to destroy channels to the origin when cleaning up a member, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 41/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 51/64: be more clear about test procedure (use self-explanatory function names), gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 57/64: test_social runs into the case GNUNET_YES == grp->is_disconnected, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 49/64: forgot to call GNUNET_SERVICE_client_continue, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 64/64: Merge branch 'fix_social', gnunet, 2017/12/30