-improve UDP logging
[oweals/gnunet.git] / src / ats / gnunet-service-ats.c
index 9c809f913006f291ffa0906f449ad7917dbeed6f..716bd633251bb0afff64e533e42908a933397d66 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -65,34 +65,39 @@ handle_ats_start (void *cls,
       (const struct ClientStartMessage *) message;
   enum StartFlag flag;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Received `%s' message\n",
-              "ATS_START");
   flag = ntohl (msg->start_flag);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received ATS_START (%d) message\n",
+              (int) flag);
   switch (flag)
   {
   case START_FLAG_SCHEDULING:
     if (GNUNET_OK != GAS_scheduling_add_client (client))
     {
-      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+      GNUNET_SERVER_receive_done (client,
+                                  GNUNET_SYSERR);
       return;
     }
     break;
   case START_FLAG_PERFORMANCE_WITH_PIC:
-    GAS_performance_add_client (client, flag);
+    GAS_performance_add_client (client,
+                                flag);
     break;
   case START_FLAG_PERFORMANCE_NO_PIC:
-    GAS_performance_add_client (client, flag);
+    GAS_performance_add_client (client,
+                                flag);
     break;
   case START_FLAG_CONNECTION_SUGGESTION:
     /* This client won't receive messages from us, no need to 'add' */
     break;
   default:
     GNUNET_break (0);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_SYSERR);
     return;
   }
-  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+  GNUNET_SERVER_receive_done (client,
+                              GNUNET_OK);
 }
 
 
@@ -111,7 +116,7 @@ client_disconnect_handler (void *cls,
     return;
   GAS_scheduling_remove_client (client);
   GAS_connectivity_remove_client (client);
-  GAS_normalization_preference_client_disconnect (client);
+  GAS_preference_client_disconnect (client);
 }
 
 
@@ -125,11 +130,11 @@ static void
 cleanup_task (void *cls,
               const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+  GAS_connectivity_done ();
   GAS_addresses_done ();
-  GAS_plugins_done ();
+  GAS_plugin_done ();
   GAS_normalization_stop ();
   GAS_scheduling_done ();
-  GAS_connectivity_done ();
   GAS_performance_done ();
   GAS_preference_done ();
   GAS_reservations_done ();
@@ -181,7 +186,7 @@ run (void *cls,
      sizeof (struct ReservationRequestMessage)},
     {&GAS_handle_preference_change, NULL,
      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
-    {&GAS_handle_preference_feedback, NULL,
+    {&GAS_handle_feedback, NULL,
      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK, 0},
     {NULL, NULL, 0, 0}
   };
@@ -193,7 +198,7 @@ run (void *cls,
   GAS_normalization_start ();
   GAS_addresses_init (server);
   if (GNUNET_OK !=
-      GAS_plugins_init (cfg))
+      GAS_plugin_init (cfg))
   {
     GNUNET_break (0);
     GAS_addresses_done ();