gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16376 - gnunet/src/mesh
Date: Thu, 4 Aug 2011 18:44:14 +0200

Author: bartpolot
Date: 2011-08-04 18:44:14 +0200 (Thu, 04 Aug 2011)
New Revision: 16376

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
Fixes


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-08-04 15:29:25 UTC (rev 
16375)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-08-04 16:44:14 UTC (rev 
16376)
@@ -937,6 +937,8 @@
     msg->header.type = htons(GNUNET_MESSAGE_TYPE_PATH_ACK);
     GNUNET_PEER_resolve(info->origin->oid, &msg->oid);
     msg->tid = htonl(info->origin->tid);
+    GNUNET_PEER_resolve(myid, &msg->peer_id);
+    /* TODO add signature */
 
     return sizeof(struct GNUNET_MESH_PathACK);
 }
@@ -1175,8 +1177,8 @@
         if (path->peers[i] == myid) own_pos = i;
     }
     if (own_pos == 0) { /* cannot be self, must be 'not found' */
-        GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
-                   "create path: self not found in path through self\n");
+        /* create path: self not found in path through self */
+        GNUNET_break_op(0);
         destroy_path(path);
         /* FIXME error. destroy tunnel? leave for timeout? */
         return 0;
@@ -1244,9 +1246,7 @@
     struct GNUNET_PeerIdentity                  id;
     struct MeshTunnel                           *t;
     struct MeshPeerInfo                         *pi;
-    struct MeshClient                           *c;
     size_t                                      size;
-    uint16_t                                    payload_type;
 
     size = ntohs(message->size);
     if (size < sizeof(struct GNUNET_MESH_DataMessageFromOrigin)
@@ -1306,11 +1306,9 @@
     struct GNUNET_MESH_DataMessageMulticast    *msg;
     struct GNUNET_PeerIdentity                  id;
     struct MeshTunnel                           *t;
-    struct MeshClient                           *c;
-    struct MeshDataDescriptor                   *dd;
+    struct MeshDataDescriptor                   *info;
     GNUNET_PEER_Id                              *neighbors;
     size_t                                      size;
-    uint16_t                                    type;
     uint16_t                                    i;
     uint16_t                                    j;
 
@@ -1346,24 +1344,24 @@
         return GNUNET_OK;
     }
     size -= sizeof(struct GNUNET_MESH_DataMessageMulticast);
-    dd = GNUNET_malloc(sizeof(struct MeshDataDescriptor) + size);
-    dd->origin = &t->id;
-    dd->copies = 0;
+    info = GNUNET_malloc(sizeof(struct MeshDataDescriptor) + size);
+    info->origin = &t->id;
+    info->copies = 0;
     for (i = 0; 0 != neighbors[i]; i++) {
         GNUNET_PEER_resolve(neighbors[i], &id);
-        dd->copies++;
-        dd->destination = neighbors[i];
-        dd->peer = GNUNET_CONTAINER_multihashmap_get(peers, &id.hashPubKey);
-        GNUNET_assert(dd->peer);
-        for (j = 0; dd->peer->core_transmit[j]; j++) {
+        info->copies++;
+        info->destination = neighbors[i];
+        info->peer = GNUNET_CONTAINER_multihashmap_get(peers, &id.hashPubKey);
+        GNUNET_assert(info->peer);
+        for (j = 0; info->peer->core_transmit[j]; j++) {
             if (j == 9) {
                 GNUNET_break(0);
                 return GNUNET_OK;
             }
         }
-        dd->handler_n = j;
-        dd->peer->infos[j] = dd;
-        dd->peer->core_transmit[j] = GNUNET_CORE_notify_transmit_ready(
+        info->handler_n = j;
+        info->peer->infos[j] = info;
+        info->peer->core_transmit[j] = GNUNET_CORE_notify_transmit_ready(
                                         core_handle,
                                         0,
                                         0,
@@ -1371,7 +1369,7 @@
                                         &id,
                                         ntohs(msg->header.size),
                                         &send_core_data_multicast,
-                                        dd);
+                                        info);
     }
     return GNUNET_OK;
 }
@@ -1519,6 +1517,7 @@
                                       sizeof(struct GNUNET_MESH_PathACK),
                                       &send_core_data_raw,
                                       msg);
+    return GNUNET_OK;
 }
 
 




reply via email to

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