From b69e6d3a343065b3005f1a553280b237a611f369 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 19 Jun 2016 22:39:22 +0000 Subject: -use new connecT API --- src/conversation/conversation_api.c | 14 ++++++-------- src/conversation/conversation_api_call.c | 27 ++++++--------------------- 2 files changed, 12 insertions(+), 29 deletions(-) (limited to 'src/conversation') diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index 3e0db67ea..730cf1c70 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c @@ -557,7 +557,6 @@ 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) @@ -566,14 +565,13 @@ reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone) phone->mq = NULL; } phone->state = PS_REGISTER; - client = GNUNET_CLIENT_connect ("conversation", - phone->cfg); - if (NULL == client) + phone->mq = GNUNET_CLIENT_connecT (phone->cfg, + "conversation", + handlers, + &phone_error_handler, + phone); + if (NULL == phone->mq) return; - phone->mq = GNUNET_MQ_queue_for_connection_client (client, - handlers, - &phone_error_handler, - phone); e = GNUNET_MQ_msg (reg, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER); reg->line = phone->my_record.line; GNUNET_MQ_send (phone->mq, e); diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index 4813faffd..728b495b3 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c @@ -85,11 +85,6 @@ struct GNUNET_CONVERSATION_Call */ const struct GNUNET_CONFIGURATION_Handle *cfg; - /** - * Handle to talk with CONVERSATION service. - */ - struct GNUNET_CLIENT_Connection *client; - /** * Our caller identity. */ @@ -509,11 +504,6 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) GNUNET_MQ_destroy (call->mq); call->mq = NULL; } - if (NULL != call->client) - { - GNUNET_CLIENT_disconnect (call->client); - call->client = NULL; - } call->state = CS_SHUTDOWN; call->event_handler (call->event_handler_cls, GNUNET_CONVERSATION_EC_CALL_ERROR); @@ -574,8 +564,12 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, }; struct GNUNET_CRYPTO_EcdsaPublicKey my_zone; - call->client = GNUNET_CLIENT_connect ("conversation", cfg); - if (NULL == call->client) + call->mq = GNUNET_CLIENT_connecT (cfg, + "conversation", + handlers, + &call_error_handler, + call); + if (NULL == call->mq) { GNUNET_break (0); GNUNET_free (call); @@ -595,10 +589,6 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONVERSATION_call_stop (call); return NULL; } - call->mq = GNUNET_MQ_queue_for_connection_client (call->client, - handlers, - &call_error_handler, - call); call->state = CS_LOOKUP; GNUNET_IDENTITY_ego_get_public_key (call->zone_id, &my_zone); @@ -637,11 +627,6 @@ GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call) GNUNET_MQ_destroy (call->mq); call->mq = NULL; } - if (NULL != call->client) - { - GNUNET_CLIENT_disconnect (call->client); - call->client = NULL; - } if (NULL != call->gns_lookup) { GNUNET_GNS_lookup_cancel (call->gns_lookup); -- cgit v1.2.3