gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29257 - in gnunet/src: identity include


From: gnunet
Subject: [GNUnet-SVN] r29257 - in gnunet/src: identity include
Date: Sun, 15 Sep 2013 09:24:52 +0200

Author: LRN
Date: 2013-09-15 09:24:52 +0200 (Sun, 15 Sep 2013)
New Revision: 29257

Modified:
   gnunet/src/identity/identity_api.c
   gnunet/src/include/gnunet_identity_service.h
Log:
Fix the endless loop fix - don't miss pre-last item

Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c  2013-09-14 23:48:35 UTC (rev 29256)
+++ gnunet/src/identity/identity_api.c  2013-09-15 07:24:52 UTC (rev 29257)
@@ -879,8 +879,9 @@
  * the operation.
  *
  * @param op operation to cancel
+ * @return GNUNET_YES if the continuation was cancelled
  */
-void
+int
 GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op)
 {
   struct GNUNET_IDENTITY_Handle *h = op->h;
@@ -893,7 +894,7 @@
                                 h->op_tail,
                                 op);
     GNUNET_free (op);
-    return;
+    return GNUNET_YES;
   }
   if (NULL != h->th)
   {
@@ -905,11 +906,12 @@
                                 op);
     GNUNET_free (op);
     transmit_next (h);
-    return;
+    return GNUNET_YES;
   }
   /* request active with service, simply ensure continuations are not called */
   op->cont = NULL;
   op->cb = NULL;
+  return GNUNET_NO;
 }
 
 
@@ -952,8 +954,9 @@
   struct GNUNET_IDENTITY_Operation *op;
 
   GNUNET_assert (NULL != h);
-  while ((NULL != (op = h->op_head) && (NULL != op->next)))
-    GNUNET_IDENTITY_cancel (op);
+  while (NULL != (op = h->op_head))
+    if (GNUNET_YES != GNUNET_IDENTITY_cancel (op))
+      break;
   if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel (h->reconnect_task);

Modified: gnunet/src/include/gnunet_identity_service.h
===================================================================
--- gnunet/src/include/gnunet_identity_service.h        2013-09-14 23:48:35 UTC 
(rev 29256)
+++ gnunet/src/include/gnunet_identity_service.h        2013-09-15 07:24:52 UTC 
(rev 29257)
@@ -267,8 +267,9 @@
  * the operation.
  *
  * @param op operation to cancel
+ * @return GNUNET_YES if the continuation was cancelled
  */
-void
+int
 GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op);
 
 




reply via email to

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