gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21802 - gnunet/src/peerinfo


From: gnunet
Subject: [GNUnet-SVN] r21802 - gnunet/src/peerinfo
Date: Fri, 8 Jun 2012 15:02:55 +0200

Author: grothoff
Date: 2012-06-08 15:02:55 +0200 (Fri, 08 Jun 2012)
New Revision: 21802

Modified:
   gnunet/src/peerinfo/peerinfo_api.c
Log:
-fixing #2406

Modified: gnunet/src/peerinfo/peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/peerinfo_api.c  2012-06-08 12:56:05 UTC (rev 21801)
+++ gnunet/src/peerinfo/peerinfo_api.c  2012-06-08 13:02:55 UTC (rev 21802)
@@ -186,7 +186,7 @@
    * Set to GNUNET_YES if we are currently receiving replies from the
    * service.
    */
-  int in_receive;
+  int request_transmitted;
 
 };
 
@@ -227,8 +227,8 @@
 
   while (NULL != (ic = h->ic_head))
   {
-    GNUNET_break (GNUNET_YES == ic->in_receive);
-    ic->in_receive = GNUNET_NO;
+    GNUNET_break (GNUNET_YES == ic->request_transmitted);
+    ic->request_transmitted = GNUNET_NO;
     GNUNET_PEERINFO_iterate_cancel (ic);
   }
   while (NULL != (ac = h->ac_head))
@@ -492,7 +492,7 @@
 
   GNUNET_assert (NULL != ic);
   h->in_receive = GNUNET_NO;
-  ic->in_receive = GNUNET_NO;
+  ic->request_transmitted = GNUNET_NO;
   cb = ic->callback;
   cb_cls = ic->callback_cls;
   if (NULL == msg)
@@ -513,6 +513,12 @@
          "Received end of list of peers from `%s' service\n", "PEERINFO");
     GNUNET_PEERINFO_iterate_cancel (ic);   
     trigger_transmit (h);
+    if (GNUNET_NO == h->in_receive)
+    {
+      h->in_receive = GNUNET_YES;
+      GNUNET_CLIENT_receive (h->client, &peerinfo_handler, h,
+                            GNUNET_TIME_absolute_get_remaining (ic->timeout));
+    }
     if (NULL != cb)
       cb (cb_cls, NULL, NULL, NULL);
     return;
@@ -594,8 +600,8 @@
        "Received %u bytes of `%s' information about peer `%s' from `%s' 
service\n",
        (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
        GNUNET_i2s (&im->peer), "PEERINFO");
+  ic->request_transmitted = GNUNET_YES;
   h->in_receive = GNUNET_YES;
-  ic->in_receive = GNUNET_YES;
   GNUNET_CLIENT_receive (h->client, &peerinfo_handler, h,
                          GNUNET_TIME_absolute_get_remaining (ic->timeout));
   if (NULL != cb)
@@ -631,7 +637,7 @@
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
        "PEERINFO");
-  ic->in_receive = GNUNET_YES;
+  ic->request_transmitted = GNUNET_YES;
   if (GNUNET_NO == h->in_receive)
   {
     h->in_receive = GNUNET_YES;
@@ -755,7 +761,7 @@
     ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   }
   ic->callback = NULL;
-  if (GNUNET_YES == ic->in_receive)
+  if (GNUNET_YES == ic->request_transmitted)
     return;                     /* need to finish processing */
   GNUNET_CONTAINER_DLL_remove (h->ic_head,
                               h->ic_tail,




reply via email to

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