*/
struct GNUNET_SECRETSHARING_Session
{
- /**
- * Client connected to the secretsharing service.
- */
- struct GNUNET_CLIENT_Connection *client;
/**
* Message queue for @e client.
*/
struct GNUNET_SECRETSHARING_DecryptionHandle
{
- /**
- * Client connected to the secretsharing service.
- */
- struct GNUNET_CLIENT_Connection *client;
/**
* Message queue for @e client.
{
GNUNET_MQ_destroy (s->mq);
s->mq = NULL;
- GNUNET_CLIENT_disconnect (s->client);
- s->client = NULL;
GNUNET_free (s);
}
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_SECRETSHARING_CreateMessage *msg;
- s->client = GNUNET_CLIENT_connect ("secretsharing", cfg);
- if (NULL == s->client)
+ s->mq = GNUNET_CLIENT_connecT (cfg,
+ "secretsharing",
+ mq_handlers,
+ &handle_session_client_error,
+ s);
+ if (NULL == s->mq)
{
/* secretsharing not configured correctly */
GNUNET_break (0);
}
s->secret_ready_cb = cb;
s->secret_ready_cls = cls;
- s->mq = GNUNET_MQ_queue_for_connection_client (s->client, mq_handlers,
- &handle_session_client_error,
- s);
- GNUNET_assert (NULL != s->mq);
-
ev = GNUNET_MQ_msg_extra (msg,
num_peers * sizeof (struct GNUNET_PeerIdentity),
GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE);
struct GNUNET_SECRETSHARING_DecryptRequestMessage *msg;
size_t share_size;
- s->client = GNUNET_CLIENT_connect ("secretsharing", cfg);
s->decrypt_cb = decrypt_cb;
s->decrypt_cls = decrypt_cb_cls;
- GNUNET_assert (NULL != s->client);
-
- s->mq = GNUNET_MQ_queue_for_connection_client (s->client, mq_handlers,
- &handle_decrypt_client_error,
- s);
- GNUNET_assert (NULL != s->mq);
-
+ s->mq = GNUNET_CLIENT_connecT (cfg,
+ "secretsharing",
+ mq_handlers,
+ &handle_decrypt_client_error,
+ s);
+ if (NULL == s->mq)
+ {
+ GNUNET_free (s);
+ return NULL;
+ }
GNUNET_assert (GNUNET_OK ==
GNUNET_SECRETSHARING_share_write (share, NULL, 0,
&share_size));
{
GNUNET_MQ_destroy (dh->mq);
dh->mq = NULL;
- GNUNET_CLIENT_disconnect (dh->client);
- dh->client = NULL;
GNUNET_free (dh);
}