-bringing copyright tags up to FSF standard
[oweals/gnunet.git] / src / namestore / namestore_api.c
index 034352bd98e93508a951230339fcd7a70393e69f..2642cd6f59622c7aee1baf8e9e31ce0580a9c36d 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -214,7 +214,7 @@ struct GNUNET_NAMESTORE_Handle
   /**
    * Reconnect task
    */
-  GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+  struct GNUNET_SCHEDULER_Task * reconnect_task;
 
   /**
    * Delay introduced before we reconnect.
@@ -266,8 +266,9 @@ handle_record_store_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
   const char *emsg;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Received `%s'\n",
-       "RECORD_STORE_RESPONSE");
+       "Received `%s' with result %i\n",
+       "RECORD_STORE_RESPONSE",
+       ntohl (msg->op_result));
   /* TODO: add actual error message from namestore to response... */
   res = ntohl (msg->op_result);
   if (GNUNET_SYSERR == res)
@@ -458,7 +459,9 @@ handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
   case GNUNET_NO:
     LOG (GNUNET_ERROR_TYPE_DEBUG,
         "Namestore has no result for zone to name mapping \n");
-    break;
+    if (NULL != qe->proc)
+      qe->proc (qe->proc_cls, &msg->zone, NULL, 0, NULL);
+    return GNUNET_NO;
   case GNUNET_YES:
     LOG (GNUNET_ERROR_TYPE_DEBUG,
         "Namestore has result for zone to name mapping \n");
@@ -871,7 +874,7 @@ reconnect_task (void *cls,
 {
   struct GNUNET_NAMESTORE_Handle *h = cls;
 
-  h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+  h->reconnect_task = NULL;
   reconnect (h);
 }
 
@@ -976,10 +979,10 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h)
     GNUNET_CLIENT_disconnect (h->client);
     h->client = NULL;
   }
-  if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+  if (NULL != h->reconnect_task)
   {
     GNUNET_SCHEDULER_cancel (h->reconnect_task);
-    h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+    h->reconnect_task = NULL;
   }
   GNUNET_free (h);
 }
@@ -996,7 +999,7 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h)
  * @param rd_count number of records in the 'rd' array
  * @param rd array of records with data to store
  * @param cont continuation to call when done
- * @param cont_cls closure for 'cont'
+ * @param cont_cls closure for @a cont
  * @return handle to abort the request
  */
 struct GNUNET_NAMESTORE_QueueEntry *