gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16374 - gnunet/src/mesh
Date: Thu, 4 Aug 2011 16:57:05 +0200

Author: bartpolot
Date: 2011-08-04 16:57:05 +0200 (Thu, 04 Aug 2011)
New Revision: 16374

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
Fixed message retransmission


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-08-04 14:35:15 UTC (rev 
16373)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-08-04 14:57:05 UTC (rev 
16374)
@@ -967,6 +967,7 @@
         return 0;
     }
     memcpy(buf, msg, total_size);
+    GNUNET_free(cls);
     return total_size;
 }
 
@@ -1271,6 +1272,8 @@
         return GNUNET_OK;
     }
     GNUNET_PEER_resolve(get_first_hop(pi->path), &id);
+    msg = GNUNET_malloc(size);
+    memcpy(msg, message, size);
     GNUNET_CORE_notify_transmit_ready(core_handle,
         0,
         0,
@@ -1402,34 +1405,37 @@
                + sizeof(struct GNUNET_MessageHeader))
     {
         GNUNET_break_op (0);
-        return GNUNET_OK; // FIXME maybe SYSERR? peer misbehaving?
+        return GNUNET_OK;
     }
     msg = (struct GNUNET_MESH_DataMessageToOrigin *) message;
     t = retrieve_tunnel(&msg->oid, ntohl(msg->tid));
 
     if (NULL == t) {
-        /* TODO: are we so nice that we try to send it to OID anyway? We 
*could*
-         * know how to reach it, from the global peer hashmap
-         */
+        /* TODO notify that we dont know this tunnel (whom)? */
         return GNUNET_OK;
     }
 
     if (t->id.oid == myid) {
         if (NULL == t->client) {
             /* got data packet for ownerless tunnel */
-            GNUNET_break (0);
+            GNUNET_break_op (0);
             return GNUNET_OK;
         }
-        //         TODO retransmit to client owner
+        GNUNET_SERVER_notification_context_unicast(nc,
+                                                   t->client->handle,
+                                                   message,
+                                                   GNUNET_YES);
         return GNUNET_OK;
     }
     peer_info = get_peer_info(&msg->oid);
     if (NULL == peer_info) {
         /* unknown origin of tunnel */
-            GNUNET_break (0);
+        GNUNET_break (0);
         return GNUNET_OK;
     }
     GNUNET_PEER_resolve(get_first_hop(peer_info->path), &id);
+    msg = GNUNET_malloc(size);
+    memcpy(msg, message, size);
     GNUNET_CORE_notify_transmit_ready(core_handle,
                                       0,
                                       0,




reply via email to

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