gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (3c6761585 -> 6ac64e16e)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (3c6761585 -> 6ac64e16e)
Date: Wed, 27 Jun 2018 04:00:13 +0200

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a change to branch master
in repository gnunet.

    from 3c6761585 gnunet-helper-nat-server.c: fix 100% cpu load
     new 332d987a4 rps service: fix leak in to_file_()
     new 6ac64e16e fix rps service/test: handle pending messages properly

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/rps/gnunet-service-rps.c | 19 +++++++++++++------
 src/rps/test_rps.c           |  9 +++++++++
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 33d4e4fc3..8fe64c2eb 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -724,7 +724,6 @@ mq_liveliness_check_successful (void *cls)
     LOG (GNUNET_ERROR_TYPE_DEBUG,
         "Liveliness check for peer %s was successfull\n",
         GNUNET_i2s (&peer_ctx->peer_id));
-    //GNUNET_free (peer_ctx->liveliness_check_pending);
     remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES);
     peer_ctx->liveliness_check_pending = NULL;
     set_peer_live (peer_ctx);
@@ -747,10 +746,6 @@ check_peer_live (struct PeerContext *peer_ctx)
   struct GNUNET_MQ_Envelope *ev;
 
   ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE);
-  //peer_ctx->liveliness_check_pending = GNUNET_new (struct PendingMessage);
-  //peer_ctx->liveliness_check_pending->ev = ev;
-  //peer_ctx->liveliness_check_pending->peer_ctx = peer_ctx;
-  //peer_ctx->liveliness_check_pending->type = "Check liveliness";
   peer_ctx->liveliness_check_pending =
     insert_pending_message (&peer_ctx->peer_id, ev, "Check liveliness");
   mq = get_mq (&peer_ctx->peer_id);
@@ -1261,6 +1256,13 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity 
*peer)
         "Removing unsent %s\n",
         peer_ctx->pending_messages_head->type);
     /* Cancle pending message, too */
+    if ( (NULL != peer_ctx->liveliness_check_pending) &&
+         (0 == memcmp (peer_ctx->pending_messages_head,
+                     peer_ctx->liveliness_check_pending,
+                     sizeof (struct PendingMessage))) )
+      {
+        peer_ctx->liveliness_check_pending = NULL;
+      }
     remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES);
   }
   /* If we are still waiting for notification whether this peer is live
@@ -1272,7 +1274,7 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
          GNUNET_i2s (&peer_ctx->peer_id));
     // TODO wait until cadet sets mq->cancel_impl
     //GNUNET_MQ_send_cancel (peer_ctx->liveliness_check_pending->ev);
-    GNUNET_free (peer_ctx->liveliness_check_pending);
+    remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES);
     peer_ctx->liveliness_check_pending = NULL;
   }
   channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_SENDING);
@@ -3214,6 +3216,10 @@ handle_peer_push (void *cls,
                                    tmp_att_peer);
       add_peer_array_to_set (peer, 1, att_peer_set);
     }
+    else
+    {
+      GNUNET_free (tmp_att_peer);
+    }
   }
 
 
@@ -3592,6 +3598,7 @@ handle_client_act_malicious (void *cls,
 
     num_mal_peers_sent = ntohl (msg->num_peers) - 1;
     num_mal_peers_old = num_mal_peers;
+    GNUNET_assert (GNUNET_MAX_MALLOC_CHECKED > num_mal_peers_sent);
     GNUNET_array_grow (mal_peers,
                        num_mal_peers,
                        num_mal_peers + num_mal_peers_sent);
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index e7b82458a..08424022f 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -841,6 +841,13 @@ seed_peers (void *cls)
   unsigned int amount;
   unsigned int i;
 
+  if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test)
+  {
+    return;
+  }
+
+  GNUNET_assert (NULL != peer->rps_handle);
+
   // TODO if malicious don't seed mal peers
   amount = round (.5 * num_peers);
 
@@ -998,9 +1005,11 @@ rps_connect_adapter (void *cls,
   struct GNUNET_RPS_Handle *h;
 
   h = GNUNET_RPS_connect (cfg);
+  GNUNET_assert (NULL != h);
 
   if (NULL != cur_test_run.pre_test)
     cur_test_run.pre_test (cls, h);
+  GNUNET_assert (NULL != h);
 
   return h;
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]