if (NULL != c->app_id)
GNUNET_free (c->app_id);
-
GNUNET_free (c);
if (NULL == plc)
{
if (cli->client == client)
{
- GNUNET_CONTAINER_DLL_remove (plc->clients_head, plc->clients_tail, cli);
+ GNUNET_CONTAINER_DLL_remove (plc->clients_head,
+ plc->clients_tail,
+ cli);
GNUNET_free (cli);
break;
}
struct GNUNET_SERVICE_Client *client,
struct GNUNET_MQ_Handle *mq)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client connected: %p\n", client);
+ struct Client *c = GNUNET_new (struct Client);
- struct Client *c = GNUNET_malloc (sizeof (*c));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Client %p connected with queue %p\n",
+ client,
+ mq);
c->client = client;
-
return c;
}
}
-int
+static int
app_places_entry_remove (void *cls, const struct GNUNET_HashCode *key, void *value)
{
struct Place *plc = cls;
/* FIXME: disconnect from the network, but keep local connection for history access */
/* Disconnect all clients connected to the place */
- struct ClientListItem *cli = plc->clients_head, *next;
- while (NULL != cli)
+
+ for (struct ClientListItem *cli = plc->clients_head;
+ NULL != cli;
+ cli = cli->next)
{
- GNUNET_CONTAINER_DLL_remove (plc->clients_head, plc->clients_tail, cli);
// protocol design failure: should *tell* clients that room is gone!
- GNUNET_SERVICE_client_drop (cli->client);
- next = cli->next;
- GNUNET_free (cli);
- cli = next;
+ if (client != cli->client)
+ GNUNET_SERVICE_client_drop (cli->client);
}
if (GNUNET_YES != plc->is_disconnected)
else
{
cleanup_place (plc);
+ c->place = NULL;
}
}
// FIXME: can't continue+drop above, but should not drop above!
- // GNUNET_SERVICE_client_continue (client);
+ GNUNET_SERVICE_client_continue (client);
}
"%p Received message with invalid payload size (%u) from client.\n",
plc, psize);
GNUNET_break (0);
- psyc_transmit_cancel (plc, client);
GNUNET_SERVICE_client_drop (client);
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%p Received invalid message part from client.\n", plc);
GNUNET_break (0);
- psyc_transmit_cancel (plc, client);
GNUNET_SERVICE_client_drop (client);
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%p Received invalid message part from client.\n", plc);
GNUNET_break (0);
- psyc_transmit_cancel (plc, client);
ret = GNUNET_SYSERR;
}
place_cleanup (struct GNUNET_SOCIAL_Place *plc)
{
struct GNUNET_HashCode place_pub_hash;
+
GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"%s place cleanup: %s\n",
{
struct LeaveContext *lc = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "social_api: guest's place_leave message sent!\n");
GNUNET_SOCIAL_guest_disconnect (lc->gst,
lc->disconnect_cb,
lc->disconnect_cb_cls);