added logging
[oweals/gnunet.git] / src / social / social_api.c
index 04b6711206f6c718e29fe2838d73c11ba42acff8..923ab5e33b3b0c2743aea54f1b22c342eca6e12b 100644 (file)
@@ -1062,6 +1062,8 @@ place_cleanup (struct GNUNET_SOCIAL_Place *plc)
   }
   if (NULL != plc->mq)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "destroying MQ (place_cleanup)\n");
     GNUNET_MQ_destroy (plc->mq);
     plc->mq = NULL;
   }
@@ -1080,15 +1082,17 @@ place_cleanup (struct GNUNET_SOCIAL_Place *plc)
 void
 place_disconnect (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,
-              "place_disconnect, plc = %p\n",
-              plc);
+              "place_disconnect, plc = %s\n",
+              GNUNET_h2s (&place_pub_hash));
   if (NULL != plc->mq)
   {
     struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
     if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_disconnect, plc);
+      GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_cleanup, plc);
     }
     else
     {
@@ -1150,6 +1154,8 @@ host_disconnected (void *cls, enum GNUNET_MQ_Error error)
   }
   if (NULL != plc->mq)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "destroying MQ (host_disconnected)\n");
     GNUNET_MQ_destroy (plc->mq);
     plc->mq = NULL;
   }
@@ -1658,6 +1664,8 @@ guest_disconnected (void *cls, enum GNUNET_MQ_Error error)
   }
   if (NULL != plc->mq)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "destroying MQ (guest_disconnected)\n");
     GNUNET_MQ_destroy (plc->mq);
     plc->mq = NULL;
   }