fix warning
[oweals/gnunet.git] / src / ats / ats_api_performance.c
index aa5fff2036fe2803ea4a1287cfecec140c9d5d77..838acca2f1764260609a8ae78e5518a2b89a3749 100644 (file)
@@ -308,9 +308,6 @@ transmit_message_to_ats (void *cls, size_t size, void *buf)
     ret += p->size;
     size -= p->size;
     GNUNET_CONTAINER_DLL_remove (ph->pending_head, ph->pending_tail, p);
-    GNUNET_CLIENT_receive (ph->client, &process_ats_message, ph,
-                            GNUNET_TIME_UNIT_FOREVER_REL);
-
     GNUNET_free (p);
   }
   do_transmit (ph);
@@ -622,6 +619,8 @@ reconnect (struct GNUNET_ATS_PerformanceHandle *ph)
   GNUNET_assert (NULL == ph->client);
   ph->client = GNUNET_CLIENT_connect ("ats", ph->cfg);
   GNUNET_assert (NULL != ph->client);
+  GNUNET_CLIENT_receive (ph->client, &process_ats_message, ph,
+                          GNUNET_TIME_UNIT_FOREVER_REL);
   if ((NULL == (p = ph->pending_head)) || (GNUNET_YES != p->is_init))
   {
     p = GNUNET_malloc (sizeof (struct PendingMessage) +