aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/conversation_api.c14
-rw-r--r--src/conversation/conversation_api_call.c27
2 files changed, 12 insertions, 29 deletions
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)
557 }; 557 };
558 struct GNUNET_MQ_Envelope *e; 558 struct GNUNET_MQ_Envelope *e;
559 struct ClientPhoneRegisterMessage *reg; 559 struct ClientPhoneRegisterMessage *reg;
560 struct GNUNET_CLIENT_Connection *client;
561 560
562 clean_up_callers (phone); 561 clean_up_callers (phone);
563 if (NULL != phone->mq) 562 if (NULL != phone->mq)
@@ -566,14 +565,13 @@ reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone)
566 phone->mq = NULL; 565 phone->mq = NULL;
567 } 566 }
568 phone->state = PS_REGISTER; 567 phone->state = PS_REGISTER;
569 client = GNUNET_CLIENT_connect ("conversation", 568 phone->mq = GNUNET_CLIENT_connecT (phone->cfg,
570 phone->cfg); 569 "conversation",
571 if (NULL == client) 570 handlers,
571 &phone_error_handler,
572 phone);
573 if (NULL == phone->mq)
572 return; 574 return;
573 phone->mq = GNUNET_MQ_queue_for_connection_client (client,
574 handlers,
575 &phone_error_handler,
576 phone);
577 e = GNUNET_MQ_msg (reg, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER); 575 e = GNUNET_MQ_msg (reg, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER);
578 reg->line = phone->my_record.line; 576 reg->line = phone->my_record.line;
579 GNUNET_MQ_send (phone->mq, e); 577 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
@@ -86,11 +86,6 @@ struct GNUNET_CONVERSATION_Call
86 const struct GNUNET_CONFIGURATION_Handle *cfg; 86 const struct GNUNET_CONFIGURATION_Handle *cfg;
87 87
88 /** 88 /**
89 * Handle to talk with CONVERSATION service.
90 */
91 struct GNUNET_CLIENT_Connection *client;
92
93 /**
94 * Our caller identity. 89 * Our caller identity.
95 */ 90 */
96 struct GNUNET_IDENTITY_Ego *caller_id; 91 struct GNUNET_IDENTITY_Ego *caller_id;
@@ -509,11 +504,6 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call)
509 GNUNET_MQ_destroy (call->mq); 504 GNUNET_MQ_destroy (call->mq);
510 call->mq = NULL; 505 call->mq = NULL;
511 } 506 }
512 if (NULL != call->client)
513 {
514 GNUNET_CLIENT_disconnect (call->client);
515 call->client = NULL;
516 }
517 call->state = CS_SHUTDOWN; 507 call->state = CS_SHUTDOWN;
518 call->event_handler (call->event_handler_cls, 508 call->event_handler (call->event_handler_cls,
519 GNUNET_CONVERSATION_EC_CALL_ERROR); 509 GNUNET_CONVERSATION_EC_CALL_ERROR);
@@ -574,8 +564,12 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
574 }; 564 };
575 struct GNUNET_CRYPTO_EcdsaPublicKey my_zone; 565 struct GNUNET_CRYPTO_EcdsaPublicKey my_zone;
576 566
577 call->client = GNUNET_CLIENT_connect ("conversation", cfg); 567 call->mq = GNUNET_CLIENT_connecT (cfg,
578 if (NULL == call->client) 568 "conversation",
569 handlers,
570 &call_error_handler,
571 call);
572 if (NULL == call->mq)
579 { 573 {
580 GNUNET_break (0); 574 GNUNET_break (0);
581 GNUNET_free (call); 575 GNUNET_free (call);
@@ -595,10 +589,6 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
595 GNUNET_CONVERSATION_call_stop (call); 589 GNUNET_CONVERSATION_call_stop (call);
596 return NULL; 590 return NULL;
597 } 591 }
598 call->mq = GNUNET_MQ_queue_for_connection_client (call->client,
599 handlers,
600 &call_error_handler,
601 call);
602 call->state = CS_LOOKUP; 592 call->state = CS_LOOKUP;
603 GNUNET_IDENTITY_ego_get_public_key (call->zone_id, 593 GNUNET_IDENTITY_ego_get_public_key (call->zone_id,
604 &my_zone); 594 &my_zone);
@@ -637,11 +627,6 @@ GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call)
637 GNUNET_MQ_destroy (call->mq); 627 GNUNET_MQ_destroy (call->mq);
638 call->mq = NULL; 628 call->mq = NULL;
639 } 629 }
640 if (NULL != call->client)
641 {
642 GNUNET_CLIENT_disconnect (call->client);
643 call->client = NULL;
644 }
645 if (NULL != call->gns_lookup) 630 if (NULL != call->gns_lookup)
646 { 631 {
647 GNUNET_GNS_lookup_cancel (call->gns_lookup); 632 GNUNET_GNS_lookup_cancel (call->gns_lookup);