-use new connecT API
authorChristian Grothoff <christian@grothoff.org>
Sun, 19 Jun 2016 22:39:22 +0000 (22:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 19 Jun 2016 22:39:22 +0000 (22:39 +0000)
src/conversation/conversation_api.c
src/conversation/conversation_api_call.c

index 3e0db67ea2973d34bddfe599ede9bed6eaea6e5e..730cf1c70d0a34f929f56ab801109db66591f745 100644 (file)
@@ -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);
index 4813faffd3db2060f9ee0a0b2da4bdef1302becb..728b495b37ae57c9c91b6905db74971557880f76 100644 (file)
@@ -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);