-do not send previous round messages if we are just going online and did not setup...
[oweals/gnunet.git] / src / nse / nse_api.c
index 8ff0256b9107e880b4d2ab21bad2bcbf3b69ff9a..e32c08e4b773f12394244432deb20e8a99507593 100644 (file)
@@ -35,6 +35,7 @@
 #include "gnunet_nse_service.h"
 #include "nse.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "nse-api",__VA_ARGS__)
 
 /**
  * Handle for the service.
@@ -85,8 +86,8 @@ struct GNUNET_NSE_Handle
  * @param cls the handle to the transport service
  * @param tc scheduler context
  */
-static void reconnect (void *cls,
-                       const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 
 
 /**
@@ -104,7 +105,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
 
   if (msg == NULL)
   {
-    /* Error, timeout, death */
+    /* Error, timeout, death */    
     GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
     h->client = NULL;
     h->reconnect_task =
@@ -148,9 +149,9 @@ reschedule_connect (struct GNUNET_NSE_Handle *h)
   }
 
 #if DEBUG_NSE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Scheduling task to reconnect to nse service in %llu ms.\n",
-              h->reconnect_delay.rel_value);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Scheduling task to reconnect to nse service in %llu ms.\n",
+       h->reconnect_delay.rel_value);
 #endif
   h->reconnect_task =
       GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h);
@@ -186,14 +187,14 @@ send_start (void *cls, size_t size, void *buf)
   {
     /* Connect error... */
 #if DEBUG_NSE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Shutdown while trying to transmit `%s' request.\n", "START");
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Shutdown while trying to transmit `%s' request.\n", "START");
 #endif
     reschedule_connect (h);
     return 0;
   }
 #if DEBUG_NSE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START");
 #endif
   GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
 
@@ -224,8 +225,8 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     return;
   }
 #if DEBUG_NSE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Connecting to network size estimation service.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Connecting to network size estimation service.\n");
 #endif
   GNUNET_assert (h->client == NULL);
   h->client = GNUNET_CLIENT_connect ("nse", h->cfg);