gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r21783 - gnunet/src/mesh
Date: Wed, 6 Jun 2012 15:32:31 +0200

Author: bartpolot
Date: 2012-06-06 15:32:31 +0200 (Wed, 06 Jun 2012)
New Revision: 21783

Modified:
   gnunet/src/mesh/gnunet-service-mesh_new.c
Log:
- fix dumb > vs < error, add debug messages

Modified: gnunet/src/mesh/gnunet-service-mesh_new.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_new.c   2012-06-06 13:05:24 UTC (rev 
21782)
+++ gnunet/src/mesh/gnunet-service-mesh_new.c   2012-06-06 13:32:31 UTC (rev 
21783)
@@ -1307,10 +1307,10 @@
 
 
 /**
- * Sends an already built message to a peer, properly registrating
+ * Sends an already built unicast message to a peer, properly registrating
  * all used resources.
  *
- * @param message Message to send. Fucntion makes a copy of it.
+ * @param message Message to send. Function makes a copy of it.
  * @param peer Short ID of the neighbor whom to send the message.
  *
  * FIXME tunnel?
@@ -2677,7 +2677,6 @@
     switch (queue->type)
     {
     case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
-    case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
     case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   type payload\n");
         dd = queue->cls;
@@ -2718,15 +2717,19 @@
     core_transmit = NULL;
     queue = queue_head;
 
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* Queue send\n");
+
+
     /* If queue is empty, send should have been cancelled */
     if (NULL == queue)
     {
         GNUNET_break(0);
         return 0;
     }
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   not empty\n");
 
     /* Check if buffer size is enough for the message */
-    if (queue->size < size)
+    if (queue->size > size)
     {
         struct GNUNET_PeerIdentity id;
 
@@ -2742,28 +2745,30 @@
                                               peer);
         return 0;
     }
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   size ok\n");
 
     /* Fill buf */
     switch (queue->type)
     {
         case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
+            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   unicast\n");
             data_size = send_core_data_raw (queue->cls, size, buf);
             break;
         case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
+            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   multicast\n");
             data_size = send_core_data_multicast(queue->cls, size, buf);
             break;
-        case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
-            data_size = 0;
-            break;
         case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE:
+            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   path create\n");
             data_size = send_core_path_create(queue->cls, size, buf);
             break;
         case GNUNET_MESSAGE_TYPE_MESH_PATH_ACK:
+            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   path ack\n");
             data_size = send_core_path_ack(queue->cls, size, buf);
             break;
         default:
             GNUNET_break (0);
-            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   type unknown!\n");
+            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   type unknown\n");
             data_size = 0;
     }
 
@@ -2775,6 +2780,7 @@
     {
         struct GNUNET_PeerIdentity id;
 
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   more data!\n");
         GNUNET_PEER_resolve (peer->id, &id);
         core_transmit =
             GNUNET_CORE_notify_transmit_ready(core_handle,
@@ -2786,6 +2792,7 @@
                                               &queue_send,
                                               peer);
     }
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*********   return %d\n", data_size);
     return data_size;
 }
 




reply via email to

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