gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r16671 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r16671 - gnunet/src/mesh
Date: Thu, 1 Sep 2011 16:28:19 +0200

Author: bartpolot
Date: 2011-09-01 16:28:19 +0200 (Thu, 01 Sep 2011)
New Revision: 16671

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh_api_new.c
Log:
Changed add_peer to drop timeout, updated documentation, minor fixes


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-09-01 13:46:46 UTC (rev 
16670)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-09-01 14:28:19 UTC (rev 
16671)
@@ -812,7 +812,7 @@
 
   if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
   {
-    announce_applications_task = (GNUNET_SCHEDULER_TaskIdentifier) 0;
+    announce_applications_task = GNUNET_SCHEDULER_NO_TASK;
     return;
   }
   p = (unsigned int *) &buffer[8];
@@ -855,7 +855,7 @@
 
   if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
   {
-    announce_id_task = (GNUNET_SCHEDULER_TaskIdentifier) 0;
+    announce_id_task = GNUNET_SCHEDULER_NO_TASK;
     return;
   }
   GNUNET_PEER_resolve (myid, &id);

Modified: gnunet/src/mesh/mesh_api_new.c
===================================================================
--- gnunet/src/mesh/mesh_api_new.c      2011-09-01 13:46:46 UTC (rev 16670)
+++ gnunet/src/mesh/mesh_api_new.c      2011-09-01 14:28:19 UTC (rev 16671)
@@ -221,10 +221,6 @@
    */
   int connected;
 
-    /**
-     * Task to cancel the connection request for this peer
-     */
-  GNUNET_SCHEDULER_TaskIdentifier cancel;
 };
 
 
@@ -405,29 +401,6 @@
 
 
 /**
- * Notify client that the transmission has timed out
- * @param cls closure
- * @param tc task context
- */
-static void
-timeout_peer_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
-  struct GNUNET_MESH_Peer *p = cls;
-  struct GNUNET_PeerIdentity id;
-
-  GNUNET_assert (0 == p->connected);
-  remove_peer_from_tunnel (p);
-
-  if (NULL != p->t->connect_handler)
-    /* FIXME: change handler spec to allow send info about WHO timed out */
-    p->t->connect_handler (p->t->cls, 0, NULL);
-
-  GNUNET_PEER_resolve (p->id, &id);
-  GNUNET_MESH_peer_request_connect_del (p->t, &id);
-  GNUNET_free (p);
-}
-
-/**
  * Add a transmit handle to the transmission queue by priority and set the
  * timeout if needed.
  *
@@ -476,10 +449,7 @@
   tid = ntohl (msg->tunnel_id);
   if (tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_MARK)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "MESH: received an incoming tunnel with tid in local range 
(%X)\n",
-                tid);
-    GNUNET_break_op (0);
+    GNUNET_break (0);
     return;                     //FIXME abort? reconnect?
   }
   t = GNUNET_malloc (sizeof (struct GNUNET_MESH_Tunnel));
@@ -529,11 +499,6 @@
     {
       t->connect_handler (t->cls, &msg->peer, &atsi);
     }
-    if (GNUNET_SCHEDULER_NO_TASK != p->cancel)
-    {
-      GNUNET_SCHEDULER_cancel (p->cancel);
-      p->cancel = GNUNET_SCHEDULER_NO_TASK;
-    }
     p->connected = 1;
   }
   else
@@ -590,12 +555,12 @@
     peer = &to_orig->sender;
     break;
   default:
-    GNUNET_break_op (0);
+    GNUNET_break (0);
     return;
   }
   if (NULL == t)
   {
-    GNUNET_break_op (0);
+    GNUNET_break (0);
     return;
   }
   for (i = 0; i < h->n_handlers; i++)
@@ -975,7 +940,7 @@
  * Request that a peer should be added to the tunnel.  The existing
  * connect handler will be called ONCE with either success or failure.
  * This function should NOT be called again with the same peer before the
- * connect handler is called
+ * connect handler is called.
  *
  * @param tunnel handle to existing tunnel
  * @param timeout how long to try to establish a connection
@@ -983,7 +948,6 @@
  */
 void
 GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel,
-                                      struct GNUNET_TIME_Relative timeout,
                                       const struct GNUNET_PeerIdentity *peer)
 {
   struct GNUNET_MESH_PeerControl msg;
@@ -1002,7 +966,6 @@
     }
   }
   p = add_peer_to_tunnel (tunnel, peer);
-  p->cancel = GNUNET_SCHEDULER_add_delayed (timeout, &timeout_peer_request, p);
 
   msg.header.size = htons (sizeof (struct GNUNET_MESH_PeerControl));
   msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ADD);




reply via email to

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