gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r28630 - gnunet/src/mesh
Date: Wed, 14 Aug 2013 19:49:59 +0200

Author: bartpolot
Date: 2013-08-14 19:49:58 +0200 (Wed, 14 Aug 2013)
New Revision: 28630

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- fix loopback channel creation (service already knows channel)


Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-14 17:40:08 UTC (rev 
28629)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-14 17:49:58 UTC (rev 
28630)
@@ -3764,6 +3764,7 @@
   t = GNUNET_new (struct MeshTunnel2);
   t->id = *tid;
   t->next_chid = 0;
+  t->next_local_chid = GNUNET_MESH_LOCAL_CHANNEL_ID_SERV;
   if (GNUNET_OK !=
       GNUNET_CONTAINER_multihashmap_put (tunnels, tid, t,
                                          
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
@@ -5153,7 +5154,9 @@
   MESH_ChannelNumber chid;
   struct MeshChannel *ch;
   struct MeshClient *c;
+  uint32_t port;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Channel Create\n");
   /* Check message size */
   if (ntohs (msg->header.size) != sizeof (struct GNUNET_MESH_ChannelCreate))
   {
@@ -5167,20 +5170,26 @@
   if (NULL != ch)
   {
     /* Probably a retransmission, safe to ignore */
-    return GNUNET_OK;
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   already exists...\n");
   }
+  else
+  {
+    /* Create channel */
+    ch = channel_new (t, NULL, 0);
+    channel_set_options (ch, ntohl (msg->opt));
+  }
 
   /* Find a destination client */
-  c = GNUNET_CONTAINER_multihashmap32_get (ports, msg->port);
+  port = ntohl (msg->port);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   port %u\n", port);
+  c = GNUNET_CONTAINER_multihashmap32_get (ports, port);
   if (NULL == c)
   {
     /* TODO send reject */
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  no client has port registered\n");
     return GNUNET_OK;
   }
 
-  /* Create channel */
-  ch = channel_new (t, NULL, 0);
-  channel_set_options (ch, ntohl (msg->opt));
   channel_add_client (ch, c);
   if (GNUNET_YES == ch->reliable)
   {




reply via email to

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