use c99
[oweals/gnunet.git] / src / conversation / conversation_api.c
index a9dc1f27f3cdfb844492cb9b4930297f68b9d5c4..730cf1c70d0a34f929f56ab801109db66591f745 100644 (file)
@@ -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.
    */
@@ -569,19 +564,14 @@ 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)
+  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 (phone->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);
@@ -644,7 +634,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 +754,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);
 }