* Message queue to talk to @e client.
*/
struct GNUNET_MQ_Handle *mq;
-
+
/**
* Array of the types of messages this peer cares
* about (with @e tcnt entries). Allocated as part
* of this client struct, do not free!
*/
uint16_t *types;
-
+
/**
* Map of peer identities to active transmission requests of this
* client to the peer (of type `struct GSC_ClientActiveRequest`).
* Check #GNUNET_MESSAGE_TYPE_CORE_INIT request.
*
* @param cls client that sent #GNUNET_MESSAGE_TYPE_CORE_INIT
- * @param im the `struct InitMessage`
+ * @param im the `struct InitMessage`
* @return #GNUNET_OK if @a im is well-formed
*/
static int
* Handle #GNUNET_MESSAGE_TYPE_CORE_INIT request.
*
* @param cls client that sent #GNUNET_MESSAGE_TYPE_CORE_INIT
- * @param im the `struct InitMessage`
+ * @param im the `struct InitMessage`
*/
static void
handle_client_init (void *cls,
c->options = ntohl (im->options);
all_client_options |= c->options;
c->types = GNUNET_malloc (msize);
- c->connectmap = GNUNET_CONTAINER_multipeermap_create (16,
- GNUNET_NO);
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_put (c->connectmap,
&GSC_my_identity,
struct GNUNET_MQ_Handle *mq)
{
struct GSC_Client *c;
-
+
c = GNUNET_new (struct GSC_Client);
c->client = client;
c->mq = mq;
+ c->connectmap = GNUNET_CONTAINER_multipeermap_create (16,
+ GNUNET_NO);
GNUNET_CONTAINER_DLL_insert (client_head,
client_tail,
c);
NULL);
GNUNET_CONTAINER_multipeermap_destroy (c->requests);
}
- if (NULL != c->connectmap)
- {
- GNUNET_CONTAINER_multipeermap_destroy (c->connectmap);
- c->connectmap = NULL;
- }
+ GNUNET_CONTAINER_multipeermap_destroy (c->connectmap);
+ c->connectmap = NULL;
if (NULL != c->types)
{
GSC_TYPEMAP_remove (c->types,
sender)) );
GNUNET_MQ_send (c->mq,
env);
- }
+ }
}
const struct GNUNET_MessageHeader *message)
{
struct GSC_Client *c = cls;
-
+
GNUNET_SERVICE_client_continue (c->client);
GSC_KX_handle_client_monitor_peers (c->mq);
}
NULL,
GNUNET_MQ_hd_var_size (client_init,
GNUNET_MESSAGE_TYPE_CORE_INIT,
- struct InitMessage,
+ struct InitMessage,
NULL),
GNUNET_MQ_hd_fixed_size (client_monitor_peers,
GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS,