support multi-message encapsulations
authorChristian Grothoff <christian@grothoff.org>
Mon, 1 Mar 2010 17:29:45 +0000 (17:29 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 1 Mar 2010 17:29:45 +0000 (17:29 +0000)
src/core/gnunet-service-core.c

index 81a168b7f13d11752fd628eef3c7c32782104c63..b65d675133d82f13c658b7050749481a7b52b94a 100644 (file)
@@ -2005,9 +2005,6 @@ create_neighbour (const struct GNUNET_PeerIdentity *pid)
 }
 
 
-
-
-
 /**
  * Handle CORE_SEND request.
  *
@@ -2021,7 +2018,6 @@ handle_client_send (void *cls,
                     const struct GNUNET_MessageHeader *message)
 {
   const struct SendMessage *sm;
-  const struct GNUNET_MessageHeader *mh;
   struct Neighbour *n;
   struct MessageEntry *prev;
   struct MessageEntry *pos;
@@ -2043,14 +2039,6 @@ handle_client_send (void *cls,
     }
   sm = (const struct SendMessage *) message;
   msize -= sizeof (struct SendMessage);
-  mh = (const struct GNUNET_MessageHeader *) &sm[1];
-  if (msize != ntohs (mh->size))
-    {
-      GNUNET_break (0);
-      if (client != NULL)
-        GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-      return;
-    }
   n = find_neighbour (&sm->peer);
   if (n == NULL)
     n = create_neighbour (&sm->peer);
@@ -2120,7 +2108,7 @@ handle_client_send (void *cls,
   e->deadline = GNUNET_TIME_absolute_ntoh (sm->deadline);
   e->priority = ntohl (sm->priority);
   e->size = msize;
-  memcpy (&e[1], mh, msize);
+  memcpy (&e[1], &sm[1], msize);
 
   /* insert, keep list sorted by deadline */
   prev = NULL;