gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r28984 - gnunet/src/mesh
Date: Wed, 4 Sep 2013 14:30:22 +0200

Author: bartpolot
Date: 2013-09-04 14:30:22 +0200 (Wed, 04 Sep 2013)
New Revision: 28984

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
   gnunet/src/mesh/test_mesh_small.c
Log:
- fixes, debug

Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-09-04 11:26:29 UTC (rev 
28983)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-09-04 12:30:22 UTC (rev 
28984)
@@ -4826,7 +4826,7 @@
   if (queue->type != GNUNET_MESSAGE_TYPE_MESH_ACK &&
       queue->type != GNUNET_MESSAGE_TYPE_MESH_POLL)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Q_N- %p %u, \n", fc, fc->queue_n);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Q_N- %p %u\n", fc, fc->queue_n);
     fc->queue_n--;
     peer->queue_n--;
   }
@@ -5043,6 +5043,7 @@
   struct MeshFlowControl *fc;
   struct MeshPeer *peer;
   int priority;
+  int call_core;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "queue add %s %s (%u) on c %p, ch %p\n",
@@ -5081,17 +5082,22 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "last pid %u\n", fc->last_pid_sent);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "     ack %u\n", fc->last_ack_recv);
-  if (GMC_is_pid_bigger (fc->last_pid_sent + 1, fc->last_ack_recv) &&
-      GNUNET_SCHEDULER_NO_TASK == fc->poll_task &&
-      GNUNET_MESSAGE_TYPE_MESH_POLL != type)
+  if (GMC_is_pid_bigger (fc->last_pid_sent + 1, fc->last_ack_recv))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "no buffer space (%u > %u): starting poll\n",
-                fc->last_pid_sent + 1, fc->last_ack_recv);
-    fc->poll_task = GNUNET_SCHEDULER_add_delayed (fc->poll_time,
-                                                  &connection_poll,
-                                                  fc);
+    call_core = GNUNET_NO;
+    if (GNUNET_SCHEDULER_NO_TASK == fc->poll_task &&
+        GNUNET_MESSAGE_TYPE_MESH_POLL != type)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "no buffer space (%u > %u): starting poll\n",
+                  fc->last_pid_sent + 1, fc->last_ack_recv);
+      fc->poll_task = GNUNET_SCHEDULER_add_delayed (fc->poll_time,
+                                                    &connection_poll,
+                                                    fc);
+    }
   }
+  else
+    call_core = GNUNET_YES;
   queue = GNUNET_malloc (sizeof (struct MeshPeerQueue));
   queue->cls = cls;
   queue->type = type;
@@ -5107,12 +5113,12 @@
   else
   {
     GNUNET_CONTAINER_DLL_insert_tail (peer->queue_head, peer->queue_tail, 
queue);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Q_N+ %p %u, \n", fc, fc->queue_n);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Q_N+ %p %u\n", fc, fc->queue_n);
     fc->queue_n++;
     peer->queue_n++;
   }
 
-  if (NULL == peer->core_transmit)
+  if (NULL == peer->core_transmit && GNUNET_YES == call_core)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "calling core tmt rdy towards %s for %u bytes\n",

Modified: gnunet/src/mesh/test_mesh_small.c
===================================================================
--- gnunet/src/mesh/test_mesh_small.c   2013-09-04 11:26:29 UTC (rev 28983)
+++ gnunet/src/mesh/test_mesh_small.c   2013-09-04 12:30:22 UTC (rev 28984)
@@ -352,7 +352,7 @@
   uint32_t *data;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              " tmt_rdy called\n");
+              "tmt_rdy called, filling buffer\n");
   if (size < size_payload || NULL == buf)
   {
     GNUNET_break (0);
@@ -368,8 +368,13 @@
   msg->type = htons ((long) cls);
   data = (uint32_t *) &msg[1];
   *data = htonl (data_sent);
-  if (SPEED == test && GNUNET_YES == initialized)
+  if (GNUNET_NO == initialized)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "sending initializer\n");
+  }
+  else if (SPEED == test)
+  {
     data_sent++;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               " Sent packet %d\n", data_sent);
@@ -377,9 +382,10 @@
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               " Scheduling packet %d\n", data_sent + 1);
-      GNUNET_SCHEDULER_add_now(&data_task, NULL);
+      GNUNET_SCHEDULER_add_now (&data_task, NULL);
     }
   }
+  
   return size_payload;
 }
 




reply via email to

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