gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15619 - gnunet/src/mesh
Date: Wed, 15 Jun 2011 09:15:45 +0200

Author: toelke
Date: 2011-06-15 09:15:45 +0200 (Wed, 15 Jun 2011)
New Revision: 15619

Modified:
   gnunet/src/mesh/mesh_api.c
Log:
build the mesh-hello correctly

i.e. nbo

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2011-06-15 07:15:44 UTC (rev 15618)
+++ gnunet/src/mesh/mesh_api.c  2011-06-15 07:15:45 UTC (rev 15619)
@@ -680,15 +680,23 @@
 
   for (t = stypes; *t != GNUNET_APPLICATION_TYPE_END; t++, num++);
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "I can handle %d app-types.\n", num);
+
   handle->hello_message_size = sizeof(uint16_t) + /* For the number of types */
     num * sizeof(GNUNET_MESH_ApplicationType); /* For the types */
 
   uint16_t *nums = GNUNET_malloc(handle->hello_message_size);
   GNUNET_MESH_ApplicationType *types = (GNUNET_MESH_ApplicationType*)(nums + 
1);
 
-  *nums = num;
-  memcpy(types, stypes, num*sizeof(GNUNET_MESH_ApplicationType));
+  *nums = htons(num);
 
+  int i;
+  for (i = 0; i < num; i++)
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "I can handle the app-type %d\n", 
stypes[i]);
+      types[i] = htons(stypes[i]);
+    }
+
   handle->hello_message = nums;
 }
 




reply via email to

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