gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17464 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r17464 - gnunet/src/ats
Date: Thu, 13 Oct 2011 22:07:05 +0200

Author: grothoff
Date: 2011-10-13 22:07:05 +0200 (Thu, 13 Oct 2011)
New Revision: 17464

Modified:
   gnunet/src/ats/ats_api_scheduling.c
Log:
call receive only after sending INIT

Modified: gnunet/src/ats/ats_api_scheduling.c
===================================================================
--- gnunet/src/ats/ats_api_scheduling.c 2011-10-13 20:04:52 UTC (rev 17463)
+++ gnunet/src/ats/ats_api_scheduling.c 2011-10-13 20:07:05 UTC (rev 17464)
@@ -157,6 +157,18 @@
 
 
 /**
+ * Type of a function to call when we receive a message
+ * from the service.
+ *
+ * @param cls the 'struct GNUNET_ATS_SchedulingHandle'
+ * @param msg message received, NULL on timeout or fatal error
+ */
+static void
+process_ats_message (void *cls,
+                    const struct GNUNET_MessageHeader *msg);
+
+
+/**
  * We can now transmit a message to ATS. Do it.
  *
  * @param cls the 'struct GNUNET_ATS_SchedulingHandle'
@@ -186,6 +198,10 @@
     GNUNET_CONTAINER_DLL_remove (sh->pending_head,
                                 sh->pending_tail,
                                 p);
+    if (GNUNET_YES == p->is_init)
+      GNUNET_CLIENT_receive (sh->client,
+                            &process_ats_message, sh,
+                            GNUNET_TIME_UNIT_FOREVER_REL);
     GNUNET_free (p);
   }
   do_transmit (sh);
@@ -376,9 +392,6 @@
   GNUNET_assert (NULL == sh->client);
   sh->client = GNUNET_CLIENT_connect ("ats", sh->cfg);
   GNUNET_assert (NULL != sh->client);
-  GNUNET_CLIENT_receive (sh->client,
-                        &process_ats_message, sh,
-                        GNUNET_TIME_UNIT_FOREVER_REL);
   if ( (NULL == (p = sh->pending_head)) ||
        (GNUNET_YES != p->is_init) )
   {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]