[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: make GNS cancel APIs return
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: make GNS cancel APIs return closure, can be convenient |
Date: |
Thu, 21 Jun 2018 08:25:36 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 336159b59 make GNS cancel APIs return closure, can be convenient
336159b59 is described below
commit 336159b59453619dfc9cad5e860462c594785dd9
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jun 21 08:25:32 2018 +0200
make GNS cancel APIs return closure, can be convenient
---
src/gns/gns_api.c | 6 +++++-
src/gns/gns_tld_api.c | 6 +++++-
src/include/gnunet_gns_service.h | 6 ++++--
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index 8264bf715..0ec9209da 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -300,17 +300,21 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle)
* Cancel pending lookup request
*
* @param lr the lookup request to cancel
+ * @return closure from the lookup result processor
*/
-void
+void *
GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr)
{
struct GNUNET_GNS_Handle *handle = lr->gns_handle;
+ void *ret;
GNUNET_CONTAINER_DLL_remove (handle->lookup_head,
handle->lookup_tail,
lr);
GNUNET_MQ_discard (lr->env);
+ ret = lr->proc_cls;
GNUNET_free (lr);
+ return ret;
}
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c
index b053aa0c1..825b51d06 100644
--- a/src/gns/gns_tld_api.c
+++ b/src/gns/gns_tld_api.c
@@ -317,10 +317,13 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle
*handle,
* Cancel pending lookup request
*
* @param ltr the lookup request to cancel
+ * @return closure from the lookup result processor
*/
-void
+void *
GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr)
{
+ void *ret = ltr->lookup_proc_cls;
+
if (NULL != ltr->id_op)
{
GNUNET_IDENTITY_ego_lookup_cancel (ltr->id_op);
@@ -333,6 +336,7 @@ GNUNET_GNS_lookup_with_tld_cancel (struct
GNUNET_GNS_LookupWithTldRequest *ltr)
}
GNUNET_free (ltr->name);
GNUNET_free (ltr);
+ return ret;
}
/* end of gns_tld_api.c */
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 13f920937..b6fac6111 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -150,8 +150,9 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
* Cancel pending lookup request
*
* @param lr the lookup request to cancel
+ * @return closure from the lookup result processor
*/
-void
+void *
GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr);
@@ -198,8 +199,9 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle
*handle,
* Cancel pending lookup request
*
* @param ltr the lookup request to cancel
+ * @return closure from the lookup result processor
*/
-void
+void *
GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest
*ltr);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: make GNS cancel APIs return closure, can be convenient,
gnunet <=