[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21704 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21704 - gnunet/src/ats |
Date: |
Fri, 1 Jun 2012 17:36:14 +0200 |
Author: wachs
Date: 2012-06-01 17:36:14 +0200 (Fri, 01 Jun 2012)
New Revision: 21704
Modified:
gnunet/src/ats/gnunet-service-ats_addresses.c
Log:
fix for 0002392
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2012-06-01 15:15:03 UTC
(rev 21703)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2012-06-01 15:36:14 UTC
(rev 21704)
@@ -355,11 +355,10 @@
aa->ats_count = atsi_count;
memcpy (aa->ats, atsi, atsi_count * sizeof (struct GNUNET_ATS_Information));
-#if DEBUG_ATS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating address for peer `%s' %u\n",
GNUNET_i2s (peer),
session_id);
-#endif
+
/* Get existing address or address with session == 0 */
old = find_address (peer, aa);
if (old == NULL)
@@ -458,11 +457,11 @@
(aa->addr_len == info->addr_len) &&
(0 == memcmp (info->addr, aa->addr, aa->addr_len)))
{
-#if VERBOSE
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Deleting address for peer `%s': `%s' %u\n",
GNUNET_i2s (&aa->peer), aa->plugin, aa->session_id);
-#endif
+
if (GNUNET_YES == destroy_address (aa))
recalculate_assigned_bw ();
return GNUNET_OK;
@@ -559,13 +558,36 @@
return GNUNET_OK;
}
-
aa->block_interval = GNUNET_TIME_relative_add (aa->block_interval,
ATS_BLOCKING_DELTA);
aa->blocked_until = GNUNET_TIME_absolute_add (now, aa->block_interval);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Address %p ready for suggestion, block interval now %llu \n",
aa, aa->block_interval);
+ /* FIXME this is a hack */
+
+
+ if (NULL != ab)
+ {
+ if ((0 == strcmp (ab->plugin, "tcp")) &&
+ (0 == strcmp (aa->plugin, "tcp")))
+ {
+ if ((0 != ab->addr_len) &&
+ (0 == aa->addr_len))
+ {
+ /* saved address was an outbound address, but we have an inbound
address */
+ *ap = aa;
+ return GNUNET_OK;
+ }
+ if (0 == ab->addr_len)
+ {
+ /* saved address was an inbound address, so do not overwrite */
+ return GNUNET_OK;
+ }
+ }
+ }
+ /* FIXME end of hack */
+
if (NULL == ab)
{
*ap = aa;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21704 - gnunet/src/ats,
gnunet <=