*/
struct GNUNET_CADET_Channel *channel;
+ // FIXME: not used
/**
* CADET transmission handle.
*/
/**
* Is the client disconnected? #GNUNET_YES or #GNUNET_NO
*/
- uint8_t disconnected;
+ uint8_t is_disconnected;
/**
* Is this an origin (#GNUNET_YES), or member (#GNUNET_NO)?
static void
shutdown_task (void *cls)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "shutting down\n");
if (NULL != cadet)
{
GNUNET_CADET_disconnect (cadet);
grp->is_origin = GNUNET_YES;
grp->pub_key = pub_key;
grp->pub_key_hash = pub_key_hash;
+ grp->is_disconnected = GNUNET_NO;
GNUNET_CONTAINER_multihashmap_put (origins, &grp->pub_key_hash, orig,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
grp->is_origin = GNUNET_NO;
grp->pub_key = msg->group_pub_key;
grp->pub_key_hash = pub_key_hash;
+ grp->is_disconnected = GNUNET_NO;
group_set_cadet_port_hash (grp);
if (NULL == grp_mem)
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"%p got join decision from client for group %s..\n",
grp, GNUNET_h2s (&grp->pub_key_hash));
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"%p got part request from client for group %s.\n",
grp, GNUNET_h2s (&grp->pub_key_hash));
+ grp->is_disconnected = GNUNET_YES;
env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_MULTICAST_PART_ACK);
client_send_group (grp, env);
GNUNET_SERVICE_client_continue (client);
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
GNUNET_assert (GNUNET_YES == grp->is_origin);
struct Origin *orig = grp->origin;
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
GNUNET_assert (GNUNET_NO == grp->is_origin);
struct Member *mem = grp->member;
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
GNUNET_assert (GNUNET_NO == grp->is_origin);
struct Member *mem = grp->member;
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
struct GNUNET_HashCode key_hash;
replay_key_hash (res->fragment_id, res->message_id, res->fragment_offset,
GNUNET_SERVICE_client_drop (client);
return;
}
+ GNUNET_assert (GNUNET_NO == grp->is_disconnected);
const struct GNUNET_MessageHeader *msg = &res->header;
if (GNUNET_MULTICAST_REC_OK == res->error_code)
struct ClientList *cl = grp->clients_head;
while (NULL != cl)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "iterating clients for group %p\n",
+ grp);
if (cl->client == client)
{
GNUNET_CONTAINER_DLL_remove (grp->clients_head, grp->clients_tail, cl);
if (NULL == grp->clients_head)
{ /* Last client disconnected. */
-#if FIXME
- if (NULL != grp->tmit_head)
- { /* Send pending messages via CADET before cleanup. */
- transmit_message (grp);
- }
- else
-#endif
- {
- cleanup_group (grp);
- }
+ cleanup_group (grp);
}
}