-fix logging, revert to break instead of assert
[oweals/gnunet.git] / src / core / gnunet-service-core_clients.c
index 621f8604a210b9036c14185c6f9fd8b511306727..1076f343f2ee5e879428c4b80c4e7597f86ad76a 100644 (file)
@@ -506,7 +506,7 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
  * @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)
 {
@@ -535,11 +535,9 @@ client_tokenizer_callback (void *cls, void *client,
   }
   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);
@@ -548,6 +546,7 @@ client_tokenizer_callback (void *cls, void *client,
                                 GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND);  
     GSC_SESSIONS_transmit (car, message, tc->cork);
   }
+  return GNUNET_OK;
 }
 
 
@@ -589,10 +588,8 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
 
   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 */
@@ -694,7 +691,7 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
 {
   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;
@@ -736,10 +733,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
     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);
   }
@@ -813,7 +808,7 @@ GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender,
   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;