[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 26/64: finalize protocol change (fixes message los
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 26/64: finalize protocol change (fixes message loss when leaving a place) |
Date: |
Sat, 30 Dec 2017 20:58:11 +0100 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
commit 5d2fadf532f771a93f0c3873b5b47b73a0652b96
Author: lurchi <address@hidden>
AuthorDate: Mon Nov 13 18:21:14 2017 +0100
finalize protocol change (fixes message loss when leaving a place)
---
src/social/social_api.c | 77 +++----------------------------------------------
1 file changed, 4 insertions(+), 73 deletions(-)
diff --git a/src/social/social_api.c b/src/social/social_api.c
index 8c6629432..87b46821e 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -1599,32 +1599,6 @@ GNUNET_SOCIAL_host_disconnect (struct GNUNET_SOCIAL_Host
*hst,
/**
- * Closure for #host_leave_cont.
- */
-struct HostLeaveContext
-{
- struct GNUNET_SOCIAL_Host *hst;
- GNUNET_ContinuationCallback disconnect_cb;
- void *disconnect_cb_cls;
-};
-
-
-/**
- * FIXME.
- */
-static void
-host_leave_cont (void *cls)
-{
- struct HostLeaveContext *hlc = cls;
-
- GNUNET_SOCIAL_host_disconnect (hlc->hst,
- hlc->disconnect_cb,
- hlc->disconnect_cb_cls);
- GNUNET_free (hlc);
-}
-
-
-/**
* Stop hosting the home.
*
* Sends a _notice_place_closing announcement to the home.
@@ -1649,21 +1623,15 @@ GNUNET_SOCIAL_host_leave (struct GNUNET_SOCIAL_Host
*hst,
{
struct GNUNET_MessageHeader *msg;
struct GNUNET_MQ_Envelope *envelope;
- struct HostLeaveContext *hlc;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"GNUNET_SOCIAL_host_leave\n");
GNUNET_SOCIAL_host_announce (hst, "_notice_place_closing", env, NULL, NULL,
GNUNET_SOCIAL_ANNOUNCE_NONE);
+ hst->plc.disconnect_cb = disconnect_cb;
+ hst->plc.disconnect_cls = cls;
envelope = GNUNET_MQ_msg (msg,
GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
- hlc = GNUNET_new (struct HostLeaveContext);
- hlc->hst = hst;
- hlc->disconnect_cb = disconnect_cb;
- hlc->disconnect_cb_cls = cls;
- GNUNET_MQ_notify_sent (envelope,
- &host_leave_cont,
- hlc);
GNUNET_MQ_send (hst->plc.mq,
envelope);
}
@@ -2101,37 +2069,6 @@ GNUNET_SOCIAL_guest_disconnect (struct
GNUNET_SOCIAL_Guest *gst,
/**
- * Closure for #leave_done_cont.
- */
-struct LeaveContext
-{
- struct GNUNET_SOCIAL_Guest *gst;
- GNUNET_ContinuationCallback disconnect_cb;
- void *disconnect_cb_cls;
-};
-
-
-/**
- * The leave message was transmitted, now complete the
- * disconnection process.
- *
- * @param cls a `struct LeaveContext`
- */
-static void
-leave_done_cont (void *cls)
-{
- struct LeaveContext *lc = cls;
-
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "social_api: guest's place_leave message sent!\n");
- GNUNET_SOCIAL_guest_disconnect (lc->gst,
- lc->disconnect_cb,
- lc->disconnect_cb_cls);
- GNUNET_free (lc);
-}
-
-
-/**
* Leave a place temporarily or permanently.
*
* Notifies the owner of the place about leaving, and destroys the place
handle.
@@ -2155,7 +2092,6 @@ GNUNET_SOCIAL_guest_leave (struct GNUNET_SOCIAL_Guest
*gst,
{
struct GNUNET_MessageHeader *msg;
struct GNUNET_MQ_Envelope *envelope;
- struct LeaveContext *lc;
GNUNET_SOCIAL_guest_talk (gst, "_notice_place_leave", env, NULL, NULL,
GNUNET_SOCIAL_TALK_NONE);
@@ -2163,15 +2099,10 @@ GNUNET_SOCIAL_guest_leave (struct GNUNET_SOCIAL_Guest
*gst,
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"social_api: place_leave\n");
+ gst->plc.disconnect_cb = disconnect_cb;
+ gst->plc.disconnect_cls = cls;
envelope = GNUNET_MQ_msg (msg,
GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
- lc = GNUNET_new (struct LeaveContext);
- lc->gst = gst;
- lc->disconnect_cb = disconnect_cb;
- lc->disconnect_cb_cls = cls;
- GNUNET_MQ_notify_sent (envelope,
- &leave_done_cont,
- lc);
GNUNET_MQ_send (gst->plc.mq,
envelope);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 20/64: Fix tcp on exit crash -- could have sworn I fixed this one before, (continued)
- [GNUnet-SVN] [gnunet] 20/64: Fix tcp on exit crash -- could have sworn I fixed this one before, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 21/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 25/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 35/64: added FIXMEs, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 32/64: commented out wrong message type, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 40/64: revert commit 6490b5f31e58e9ec008f8c5ceda28f6054f1bbba, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 23/64: improve documentation, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 19/64: allow MST callback to distinguish between disconnect and parse error situations, and only log for the hard errors, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 36/64: added FIXME, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 31/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 26/64: finalize protocol change (fixes message loss when leaving a place),
gnunet <=
- [GNUnet-SVN] [gnunet] 47/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 39/64: WARNING -> DEBUG, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 37/64: mark channel as disconnectin when a part request is sent; cleanup, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 33/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 24/64: changed log levels, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 42/64: added logging, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 54/64: test_social: less services and less noise in the output, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 34/64: introduce part request / part ack messages (for leaving multicast groups) and related fixes, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 43/64: fixed compile error, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 29/64: use comfort functions of MQ API, gnunet, 2017/12/30