[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 14/64: handle service disconnect without crashing
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 14/64: handle service disconnect without crashing if reconnect fails |
Date: |
Sat, 30 Dec 2017 20:57:59 +0100 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
commit da376896f525195c469cee2d1a4a5cb57ad6b6f8
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 29 11:24:22 2017 +0100
handle service disconnect without crashing if reconnect fails
---
src/psyc/psyc_api.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c
index c93d8b383..e7790d201 100644
--- a/src/psyc/psyc_api.c
+++ b/src/psyc/psyc_api.c
@@ -931,7 +931,8 @@ slave_reconnect (void *cls)
* Reconnect after backoff period.
*/
static void
-slave_disconnected (void *cls, enum GNUNET_MQ_Error error)
+slave_disconnected (void *cls,
+ enum GNUNET_MQ_Error error)
{
struct GNUNET_PSYC_Slave *slv = cls;
struct GNUNET_PSYC_Channel *chn = &slv->chn;
@@ -950,7 +951,7 @@ slave_disconnected (void *cls, enum GNUNET_MQ_Error error)
chn->mq = NULL;
}
chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay,
- slave_reconnect,
+ &slave_reconnect,
slv);
chn->reconnect_delay = GNUNET_TIME_STD_BACKOFF (chn->reconnect_delay);
}
@@ -993,9 +994,19 @@ slave_connect (struct GNUNET_PSYC_Slave *slv)
GNUNET_MQ_handler_end ()
};
- chn->mq = GNUNET_CLIENT_connect (chn->cfg, "psyc",
- handlers, slave_disconnected, slv);
- GNUNET_assert (NULL != chn->mq);
+ chn->mq = GNUNET_CLIENT_connect (chn->cfg,
+ "psyc",
+ handlers,
+ &slave_disconnected,
+ slv);
+ if (NULL == chn->mq)
+ {
+ chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay,
+ &slave_reconnect,
+ slv);
+ chn->reconnect_delay = GNUNET_TIME_STD_BACKOFF (chn->reconnect_delay);
+ return;
+ }
chn->tmit = GNUNET_PSYC_transmit_create (chn->mq);
GNUNET_MQ_send_copy (chn->mq, chn->connect_env);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 07/64: added mq logging, (continued)
- [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, 2017/12/30
- [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 <=
- [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
- [GNUnet-SVN] [gnunet] 12/64: fix wrong condition, do only drop if it has not been dropped, instead of causing double-drop, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 11/64: Merge branch 'fix_social' of gnunet.org:gnunet into fix_social, gnunet, 2017/12/30
- [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