- unify payload, fixes
authorBart Polot <bart@net.in.tum.de>
Thu, 17 Oct 2013 14:41:13 +0000 (14:41 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 17 Oct 2013 14:41:13 +0000 (14:41 +0000)
src/mesh/gnunet-service-mesh_connection.c
src/mesh/gnunet-service-mesh_tunnel.c
src/mesh/mesh_common.c

index 3197255efb5008baacfcd27b5df9c14e335392f9..8a83adc51a44afed7a3eed60d4f7a43f75a739fe 100644 (file)
@@ -354,7 +354,7 @@ connection_change_state (struct MeshConnection* c,
 /**
  * Callback called when a queued message is sent.
  *
- * Calculates the average time 
+ * Calculates the average time and connection packet tracking.
  *
  * @param cls Closure.
  * @param c Connection this message was on.
@@ -373,8 +373,29 @@ message_sent (void *cls,
   struct MeshFlowControl *fc;
   double usecsperbyte;
 
+  fc = fwd ? &c->fwd_fc : &c->bck_fc;
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "!  Q_N- %p %u\n", fc, fc->queue_n);
+  fc->queue_n--;
+  c->pending_messages--;
+  if (GNUNET_YES == c->destroy && 0 == c->pending_messages)
+  {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "!  destroying connection!\n");
+    GMC_destroy (c);
+  }
+  /* Send ACK if needed, after accounting for sent ID in fc->queue_n */
+  switch (type)
+  {
+    case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
+      fc->last_pid_sent++;
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "!   accounting pid %u\n", fc->last_pid_sent);
+//       send_ack (c, ch, fwd);
+      break;
+    default:
+      break;
+  }
+
   if (NULL == c->perf)
-    return; /* Only endpoints are interested in this. */
+    return; /* Only endpoints are interested in timing. */
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "!  message sent!\n");
   p = c->perf;
@@ -397,26 +418,6 @@ message_sent (void *cls,
   }
   p->idx = (p->idx + 1) % AVG_MSGS;
 
-  fc = fwd ? &c->fwd_fc : &c->bck_fc;
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "!  Q_N- %p %u\n", fc, fc->queue_n);
-  fc->queue_n--;
-  c->pending_messages--;
-  if (GNUNET_YES == c->destroy && 0 == c->pending_messages)
-  {
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "!  destroying connection!\n");
-    GMC_destroy (c);
-  }
-  /* Send ACK if needed, after accounting for sent ID in fc->queue_n */
-  switch (type)
-  {
-    case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
-      fc->last_pid_sent++;
-      LOG (GNUNET_ERROR_TYPE_DEBUG, "!   accounting pid %u\n", fc->last_pid_sent);
-//       send_ack (c, ch, fwd);
-      break;
-    default:
-      break;
-  }
 //   if (NULL != c->t)
 //   {
 //     c->t->pending_messages--;
index e2cf7db17d26cf61f89c2b7abc92685097c91d30..6a6a439432ce1779bb0b76534e14b6509a65366e 100644 (file)
@@ -1199,7 +1199,7 @@ GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
   type = ntohs (message->type);
   switch (type)
   {
-    case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
+    case GNUNET_MESSAGE_TYPE_MESH_DATA:
     case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE:
     case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY:
     case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_ACK:
index 90f2e5299974158873e64b1594aff173d73324dd..0298a4e3a5d1ed225486bf7a6bb577b6e59374e1 100644 (file)
@@ -83,20 +83,20 @@ GNUNET_MESH_DEBUG_M2S (uint16_t m)
       /**
        * Transport data in the mesh (origin->end) unicast
        */
-    case 260: return "GNUNET_MESSAGE_TYPE_MESH_UNICAST";
+    case 260: return "GNUNET_MESSAGE_TYPE_MESH_DATA";
 
       /**
-       * Transport data back in the mesh (end->origin)
+       * Transport data back in the mesh (end->origin) FIXME
        */
     case 262: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN";
 
       /**
-       * Send origin an ACK that UNICAST arrived
+       * Send origin an ACK that UNICAST arrived FIXME
        */
     case 263: return "GNUNET_MESSAGE_TYPE_MESH_UNICAST_ACK";
 
       /**
-       * Send origin an ACK that TO_ORIGIN arrived
+       * Send origin an ACK that TO_ORIGIN arrived FIXME
        */
     case 264: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIG_ACK";