psyc, social
authorGabor X Toth <*@tg-x.net>
Fri, 19 Aug 2016 19:58:20 +0000 (19:58 +0000)
committerGabor X Toth <*@tg-x.net>
Fri, 19 Aug 2016 19:58:20 +0000 (19:58 +0000)
src/psyc/psyc_api.c
src/social/gnunet-service-social.c
src/social/social_api.c
src/social/test_social.c

index 45e4135a321de9ea0fbf76a27555777db5afa9c2..ca72a44c03016edef876f0c6ee6d9433a368d95e 100644 (file)
@@ -573,11 +573,10 @@ channel_disconnect (struct GNUNET_PSYC_Channel *chn,
 
   if (NULL != chn->mq)
   {
-    struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (chn->mq);
-    if (NULL != last)
+    struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq);
+    if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (last,
-                             (GNUNET_MQ_NotifyCallback) channel_cleanup, chn);
+      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) channel_cleanup, chn);
     }
     else
     {
@@ -619,17 +618,16 @@ master_disconnected (void *cls, enum GNUNET_MQ_Error error)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Master client disconnected (%d), re-connecting\n",
        (int) error);
-  if (NULL != chn->mq)
-  {
-    GNUNET_MQ_destroy (chn->mq);
-    chn->mq = NULL;
-  }
   if (NULL != chn->tmit)
   {
     GNUNET_PSYC_transmit_destroy (chn->tmit);
     chn->tmit = NULL;
   }
-
+  if (NULL != chn->mq)
+  {
+    GNUNET_MQ_destroy (chn->mq);
+    chn->mq = NULL;
+  }
   chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay,
                                                       master_reconnect,
                                                       mst);
@@ -919,16 +917,16 @@ slave_disconnected (void *cls, enum GNUNET_MQ_Error error)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Slave client disconnected (%d), re-connecting\n",
        (int) error);
-  if (NULL != chn->mq)
-  {
-    GNUNET_MQ_destroy (chn->mq);
-    chn->mq = NULL;
-  }
   if (NULL != chn->tmit)
   {
     GNUNET_PSYC_transmit_destroy (chn->tmit);
     chn->tmit = NULL;
   }
+  if (NULL != chn->mq)
+  {
+    GNUNET_MQ_destroy (chn->mq);
+    chn->mq = NULL;
+  }
   chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay,
                                                       slave_reconnect,
                                                       slv);
index 14c457531b3d238bfbe23507d9630bea9d9ae6c5..01a624e2af5351d7578f5c163cbd2123d89ec08a 100644 (file)
@@ -507,7 +507,7 @@ cleanup_guest (struct Guest *gst)
   struct Place *plc = &gst->plc;
   struct GNUNET_CONTAINER_MultiHashMap *
     plc_gst = GNUNET_CONTAINER_multihashmap_get (place_guests,
-                                                &plc->pub_key_hash);
+                                                 &plc->pub_key_hash);
   GNUNET_assert (NULL != plc_gst); // FIXME
   GNUNET_CONTAINER_multihashmap_remove (plc_gst, &plc->ego_pub_hash, gst);
 
index f73ae17dfa4db5ea5f31d3eef5476a673f8da549..e34774aae6b4fce8272a0f59fc7b669775b8bf93 100644 (file)
@@ -1075,11 +1075,10 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc,
 
   if (NULL != plc->mq)
   {
-    struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (plc->mq);
-    if (NULL != last)
+    struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
+    if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (last,
-                             (GNUNET_MQ_NotifyCallback) place_cleanup, plc);
+      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) place_cleanup, plc);
     }
     else
     {
@@ -1132,16 +1131,16 @@ host_disconnected (void *cls, enum GNUNET_MQ_Error error)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Host client disconnected (%d), re-connecting\n",
        (int) error);
-  if (NULL != plc->mq)
-  {
-    GNUNET_MQ_destroy (plc->mq);
-    plc->mq = NULL;
-  }
   if (NULL != plc->tmit)
   {
     GNUNET_PSYC_transmit_destroy (plc->tmit);
     plc->tmit = NULL;
   }
+  if (NULL != plc->mq)
+  {
+    GNUNET_MQ_destroy (plc->mq);
+    plc->mq = NULL;
+  }
 
   plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay,
                                                       host_reconnect,
@@ -1634,16 +1633,16 @@ guest_disconnected (void *cls, enum GNUNET_MQ_Error error)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Guest client disconnected (%d), re-connecting\n",
        (int) error);
-  if (NULL != plc->mq)
-  {
-    GNUNET_MQ_destroy (plc->mq);
-    plc->mq = NULL;
-  }
   if (NULL != plc->tmit)
   {
     GNUNET_PSYC_transmit_destroy (plc->tmit);
     plc->tmit = NULL;
   }
+  if (NULL != plc->mq)
+  {
+    GNUNET_MQ_destroy (plc->mq);
+    plc->mq = NULL;
+  }
 
   plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay,
                                                       guest_reconnect,
@@ -2690,11 +2689,10 @@ GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,
 
   if (NULL != app->mq)
   {
-    struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (app->mq);
-    if (NULL != last)
+    struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq);
+    if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (last,
-                             (GNUNET_MQ_NotifyCallback) app_cleanup, app);
+      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) app_cleanup, app);
     }
     else
     {
index 5ab6c83fa0983470bde2f5b147ee5fce91ce0b28..4960b8820ab6a3d724e0a8455f792ebab860061f 100644 (file)
@@ -1123,7 +1123,7 @@ host_answer_door (void *cls,
     break;
 
   default:
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "invalid test: %d\n", test);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid test: #%u\n", test);
     GNUNET_assert (0);
   }
 }