gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r10908 - gnunet/src/transport
Date: Wed, 14 Apr 2010 20:58:07 +0200

Author: grothoff
Date: 2010-04-14 20:58:07 +0200 (Wed, 14 Apr 2010)
New Revision: 10908

Modified:
   gnunet/src/transport/gnunet-service-transport.c
Log:
work in progress

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-04-14 18:13:29 UTC 
(rev 10907)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-04-14 18:58:07 UTC 
(rev 10908)
@@ -24,12 +24,7 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - Need to SIGNAL connection in 'mark_address_connected'
- *   (if cnt == GNUNET_YES at the end!)
- * - Need to SIGNAL disconnect when we no longer have any validated
- *   address (NAT case!)
  * - Need to defer forwarding messages until after CONNECT message
- * - MIGHT want to track connected state with neighbour
  * - CHECK that 'address' being NULL in 'struct ForeignAddressList' is
  *   tolerated in the code everywhere (could not happen before)
  *
@@ -997,6 +992,7 @@
   struct ForeignAddressList *pos;
   int cnt;
 
+  GNUNET_assert (GNUNET_YES == fal->validated);
   if (fal->connected == GNUNET_YES)
     return; /* nothing to do */
   cnt = GNUNET_YES;
@@ -1013,10 +1009,12 @@
     }
   fal->connected = GNUNET_YES;
   if (GNUNET_YES == cnt)
-    GNUNET_STATISTICS_update (stats,
-                             gettext_noop ("# connected addresses"),
-                             1,
-                             GNUNET_NO);
+    {
+      GNUNET_STATISTICS_update (stats,
+                               gettext_noop ("# connected addresses"),
+                               1,
+                               GNUNET_NO);
+    }
 }
 
 
@@ -1140,7 +1138,8 @@
          mq->specific_address->timeout =
            GNUNET_TIME_relative_to_absolute
            (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
-         mark_address_connected (mq->specific_address);
+         if (mq->specific_address->validated == GNUNET_YES)
+           mark_address_connected (mq->specific_address);
        }    
       else
        {
@@ -1743,6 +1742,18 @@
   else
     prev->next = pos->next;
   GNUNET_free (pos);
+  if (nl->received_pong == GNUNET_NO)
+    return; /* nothing to do */
+  /* check if we have any validated addresses left */
+  pos = rl->addresses;
+  while (pos != NULL)
+    {
+      if (pos->validated)
+       return;
+      pos = pos->next;
+    }
+  /* no valid addresses left, signal disconnect! */
+  disconnect_neighbour (nl, GNUNET_NO);  
 }
 
 
@@ -3728,7 +3739,8 @@
  * Start the specified transport (load the plugin).
  */
 static void
-start_transport (struct GNUNET_SERVER_Handle *server, const char *name)
+start_transport (struct GNUNET_SERVER_Handle *server, 
+                const char *name)
 {
   struct TransportPlugin *plug;
   char *libname;





reply via email to

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