diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:39:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:39:22 +0000 |
commit | b69e6d3a343065b3005f1a553280b237a611f369 (patch) | |
tree | d88baa066171a1f28d40126f12a387f0fbf3aa40 | |
parent | 84a14eaa9838156ef0fbce4f6e92fc3b01a9d646 (diff) |
-use new connecT API
-rw-r--r-- | src/conversation/conversation_api.c | 14 | ||||
-rw-r--r-- | src/conversation/conversation_api_call.c | 27 |
2 files changed, 12 insertions, 29 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index 3e0db67ea2..730cf1c70d 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 4813faffd3..728b495b37 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c @@ -86,11 +86,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. */ struct GNUNET_IDENTITY_Ego *caller_id; @@ -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); |