gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: fixing misc ats simple issu


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fixing misc ats simple issues
Date: Fri, 25 Jan 2019 23:15:20 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new d1a4a8f64 fixing misc ats simple issues
d1a4a8f64 is described below

commit d1a4a8f64bba3399d16b2717c67f00957963983b
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Jan 25 23:15:16 2019 +0100

    fixing misc ats simple issues
---
 src/ats/gnunet-service-ats-new.c |  5 +++++
 src/ats/plugin_ats2_simple.c     | 11 ++++++++---
 src/ats/test_ats2_lib.c          |  7 +++++--
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/ats/gnunet-service-ats-new.c b/src/ats/gnunet-service-ats-new.c
index 30e265b44..dd65d54a2 100644
--- a/src/ats/gnunet-service-ats-new.c
+++ b/src/ats/gnunet-service-ats-new.c
@@ -463,6 +463,7 @@ handle_session_add (void *cls,
   session->sh = plugin->session_add (plugin->cls,
                                     &session->data,
                                     address);
+  GNUNET_assert (NULL != session->sh);
   GNUNET_SERVICE_client_continue (c->client);
 }
 
@@ -530,9 +531,11 @@ handle_session_del (void *cls,
     GNUNET_SERVICE_client_drop (c->client);
     return;
   }
+  GNUNET_assert (NULL != session->sh);
   plugin->session_del (plugin->cls,
                       session->sh,
                       &session->data);
+  session->sh = NULL;
   GNUNET_assert (GNUNET_YES ==
                 GNUNET_CONTAINER_multihashmap32_remove 
(c->details.transport.sessions,
                                                         session->session_id,
@@ -582,9 +585,11 @@ free_session (void *cls,
 
   (void) key;
   GNUNET_assert (c == session->client);
+  GNUNET_assert (NULL != session->sh);
   plugin->session_del (plugin->cls,
                       session->sh,
                       &session->data);
+  session->sh = NULL;
   GNUNET_free (session);
   return GNUNET_OK;
 }
diff --git a/src/ats/plugin_ats2_simple.c b/src/ats/plugin_ats2_simple.c
index 1551420c5..dacd2e122 100644
--- a/src/ats/plugin_ats2_simple.c
+++ b/src/ats/plugin_ats2_simple.c
@@ -825,12 +825,15 @@ update_counters (void *cls,
   }
   /* for first round, assign target bandwidth simply to sum of
      requested bandwidth */
-  for (enum GNUNET_MQ_PreferenceKind pk = 0;
+  for (enum GNUNET_MQ_PreferenceKind pk = 1 /* skip GNUNET_MQ_PREFERENCE_NONE 
*/;
        pk < GNUNET_MQ_PREFERENCE_COUNT;
        pk++)
   {
-    enum GNUNET_NetworkType nt = best[pk]->data->prop.nt;
+    const struct GNUNET_ATS_SessionData *data = best[pk]->data;
+    enum GNUNET_NetworkType nt;
 
+    GNUNET_assert (NULL != data);
+    nt = data->prop.nt;
     best[pk]->target_out = GNUNET_MIN (peer->bw_by_pk[pk],
                                        MIN_BANDWIDTH_PER_SESSION);
     c->bw_out_by_nt[nt] += (uint64_t) (best[pk]->target_out - 
MIN_BANDWIDTH_PER_SESSION);
@@ -974,6 +977,7 @@ simple_session_add (void *cls,
   struct GNUNET_ATS_SessionHandle *sh;
 
   /* setup session handle */
+  GNUNET_assert (NULL != data);
   if (NULL == address)
     alen = 0;
   else
@@ -1009,7 +1013,7 @@ simple_session_add (void *cls,
     sh->hello = hello;
   }
   update (h);
-  return NULL;
+  return sh;
 }
 
 
@@ -1028,6 +1032,7 @@ simple_session_update (void *cls,
 {
   struct SimpleHandle *h = cls;
 
+  GNUNET_assert (NULL != data);
   sh->data = data; /* this statement should not really do anything... */
   update (h);
 }
diff --git a/src/ats/test_ats2_lib.c b/src/ats/test_ats2_lib.c
index 437e8baf2..31a88e710 100644
--- a/src/ats/test_ats2_lib.c
+++ b/src/ats/test_ats2_lib.c
@@ -215,7 +215,9 @@ run (void *cls,
   init_both (cfg);
   provide_info_start ();
   get_suggestion ();
-  (void) GNUNET_SCHEDULER_add_delayed (timeout, &on_shutdown, NULL);
+  (void) GNUNET_SCHEDULER_add_delayed (timeout,
+                                      &on_shutdown,
+                                      NULL);
 }
 
 
@@ -233,7 +235,8 @@ main (int argc,
 {
   ret = 1;
   memset (&other_peer, 0, sizeof (struct GNUNET_PeerIdentity));
-  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500);
+  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
+                                          2);
   if (0 != GNUNET_TESTING_peer_run ("test-ats2-lib",
                                     "test_ats2_lib.conf",
                                     &run, NULL))

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



reply via email to

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