refactor DHT for new service API
[oweals/gnunet.git] / src / core / core_api.c
index caf614afc186f88553ad7fa812d13a408656cbe6..67f17352ddfd9170f8117b04332fabd6b0d4c28a 100644 (file)
@@ -541,11 +541,12 @@ handle_notify_inbound (void *cls,
   uint16_t et;
 
   GNUNET_break (GNUNET_NO == h->currently_down);
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Received inbound message from `%s'.\n",
-       GNUNET_i2s (&ntm->peer));
   em = (const struct GNUNET_MessageHeader *) &ntm[1];
   et = ntohs (em->type);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Received inbound message of type %d from `%s'.\n",
+       (int) et,
+       GNUNET_i2s (&ntm->peer));
   for (unsigned int hpos = 0; NULL != h->handlers[hpos].callback; hpos++)
   {
     const struct GNUNET_CORE_MessageHandler *mh;
@@ -767,31 +768,31 @@ handle_send_ready (void *cls,
 static void
 reconnect (struct GNUNET_CORE_Handle *h)
 {
-  GNUNET_MQ_hd_fixed_size (init_reply,
-                           GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY,
-                           struct InitReplyMessage);
-  GNUNET_MQ_hd_fixed_size (connect_notify,
-                           GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT,
-                           struct ConnectNotifyMessage);
-  GNUNET_MQ_hd_fixed_size (disconnect_notify,
-                           GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT,
-                           struct DisconnectNotifyMessage);
-  GNUNET_MQ_hd_var_size (notify_inbound,
-                         GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND,
-                         struct NotifyTrafficMessage);
-  GNUNET_MQ_hd_var_size (notify_outbound,
-                         GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND,
-                         struct NotifyTrafficMessage);
-  GNUNET_MQ_hd_fixed_size (send_ready,
-                           GNUNET_MESSAGE_TYPE_CORE_SEND_READY,
-                           struct SendMessageReady);
- struct GNUNET_MQ_MessageHandler handlers[] = {
-    make_init_reply_handler (h),
-    make_connect_notify_handler (h),
-    make_disconnect_notify_handler (h),
-    make_notify_inbound_handler (h),
-    make_notify_outbound_handler (h),
-    make_send_ready_handler (h),
+  struct GNUNET_MQ_MessageHandler handlers[] = {
+    GNUNET_MQ_hd_fixed_size (init_reply,
+                             GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY,
+                             struct InitReplyMessage,
+                             h),
+    GNUNET_MQ_hd_fixed_size (connect_notify,
+                             GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT,
+                             struct ConnectNotifyMessage,
+                             h),
+    GNUNET_MQ_hd_fixed_size (disconnect_notify,
+                             GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT,
+                             struct DisconnectNotifyMessage,
+                             h),
+    GNUNET_MQ_hd_var_size (notify_inbound,
+                           GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND,
+                           struct NotifyTrafficMessage,
+                           h),
+    GNUNET_MQ_hd_var_size (notify_outbound,
+                           GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND,
+                           struct NotifyTrafficMessage,
+                           h),
+    GNUNET_MQ_hd_fixed_size (send_ready,
+                             GNUNET_MESSAGE_TYPE_CORE_SEND_READY,
+                             struct SendMessageReady,
+                             h),
     GNUNET_MQ_handler_end ()
   };
   struct InitMessage *init;