}
+static void
+place_send_leave_ack (const struct Place *plc)
+{
+ struct GNUNET_MQ_Envelope *env;
+
+ for (struct ClientListItem *cli = plc->clients_head;
+ NULL != cli;
+ cli = cli->next)
+ {
+ env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE_ACK);
+ GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (cli->client),
+ env);
+ }
+}
+
+
/**
* Send a result code back to the client.
*
struct Client *c = cls;
struct GNUNET_SERVICE_Client *client = c->client;
struct Place *plc = c->place;
- struct GNUNET_MQ_Envelope *env;
if (NULL == plc)
{
return;
}
- for (struct ClientListItem *cli = plc->clients_head;
- NULL != cli;
- cli = cli->next)
- {
- env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE_ACK);
- GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (cli->client),
- env);
- }
-
if (GNUNET_YES != plc->is_disconnected)
{
plc->is_disconnected = GNUNET_YES;
if (NULL != plc->tmit_msgs_head)
{ /* Send pending messages to PSYC before cleanup. */
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "not cleaning up place of client %p\n",
+ client);
psyc_transmit_message (plc);
}
else
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "cleaning up place of client %p\n",
+ client);
+ place_send_leave_ack (plc);
cleanup_place (plc);
c->place = NULL;
}
if (NULL == plc)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "received PSYC message for non-existing client %p\n",
+ client);
GNUNET_break (0);
GNUNET_SERVICE_client_drop (client);
return;
{
struct GNUNET_HashCode place_pub_hash;
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "place_cleanup\n");
+
GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash);
if (NULL != plc->tmit)
{
void *notify_data_cls,
enum GNUNET_SOCIAL_AnnounceFlags flags)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "PSYC_transmit_message for host\n");
if (GNUNET_OK ==
GNUNET_PSYC_transmit_message (hst->plc.tmit, method_name, env,
NULL, notify_data, notify_data_cls, flags))
GNUNET_ContinuationCallback disconnect_cb,
void *cls)
{
- struct GNUNET_MessageHeader *msg;
struct GNUNET_MQ_Envelope *envelope;
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "sending _notice_place_closing\n");
GNUNET_SOCIAL_host_announce (hst, "_notice_place_closing", env, NULL, NULL,
GNUNET_SOCIAL_ANNOUNCE_NONE);
hst->plc.disconnect_cb = disconnect_cb;
hst->plc.disconnect_cls = cls;
- envelope = GNUNET_MQ_msg (msg,
- GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
+ envelope = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
GNUNET_MQ_send (hst->plc.mq,
envelope);
}
void *notify_data_cls,
enum GNUNET_SOCIAL_TalkFlags flags)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "PSYC_transmit_message for guest\n");
+
struct GNUNET_SOCIAL_Place *plc = &gst->plc;
GNUNET_assert (NULL != plc->tmit);
GNUNET_ContinuationCallback disconnect_cb,
void *cls)
{
- struct GNUNET_MessageHeader *msg;
struct GNUNET_MQ_Envelope *envelope;
GNUNET_SOCIAL_guest_talk (gst, "_notice_place_leave", env, NULL, NULL,
GNUNET_SOCIAL_TALK_NONE);
gst->plc.disconnect_cb = disconnect_cb;
gst->plc.disconnect_cls = cls;
- envelope = GNUNET_MQ_msg (msg,
- GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
+ envelope = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE);
GNUNET_MQ_send (gst->plc.mq,
envelope);
}