From 2042d867f71e3cb1d7ade6b3d474ce0c1f5f87bd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 19 Jun 2016 18:50:00 +0000 Subject: redefine GNUNET_MQ_queue_for_connection_client to capture client handle --- src/conversation/conversation_api.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/conversation') diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index a9dc1f27f..3e0db67ea 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c @@ -160,11 +160,6 @@ struct GNUNET_CONVERSATION_Phone */ const struct GNUNET_CONFIGURATION_Handle *cfg; - /** - * Handle to talk with CONVERSATION service. - */ - struct GNUNET_CLIENT_Connection *client; - /** * We keep all callers in a DLL. */ @@ -562,6 +557,7 @@ reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone) }; struct GNUNET_MQ_Envelope *e; struct ClientPhoneRegisterMessage *reg; + struct GNUNET_CLIENT_Connection *client; clean_up_callers (phone); if (NULL != phone->mq) @@ -569,16 +565,12 @@ reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone) GNUNET_MQ_destroy (phone->mq); phone->mq = NULL; } - if (NULL != phone->client) - { - GNUNET_CLIENT_disconnect (phone->client); - phone->client = NULL; - } phone->state = PS_REGISTER; - phone->client = GNUNET_CLIENT_connect ("conversation", phone->cfg); - if (NULL == phone->client) + client = GNUNET_CLIENT_connect ("conversation", + phone->cfg); + if (NULL == client) return; - phone->mq = GNUNET_MQ_queue_for_connection_client (phone->client, + phone->mq = GNUNET_MQ_queue_for_connection_client (client, handlers, &phone_error_handler, phone); @@ -644,7 +636,7 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, phone->my_record.line = htonl ((uint32_t) line); phone->my_record.version = htonl (0); reconnect_phone (phone); - if ( (NULL == phone->client) || + if ( (NULL == phone->mq) || (NULL == phone->ns) ) { GNUNET_break (0); @@ -764,11 +756,6 @@ GNUNET_CONVERSATION_phone_destroy (struct GNUNET_CONVERSATION_Phone *phone) GNUNET_MQ_destroy (phone->mq); phone->mq = NULL; } - if (NULL != phone->client) - { - GNUNET_CLIENT_disconnect (phone->client); - phone->client = NULL; - } GNUNET_free (phone); } -- cgit v1.2.3