aboutsummaryrefslogtreecommitdiff
path: root/src/social/gnunet-service-social.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/social/gnunet-service-social.c')
-rw-r--r--src/social/gnunet-service-social.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index 3e527cbaf..3f6999269 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -635,6 +635,22 @@ place_send_msg (const struct Place *plc,
635} 635}
636 636
637 637
638static void
639place_send_leave_ack (const struct Place *plc)
640{
641 struct GNUNET_MQ_Envelope *env;
642
643 for (struct ClientListItem *cli = plc->clients_head;
644 NULL != cli;
645 cli = cli->next)
646 {
647 env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE_ACK);
648 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (cli->client),
649 env);
650 }
651}
652
653
638/** 654/**
639 * Send a result code back to the client. 655 * Send a result code back to the client.
640 * 656 *
@@ -2139,7 +2155,6 @@ handle_client_place_leave (void *cls,
2139 struct Client *c = cls; 2155 struct Client *c = cls;
2140 struct GNUNET_SERVICE_Client *client = c->client; 2156 struct GNUNET_SERVICE_Client *client = c->client;
2141 struct Place *plc = c->place; 2157 struct Place *plc = c->place;
2142 struct GNUNET_MQ_Envelope *env;
2143 2158
2144 if (NULL == plc) 2159 if (NULL == plc)
2145 { 2160 {
@@ -2148,24 +2163,22 @@ handle_client_place_leave (void *cls,
2148 return; 2163 return;
2149 } 2164 }
2150 2165
2151 for (struct ClientListItem *cli = plc->clients_head;
2152 NULL != cli;
2153 cli = cli->next)
2154 {
2155 env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE_ACK);
2156 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (cli->client),
2157 env);
2158 }
2159
2160 if (GNUNET_YES != plc->is_disconnected) 2166 if (GNUNET_YES != plc->is_disconnected)
2161 { 2167 {
2162 plc->is_disconnected = GNUNET_YES; 2168 plc->is_disconnected = GNUNET_YES;
2163 if (NULL != plc->tmit_msgs_head) 2169 if (NULL != plc->tmit_msgs_head)
2164 { /* Send pending messages to PSYC before cleanup. */ 2170 { /* Send pending messages to PSYC before cleanup. */
2171 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2172 "not cleaning up place of client %p\n",
2173 client);
2165 psyc_transmit_message (plc); 2174 psyc_transmit_message (plc);
2166 } 2175 }
2167 else 2176 else
2168 { 2177 {
2178 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2179 "cleaning up place of client %p\n",
2180 client);
2181 place_send_leave_ack (plc);
2169 cleanup_place (plc); 2182 cleanup_place (plc);
2170 c->place = NULL; 2183 c->place = NULL;
2171 } 2184 }
@@ -2867,6 +2880,9 @@ handle_client_psyc_message (void *cls,
2867 2880
2868 if (NULL == plc) 2881 if (NULL == plc)
2869 { 2882 {
2883 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2884 "received PSYC message for non-existing client %p\n",
2885 client);
2870 GNUNET_break (0); 2886 GNUNET_break (0);
2871 GNUNET_SERVICE_client_drop (client); 2887 GNUNET_SERVICE_client_drop (client);
2872 return; 2888 return;