gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r32596 - gnunet/src/mesh
Date: Mon, 10 Mar 2014 10:52:41 +0100

Author: bartpolot
Date: 2014-03-10 10:52:41 +0100 (Mon, 10 Mar 2014)
New Revision: 32596

Modified:
   gnunet/src/mesh/gnunet-service-mesh_connection.c
   gnunet/src/mesh/gnunet-service-mesh_connection.h
Log:
- use MeshHash

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-03-10 09:52:40 UTC 
(rev 32595)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-03-10 09:52:41 UTC 
(rev 32596)
@@ -171,7 +171,7 @@
   /**
    * ID of the connection.
    */
-  struct GNUNET_HashCode id;
+  struct GNUNET_MeshHash id;
 
   /**
    * State of the connection.
@@ -413,9 +413,16 @@
  * @param cid Connection ID.
  */
 static struct MeshConnection *
-connection_get (const struct GNUNET_HashCode *cid)
+connection_get (const struct GNUNET_MeshHash *cid)
 {
-  return GNUNET_CONTAINER_multihashmap_get (connections, cid);
+  struct GNUNET_HashCode hash;
+  struct GNUNET_MeshHash *aux;
+
+  memcpy (&hash, cid, sizeof (cid));
+  aux = (struct GNUNET_MeshHash *) &hash;
+  memset (&aux[1], 0, sizeof (hash) - sizeof (*cid));
+
+  return GNUNET_CONTAINER_multihashmap_get (connections, &hash);
 }
 
 
@@ -2507,7 +2514,7 @@
  *
  * @return ID of the connection.
  */
-const struct GNUNET_HashCode *
+const struct GNUNET_MeshHash *
 GMC_get_id (const struct MeshConnection *c)
 {
   return &c->id;

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.h    2014-03-10 09:52:40 UTC 
(rev 32595)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.h    2014-03-10 09:52:41 UTC 
(rev 32596)
@@ -289,7 +289,7 @@
  *
  * @return ID of the connection.
  */
-const struct GNUNET_HashCode *
+const struct GNUNET_MeshHash *
 GMC_get_id (const struct MeshConnection *c);
 
 /**




reply via email to

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