* @param client reservation request ('struct GSC_ClientActiveRequest')
* @param message the actual message
*/
-static void
+static int
client_tokenizer_callback (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
}
else
{
-#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Delivering message of type %u to %s\n", ntohs (message->type),
GNUNET_i2s (&car->target));
-#endif
GSC_CLIENTS_deliver_message (&car->target, NULL, 0, message,
ntohs (message->size),
GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND);
GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND);
GSC_SESSIONS_transmit (car, message, tc->cork);
}
+ return GNUNET_OK;
}
if (client == NULL)
return;
-#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Client %p has disconnected from core service.\n", client);
-#endif
c = find_client (client);
if (c == NULL)
return; /* client never sent INIT */
{
struct ConnectNotifyMessage *cnm;
size_t size;
- char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
+ char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
struct GNUNET_ATS_Information *a;
struct DisconnectNotifyMessage dcm;
int old_match;
cnm->ats_count = htonl (atsi_count);
a = (struct GNUNET_ATS_Information *) &cnm[1];
memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
-#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n",
"NOTIFY_CONNECT");
-#endif
cnm->peer = *neighbour;
send_to_client (client, &cnm->header, GNUNET_NO);
}
size_t size =
msize + sizeof (struct NotifyTrafficMessage) +
atsi_count * sizeof (struct GNUNET_ATS_Information);
- char buf[size];
+ char buf[size] GNUNET_ALIGN;
struct NotifyTrafficMessage *ntm;
struct GNUNET_ATS_Information *a;
ntm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND);
ntm->ats_count = htonl (atsi_count);
ntm->peer = *sender;
- a = &ntm->ats;
+ a = (struct GNUNET_ATS_Information*) &ntm[1];
memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
- a[atsi_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
- a[atsi_count].value = htonl (0);
- memcpy (&a[atsi_count + 1], msg, msize);
+ memcpy (&a[atsi_count], msg, msize);
send_to_all_clients (sender, &ntm->header, GNUNET_YES, options,
ntohs (msg->type));
}