[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25259 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25259 - gnunet/src/ats |
Date: |
Wed, 5 Dec 2012 15:56:17 +0100 |
Author: wachs
Date: 2012-12-05 15:56:17 +0100 (Wed, 05 Dec 2012)
New Revision: 25259
Modified:
gnunet/src/ats/gnunet-service-ats_addresses.c
Log:
changes
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2012-12-05 14:42:26 UTC
(rev 25258)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2012-12-05 14:56:17 UTC
(rev 25259)
@@ -92,11 +92,6 @@
unsigned long long wan_quota_out;
/**
- * Number of active addresses
- */
- unsigned int active_addr_count;
-
- /**
* Is ATS addresses running
*/
int running;
@@ -244,17 +239,7 @@
&addr->peer.hashPubKey,
addr));
-#if HAVE_LIBGLPK
- if (handle->ats_mode == MODE_MLP)
- GAS_mlp_address_delete (handle->solver, handle->addresses, addr);
-#endif
-
- if (GNUNET_YES == addr->active)
- {
- handle->active_addr_count--;
- addr->active = GNUNET_NO;
- ret = GNUNET_YES;
- }
+ handle->s_del (handle->solver, handle->addresses, addr);
free_address (addr);
return ret;
}
@@ -471,7 +456,6 @@
plugin_name,
plugin_addr, plugin_addr_len,
session_id);
-
aa->mlp_information = NULL;
aa->ats = GNUNET_malloc (atsi_count * sizeof (struct
GNUNET_ATS_Information));
aa->ats_count = atsi_count;
@@ -488,31 +472,33 @@
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added new address for peer `%s'
session id %u, %p\n",
GNUNET_i2s (peer), session_id, aa);
+ /* Tell solver about update */
+ handle->s_update (handle->solver, handle->addresses, aa);
return;
}
- if (old->session_id == 0)
+ if (old->session_id != 0)
{
- /* We have a base address with out an session, update this address */
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Updated existing address for peer `%s' %p with new session
%u\n",
- GNUNET_i2s (peer), old, session_id);
- GNUNET_free_non_null (old->ats);
- old->session_id = session_id;
- old->ats = NULL;
- old->ats_count = 0;
- old->ats = aa->ats;
- old->ats_count = aa->ats_count;
- GNUNET_free (aa->plugin);
- GNUNET_free (aa);
- return;
+ /* This address and session is already existing */
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Added already existing address for peer `%s' `%s' %p with new
session %u\n",
+ GNUNET_i2s (peer), plugin_name, session_id);
+ GNUNET_break (0);
}
- /* This address and session is already existing */
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Added already existing address for peer `%s' `%s' %p with new
session %u\n",
- GNUNET_i2s (peer), plugin_name, session_id);
- GNUNET_break (0);
+ /* We have a base address with out an session, update this address */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Updated existing address for peer `%s' %p with new session %u\n",
+ GNUNET_i2s (peer), old, session_id);
+ GNUNET_free_non_null (old->ats);
+ old->session_id = session_id;
+ old->ats = NULL;
+ old->ats_count = 0;
+ old->ats = aa->ats;
+ old->ats_count = aa->ats_count;
+ GNUNET_free (aa->plugin);
+ GNUNET_free (aa);
+ handle->s_update (handle->solver, handle->addresses, old);
}
@@ -576,7 +562,6 @@
GNUNET_break (0);
break;
}
-
/* Tell solver about update */
handle->s_update (handle->solver, handle->addresses, old);
}
@@ -631,7 +616,6 @@
if (GNUNET_YES == aa->active)
{
aa->active = GNUNET_NO;
- handle->active_addr_count--;
//FIXME recalculate_assigned_bw ();
}
@@ -752,7 +736,8 @@
if (NULL == cur)
{
- GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No address requests pending for peer `%s', cannot
remove!\n", GNUNET_i2s (peer));
return;
}
GNUNET_CONTAINER_DLL_remove (handle->r_head, handle->r_tail, cur);
@@ -1068,7 +1053,6 @@
if (handle->addresses != NULL)
GNUNET_CONTAINER_multihashmap_iterate (handle->addresses,
&free_address_it, NULL);
- GNUNET_assert (handle->active_addr_count == 0);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25259 - gnunet/src/ats,
gnunet <=