gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22469 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r22469 - gnunet/src/namestore
Date: Wed, 4 Jul 2012 10:37:33 +0200

Author: grothoff
Date: 2012-07-04 10:37:33 +0200 (Wed, 04 Jul 2012)
New Revision: 22469

Modified:
   gnunet/src/namestore/gnunet-namestore.c
Log:
-fixing #2478

Modified: gnunet/src/namestore/gnunet-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore.c     2012-07-03 22:34:59 UTC (rev 
22468)
+++ gnunet/src/namestore/gnunet-namestore.c     2012-07-04 08:37:33 UTC (rev 
22469)
@@ -64,6 +64,11 @@
 static struct GNUNET_NAMESTORE_QueueEntry *add_qe;
 
 /**
+ * Queue entry for the 'add-uri' operation.
+ */
+static struct GNUNET_NAMESTORE_QueueEntry *add_qe_uri;
+
+/**
  * Desired action is to list records.
  */
 static int list;
@@ -134,6 +139,26 @@
 do_shutdown (void *cls,
             const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+  if (NULL != list_it)
+  {
+    GNUNET_NAMESTORE_zone_iteration_stop (list_it);
+    list_it = NULL;
+  }
+  if (NULL != add_qe)
+  {
+    GNUNET_NAMESTORE_cancel (add_qe);
+    add_qe = NULL;
+  }
+  if (NULL != add_qe_uri)
+  {
+    GNUNET_NAMESTORE_cancel (add_qe_uri);
+    add_qe_uri = NULL;
+  }
+  if (NULL != del_qe)
+  {
+    GNUNET_NAMESTORE_cancel (del_qe);
+    del_qe = NULL;
+  }
   if (NULL != ns)
   {
     GNUNET_NAMESTORE_disconnect (ns);
@@ -156,7 +181,7 @@
  * Continuation called to notify client about result of the
  * operation.
  *
- * @param cls closure, unused
+ * @param cls closure, location of the QueueEntry pointer to NULL out
  * @param success GNUNET_SYSERR on failure (including timeout/queue 
drop/failure to validate)
  *                GNUNET_NO if content was already there
  *                GNUNET_YES (or other positive value) on success
@@ -167,7 +192,9 @@
                  int32_t success,
                  const char *emsg)
 {
-  add_qe = NULL;
+  struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
+
+  *qe = NULL;
   if (GNUNET_YES != success)
   {
     fprintf (stderr,
@@ -176,7 +203,9 @@
     if (GNUNET_NO != success)
       ret = 1;
   }
-  if ( (NULL == del_qe) &&
+  if ( (NULL == add_qe) &&
+       (NULL == add_qe_uri) &&
+       (NULL == del_qe) &&
        (NULL == list_it) )
     GNUNET_SCHEDULER_shutdown ();
 }
@@ -203,6 +232,7 @@
             _("Deleting record failed: %s\n"),
             emsg);
   if ( (NULL == add_qe) &&
+       (NULL == add_qe_uri) &&
        (NULL == list_it) )
     GNUNET_SCHEDULER_shutdown ();
 }
@@ -244,6 +274,7 @@
   {
     list_it = NULL;
     if ( (NULL == del_qe) &&
+        (NULL == add_qe_uri) &&
         (NULL == add_qe) )
       GNUNET_SCHEDULER_shutdown ();
     return;
@@ -475,7 +506,7 @@
                                             name,
                                             &rd,
                                             &add_continuation,
-                                            NULL);
+                                            &add_qe);
   }
   if (del)
   {
@@ -552,12 +583,12 @@
     if (1 != nonauthority)
       rd.flags |= GNUNET_NAMESTORE_RF_AUTHORITY;
 
-    add_qe = GNUNET_NAMESTORE_record_create (ns,
-                                            zone_pkey,
-                                            name,
-                                            &rd,
-                                            &add_continuation,
-                                            NULL);
+    add_qe_uri = GNUNET_NAMESTORE_record_create (ns,
+                                                zone_pkey,
+                                                name,
+                                                &rd,
+                                                &add_continuation,
+                                                &add_qe_uri);
   }
   GNUNET_free_non_null (data);
 }




reply via email to

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