gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27398 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r27398 - gnunet/src/ats
Date: Fri, 7 Jun 2013 15:59:44 +0200

Author: wachs
Date: 2013-06-07 15:59:44 +0200 (Fri, 07 Jun 2013)
New Revision: 27398

Modified:
   gnunet/src/ats/gnunet-service-ats-solver_proportional.c
   gnunet/src/ats/gnunet-service-ats_addresses.c
   gnunet/src/ats/gnunet-service-ats_addresses.h
   gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
Log:
rename


Modified: gnunet/src/ats/gnunet-service-ats-solver_proportional.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_proportional.c     2013-06-07 
13:18:59 UTC (rev 27397)
+++ gnunet/src/ats/gnunet-service-ats-solver_proportional.c     2013-06-07 
13:59:44 UTC (rev 27398)
@@ -1344,6 +1344,8 @@
   uint32_t addr_net;
   int save_active = GNUNET_NO;
   struct Network *new_net = NULL;
+
+  /* Check updates to performance information */
   for (i = 0; i < prev_atsi_count; i++)
   {
     prev_type = ntohl (prev_ats[i].type);
@@ -1461,15 +1463,9 @@
   struct GAS_PROPORTIONAL_Handle *s = solver;
   struct Network *net = NULL;
   struct AddressWrapper *aw = NULL;
-  int c;
+  GNUNET_assert (NULL != s);
 
-  GNUNET_assert (NULL != s);
-  for (c = 0; c < s->networks; c++)
-  {
-      net = &s->network_entries[c];
-      if (network == net->type)
-          break;
-  }
+  net = get_network (s, network);
   if (NULL == net)
   {
     GNUNET_break (0);

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2013-06-07 13:18:59 UTC 
(rev 27397)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2013-06-07 13:59:44 UTC 
(rev 27398)
@@ -876,7 +876,9 @@
   struct ATS_Address *aa;
   struct GNUNET_ATS_Information *atsi_delta;
   uint32_t atsi_delta_count;
+  uint32_t prev_session;
 
+
   if (GNUNET_NO == handle->running)
     return;
 
@@ -912,8 +914,11 @@
                                aa->assigned_bw_out,
                                aa->assigned_bw_in);
   }
+  prev_session = aa->session_id;
+  aa->session_id = session_id;
+
   /* Tell solver about update */
-  handle->s_update (handle->solver, handle->addresses, aa, session_id, 
aa->used, atsi_delta, atsi_delta_count);
+  handle->s_update (handle->solver, handle->addresses, aa, prev_session, 
aa->used, atsi_delta, atsi_delta_count);
   GNUNET_free_non_null (atsi_delta);
 }
 

Modified: gnunet/src/ats/gnunet-service-ats_addresses.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.h       2013-06-07 13:18:59 UTC 
(rev 27397)
+++ gnunet/src/ats/gnunet-service-ats_addresses.h       2013-06-07 13:59:44 UTC 
(rev 27398)
@@ -444,20 +444,20 @@
  * @param solver the solver to use
  * @param addresses the address hashmap containing all addresses
  * @param address the address
- * @param session the session
+ * @param session the previous session
  * @param in_use address used: yes or no
- * @param atsi ats performance information
- * @param atsi_count number of ats performance information
+ * @param atsi ats previous performance information
+ * @param atsi_count previous number of ats performance information
  *
  */
 typedef void
 (*GAS_solver_address_update) (void *solver,
                               struct GNUNET_CONTAINER_MultiHashMap *addresses,
                               struct ATS_Address *address,
-                              uint32_t session,
+                              uint32_t prev_session,
                               int in_use,
-                              const struct GNUNET_ATS_Information *atsi,
-                              uint32_t atsi_count);
+                              const struct GNUNET_ATS_Information *prev_atsi,
+                              uint32_t prev_atsi_count);
 
 
 /**

Modified: gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2013-06-07 13:18:59 UTC 
(rev 27397)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2013-06-07 13:59:44 UTC 
(rev 27398)
@@ -1313,7 +1313,7 @@
  * @param solver the solver Handle
  * @param addresses the address hashmap containing all addresses
  * @param address the update address
- * @param session the new session (if changed otherwise current)
+ * @param prev_session the new session (if changed otherwise current)
  * @param in_use the new address in use state (if changed otherwise current)
  * @param atsi_prev ATS information updated + previous values, 
GNUNET_ATS_VALUE_UNDEFINED if not existing before
  * @param atsi_count_prev number of atsi values updated
@@ -1322,10 +1322,10 @@
 GAS_mlp_address_update (void *solver,
                         struct GNUNET_CONTAINER_MultiHashMap *addresses,
                         struct ATS_Address *address,
-                        uint32_t session,
+                        uint32_t prev_session,
                         int in_use,
-                        const struct GNUNET_ATS_Information *atsi_prev,
-                        uint32_t atsi_count_prev)
+                        const struct GNUNET_ATS_Information *prev_atsi,
+                        uint32_t prev_atsi_count)
 {
        struct ATS_Peer *p;
        struct GAS_MLP_Handle *mlp = solver;
@@ -1334,14 +1334,14 @@
        GNUNET_assert (NULL != solver);
        GNUNET_assert (NULL != addresses);
        GNUNET_assert (NULL != address);
-       GNUNET_assert ((NULL != atsi_prev) || (0 == atsi_count_prev));
+       GNUNET_assert ((NULL != prev_atsi) || (0 == prev_atsi_count));
 
   if (NULL == mlpi)
   {
       LOG (GNUNET_ERROR_TYPE_ERROR, _("Updating address for peer `%s' not 
added before\n"), GNUNET_i2s(&address->peer));
       return;
   }
-       mlp_update_quality (mlp, addresses, address, atsi_prev, 
atsi_count_prev);
+       mlp_update_quality (mlp, addresses, address, prev_atsi, 
prev_atsi_count);
 
   /* Is this peer included in the problem? */
   if (NULL == (p = GNUNET_CONTAINER_multihashmap_get (mlp->peers, 
&address->peer.hashPubKey)))




reply via email to

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