gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22279 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r22279 - gnunet/src/transport
Date: Mon, 25 Jun 2012 20:31:13 +0200

Author: grothoff
Date: 2012-06-25 20:31:13 +0200 (Mon, 25 Jun 2012)
New Revision: 22279

Modified:
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
-LRN: reverting earlier attempt to fix LRN's NAT connect issue

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-06-25 
18:27:28 UTC (rev 22278)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-06-25 
18:31:13 UTC (rev 22279)
@@ -1749,15 +1749,6 @@
               (GNUNET_OK == result) ? "allowed" : "FORBIDDEN");
   if (NULL == (n = lookup_neighbour (peer)))
     goto cleanup; /* nobody left to care about new address */
-  if (GNUNET_OK == result)
-  {
-    /* valid new address, let ATS know (regardless of where we are
-       in the state machine) */
-    GNUNET_ATS_address_add (GST_ats,
-                           bcc->na.address,
-                           bcc->na.session,
-                           bcc->ats, bcc->ats_count);
-  }
   switch (n->state)
   {
   case S_NOT_CONNECTED:
@@ -1801,31 +1792,25 @@
     }
     break;
   case S_CONNECT_SENT:
-    /* waiting on CONNECT_ACK, switch session and send ACK if one is pending */
+    /* waiting on CONNECT_ACK, send ACK if one is pending */
     if ( (GNUNET_OK == result) &&
         (1 == n->send_connect_ack) )
     {
       n->send_connect_ack = 2;
-      /* FIXME: we might be switching to a different address here without
-        asking (or telling!) ATS; while this is done for a good reason --
-        our CONNECT was not answered, but we got another session with
-        a CONNECT from the other peer, so maybe this is an inbound session
-        that actually works -- this is unclean as ATS needs to be told
-        about this (or even asked first!?) Anyway, I'm adding this as
-        something expermental for now to see if it fixes issues LRN reported
-        on IRC on 24/6/2012.  */
-      set_address (&n->primary_address,
-                  bcc->na.address,
-                  bcc->na.session,
-                  n->primary_address.bandwidth_in,
-                  n->primary_address.bandwidth_out,
-                  GNUNET_YES);
       send_session_connect_ack_message (n->primary_address.address,
                                        n->primary_address.session,
                                        n->connect_ack_timestamp);
     }
     break; 
   case S_CONNECT_RECV_BLACKLIST_INBOUND:
+    if (GNUNET_OK == result)
+    {
+      /* valid new address, let ATS know! */
+      GNUNET_ATS_address_add (GST_ats,
+                              bcc->na.address,
+                              bcc->na.session,
+                              bcc->ats, bcc->ats_count);
+    }
     n->state = S_CONNECT_RECV_ATS;
     n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT);
     GNUNET_ATS_reset_backoff (GST_ats, peer);
@@ -2106,8 +2091,9 @@
     /* get rid of remains without terminating sessions, ready to re-try */
     free_neighbour (n, GNUNET_YES);
     n = setup_neighbour (peer);
-    n->state = S_CONNECT_RECV_BLACKLIST_INBOUND;
-    check_blacklist (peer, ts, address, session, ats, ats_count);
+    n->state = S_CONNECT_RECV_ATS;
+    GNUNET_ATS_reset_backoff (GST_ats, peer);
+    GNUNET_ATS_suggest_address (GST_ats, peer);
     break;
   case S_DISCONNECT_FINISHED:
     /* should not be possible */




reply via email to

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