[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29258 - in gnunet/src: identity include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29258 - in gnunet/src: identity include |
Date: |
Sun, 15 Sep 2013 12:07:03 +0200 |
Author: grothoff
Date: 2013-09-15 12:07:03 +0200 (Sun, 15 Sep 2013)
New Revision: 29258
Modified:
gnunet/src/identity/identity_api.c
gnunet/src/include/gnunet_identity_service.h
Log:
-properly clean up on disconnect, without memory leaks
Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c 2013-09-15 07:24:52 UTC (rev 29257)
+++ gnunet/src/identity/identity_api.c 2013-09-15 10:07:03 UTC (rev 29258)
@@ -879,9 +879,8 @@
* the operation.
*
* @param op operation to cancel
- * @return GNUNET_YES if the continuation was cancelled
*/
-int
+void
GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op)
{
struct GNUNET_IDENTITY_Handle *h = op->h;
@@ -894,7 +893,7 @@
h->op_tail,
op);
GNUNET_free (op);
- return GNUNET_YES;
+ return;
}
if (NULL != h->th)
{
@@ -906,12 +905,11 @@
op);
GNUNET_free (op);
transmit_next (h);
- return GNUNET_YES;
+ return;
}
/* request active with service, simply ensure continuations are not called */
op->cont = NULL;
op->cb = NULL;
- return GNUNET_NO;
}
@@ -955,8 +953,14 @@
GNUNET_assert (NULL != h);
while (NULL != (op = h->op_head))
- if (GNUNET_YES != GNUNET_IDENTITY_cancel (op))
- break;
+ {
+ if (NULL != h->th)
+ GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
+ GNUNET_CONTAINER_DLL_remove (h->op_head,
+ h->op_tail,
+ op);
+ GNUNET_free (op);
+ }
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-15 07:24:52 UTC
(rev 29257)
+++ gnunet/src/include/gnunet_identity_service.h 2013-09-15 10:07:03 UTC
(rev 29258)
@@ -267,9 +267,8 @@
* the operation.
*
* @param op operation to cancel
- * @return GNUNET_YES if the continuation was cancelled
*/
-int
+void
GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29258 - in gnunet/src: identity include,
gnunet <=