gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r23635 - gnunet/src/mesh
Date: Tue, 4 Sep 2012 19:20:23 +0200

Author: bartpolot
Date: 2012-09-04 19:20:23 +0200 (Tue, 04 Sep 2012)
New Revision: 23635

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- simplify multicast client flow control, base all on ACKs

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-09-04 16:58:57 UTC (rev 
23634)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-09-04 17:20:23 UTC (rev 
23635)
@@ -115,10 +115,6 @@
   /** Tunnel it belongs to. */
   struct MeshTunnel *t;
 
-  /** In case of a multicast, task to allow a client to send more data if
-   * some neighbor is too slow. */
-  GNUNET_SCHEDULER_TaskIdentifier *task;
-
   /** How many remaining neighbors we need to send this to. */
   unsigned int reference_counter;
 
@@ -1777,16 +1773,6 @@
   if (0 == --(mesh_data->reference_counter))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Last copy!\n");
-    if (NULL != mesh_data->task)
-    {
-      if (GNUNET_SCHEDULER_NO_TASK != *(mesh_data->task))
-      {
-        GNUNET_SCHEDULER_cancel (*(mesh_data->task));
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " notifying client...\n");
-        GNUNET_SERVER_receive_done (mesh_data->t->owner->handle, GNUNET_OK);
-      }
-      GNUNET_free (mesh_data->task);
-    }
     GNUNET_free (mesh_data->data);
     GNUNET_free (mesh_data);
   }
@@ -1843,31 +1829,6 @@
 
 
 /**
- * Allow a client to send more data after transmitting a multicast message
- * which some neighbor has not yet accepted altough a reasonable time has
- * passed.
- *
- * @param cls Closure (DataDescriptor containing the task identifier)
- * @param tc Task Context
- * 
- * FIXME fc replace with proper ack
- */
-static void
-client_allow_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
-  struct MeshData *mdata = cls;
-
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "CLIENT ALLOW SEND DESPITE %u COPIES PENDING\n",
-              mdata->reference_counter);
-  *(mdata->task) = GNUNET_SCHEDULER_NO_TASK;
-  GNUNET_SERVER_receive_done (mdata->t->owner->handle, GNUNET_OK);
-}
-
-
-/**
  * Check whether client wants traffic from a tunnel.
  *
  * @param c Client to check.
@@ -3319,7 +3280,9 @@
  *
  * @param t Tunnel in which to send the data.
  * @param msg Message to be sent.
- * @param internal Has the service generated this message?
+ * @param internal DEPRECATED Has the service generated this message?
+ * 
+ * FIXME remove internal if no use comes up
  */
 static void
 tunnel_send_multicast (struct MeshTunnel *t,
@@ -3364,17 +3327,6 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  not a data packet, no ttl\n");
   }
-  if (NULL != t->owner &&
-      GNUNET_YES != t->owner->shutting_down &&
-      GNUNET_NO == internal)
-  {
-    mdata->task = GNUNET_malloc (sizeof (GNUNET_SCHEDULER_TaskIdentifier));
-    (*(mdata->task)) =
-        GNUNET_SCHEDULER_add_delayed (unacknowledged_wait_time, 
&client_allow_send,
-                                      mdata);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "timeout task %u\n",
-                *(mdata->task));
-  }
 
   tree_iterate_children (t->tree, &tunnel_send_multicast_iterator, mdata);
   if (mdata->reference_counter == 0)
@@ -3382,12 +3334,6 @@
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "  no one to send data to\n");
     GNUNET_free (mdata->data);
-    if (NULL != mdata->task)
-    {
-      GNUNET_SCHEDULER_cancel(*(mdata->task));
-      GNUNET_free (mdata->task);
-      GNUNET_SERVER_receive_done (t->owner->handle, GNUNET_OK);
-    }
     GNUNET_free (mdata);
     t->fwd_queue_n--;
   }
@@ -7401,7 +7347,7 @@
     handle_mesh_data_multicast (client, &my_full_id, &copy->header, NULL, 0);
   }
 
-  /* receive done gets called when last copy is sent to a neighbor */
+  GNUNET_SERVER_receive_done (t->owner->handle, GNUNET_OK);
   return;
 }
 




reply via email to

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