[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 03/64: don't call GNUNET_SERVICE_client_continue t
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 03/64: don't call GNUNET_SERVICE_client_continue twice; maybe fix bug resulting from destroying MQ too early |
Date: |
Sat, 30 Dec 2017 20:57:48 +0100 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
commit 7478bbf75478b0df49ba06379888aae3632c2bf5
Author: lurchi <address@hidden>
AuthorDate: Fri Oct 13 20:56:09 2017 +0200
don't call GNUNET_SERVICE_client_continue twice; maybe fix bug resulting
from destroying MQ too early
---
src/social/gnunet-service-social.c | 60 ++++++++++++++++++++++----------------
src/social/social_api.c | 5 ++--
2 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/src/social/gnunet-service-social.c
b/src/social/gnunet-service-social.c
index 30e113f18..f888564dc 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -1878,23 +1878,9 @@ guest_enter (const struct GuestEnterRequest *greq,
struct Guest **ret_gst)
static int
-check_client_guest_enter (void *cls,
- const struct GuestEnterRequest *greq)
-{
- return GNUNET_OK;
-}
-
-
-/**
- * Handle a connecting client entering a place as guest.
- */
-static void
-handle_client_guest_enter (void *cls,
- const struct GuestEnterRequest *greq)
+client_guest_enter (struct Client *c,
+ const struct GuestEnterRequest *greq)
{
- // FIXME: this must not be called directly by gns_result_guest_enter because
then
- // GNUNET_SERVICE_client_continue is called twice
- struct Client *c = cls;
struct GNUNET_SERVICE_Client *client = c->client;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -1906,9 +1892,7 @@ handle_client_guest_enter (void *cls,
remaining, 1, &app_id);
if (0 == offset)
{
- GNUNET_break (0);
- GNUNET_SERVICE_client_drop (client);
- return;
+ return GNUNET_SYSERR;
}
struct Guest *gst = NULL;
@@ -1941,9 +1925,7 @@ handle_client_guest_enter (void *cls,
break;
}
case GNUNET_SYSERR:
- GNUNET_break (0);
- GNUNET_SERVICE_client_drop (client);
- return;
+ return GNUNET_SYSERR;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1953,9 +1935,36 @@ handle_client_guest_enter (void *cls,
struct ClientListItem *cli = GNUNET_new (struct ClientListItem);
cli->client = client;
GNUNET_CONTAINER_DLL_insert (plc->clients_head, plc->clients_tail, cli);
+ return GNUNET_OK;
+}
- c->place = plc;
- GNUNET_SERVICE_client_continue (client);
+
+static int
+check_client_guest_enter (void *cls,
+ const struct GuestEnterRequest *greq)
+{
+ return GNUNET_OK;
+}
+
+
+/**
+ * Handle a connecting client entering a place as guest.
+ */
+static void
+handle_client_guest_enter (void *cls,
+ const struct GuestEnterRequest *greq)
+{
+ // FIXME: this must not be called directly by gns_result_guest_enter because
then
+ // GNUNET_SERVICE_client_continue is called twice
+ struct Client *c = cls;
+
+ if (GNUNET_SYSERR == client_guest_enter (c, greq))
+ {
+ GNUNET_break (0);
+ GNUNET_SERVICE_client_drop (c->client);
+ return;
+ }
+ GNUNET_SERVICE_client_continue (c->client);
}
@@ -2032,7 +2041,7 @@ gns_result_guest_enter (void *cls, uint32_t rd_count,
p += relay_size;
GNUNET_memcpy (p, gcls->join_msg, join_msg_size);
- handle_client_guest_enter (c, greq);
+ client_guest_enter (c, greq);
GNUNET_free (gcls->app_id);
if (NULL != gcls->password)
@@ -2261,6 +2270,7 @@ handle_client_place_leave (void *cls,
}
}
//GNUNET_SERVICE_client_continue (client);
+ //GNUNET_SERVICE_client_drop (client);
}
diff --git a/src/social/social_api.c b/src/social/social_api.c
index 04b671120..a190b2f26 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -1085,9 +1085,10 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc)
plc);
if (NULL != plc->mq)
{
- struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
- if (NULL != env)
+ //struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
+ if (GNUNET_MQ_get_length (plc->mq) > 0)
{
+ struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback)
place_disconnect, plc);
}
else
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (d01f1bd83 -> 5c8feda7f), gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 02/64: start social service before running the test (not sure if needed), gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 06/64: Merge branch 'fix_social' of ssh://gnunet.org/gnunet into fix_social, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 07/64: added mq logging, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 01/64: trying to fix test_social and social service with a lot of debug outputs, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 05/64: we were on the wood way, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 03/64: don't call GNUNET_SERVICE_client_continue twice; maybe fix bug resulting from destroying MQ too early,
gnunet <=
- [GNUnet-SVN] [gnunet] 04/64: -we no enter to place, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 13/64: clarify use of client_drop, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 17/64: logging, cosmetic fixes, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 09/64: misc social hacking with Lurchi, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 18/64: minor style fix, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 10/64: added logging, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 14/64: handle service disconnect without crashing if reconnect fails, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 15/64: better logging of message processing errors in mq handling, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 08/64: added logging, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 16/64: do handle CTRL-C properly in test_social, gnunet, 2017/12/30