gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22543 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r22543 - gnunet/src/gns
Date: Sun, 8 Jul 2012 19:26:10 +0200

Author: schanzen
Date: 2012-07-08 19:26:09 +0200 (Sun, 08 Jul 2012)
New Revision: 22543

Modified:
   gnunet/src/gns/gnunet-service-gns_resolver.c
Log:
-cleanup

Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c        2012-07-08 13:06:28 UTC 
(rev 22542)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2012-07-08 17:26:09 UTC 
(rev 22543)
@@ -178,10 +178,10 @@
  * a           = canonical
  *
  * @param name the name to test
- * @return 1 if canonical
+ * @return GNUNET_YES if canonical
  */
 static int
-is_canonical(char* name)
+is_canonical (char* name)
 {
   char* ndup;
   char* tok;
@@ -197,10 +197,10 @@
     if (*tok == '_')
       continue;
     GNUNET_free (ndup);
-    return 0;
+    return GNUNET_NO;
   }
   GNUNET_free (ndup);
-  return 1;
+  return GNUNET_YES;
 }
 
 
@@ -1883,7 +1883,8 @@
     rh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   }
   /* Start shortening */
-  if ((rh->priv_key != NULL) && is_canonical (rh->name))
+  if ((rh->priv_key != NULL) &&
+      (is_canonical (rh->name) == GNUNET_YES))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "GNS_PHASE_REC_DNS-%llu: Trying to shorten authority chain\n",
@@ -2002,7 +2003,8 @@
     rh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   }
   /* Start shortening */
-  if ((rh->priv_key != NULL) && is_canonical (rh->name))
+  if ((rh->priv_key != NULL) &&
+      (is_canonical (rh->name) == GNUNET_YES))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "GNS_PHASE_REC_VPN-%llu: Trying to shorten authority chain\n",
@@ -2088,7 +2090,8 @@
     rh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   }
   /* Start shortening */
-  if ((rh->priv_key != NULL) && is_canonical (rh->name))
+  if ((rh->priv_key != NULL) &&
+     (is_canonical (rh->name) == GNUNET_YES))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "GNS_PHASE_REC-%llu: Trying to shorten authority chain\n",
@@ -2522,7 +2525,8 @@
     if (strcmp(rh->name, "") == 0)
     {
       /* Start shortening */
-      if ((rh->priv_key != NULL) && is_canonical (rh->name))
+      if ((rh->priv_key != NULL) &&
+          (is_canonical (rh->name) == GNUNET_YES))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "GNS_PHASE_DELEGATE_DHT-%llu: Trying to shorten authority 
chain\n",
@@ -2850,7 +2854,7 @@
 {
   uint32_t len;
 
-  if (is_canonical (name))
+  if (is_canonical (name) == GNUNET_YES)
   {
     strcpy(dest, name);
     strcpy(name, "");
@@ -2939,7 +2943,7 @@
   /**
    * we still have some left
    **/
-  if (is_canonical(rh->name))
+  if (is_canonical (rh->name) == GNUNET_YES)
   {
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
              "GNS_PHASE_DELEGATE_DHT-%llu: Resolving canonical record %s in 
ns\n",
@@ -3218,7 +3222,7 @@
 
   if (check_dht == GNUNET_NO)
   {
-    if (is_canonical(rh->name))
+    if (is_canonical (rh->name) == GNUNET_YES)
     {
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                  "GNS_PHASE_DELEGATE_NS-%llu: Resolving canonical record %s\n",
@@ -3476,7 +3480,8 @@
   if (strcmp (rh->name, "") == 0)
   {
     /* Start shortening */
-    if ((rh->priv_key != NULL) && is_canonical (rh->name))
+    if ((rh->priv_key != NULL) &&
+        (is_canonical (rh->name) == GNUNET_YES))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "GNS_PHASE_DELEGATE_NS-%llu: Trying to shorten authority 
chain\n",
@@ -3559,7 +3564,8 @@
               name, record_type);
 
   
-  if (is_canonical((char*)name) && (strcmp(GNUNET_GNS_TLD, name) != 0))
+  if ((is_canonical ((char*)name) == GNUNET_YES) &&
+      (strcmp(GNUNET_GNS_TLD, name) != 0))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "%s is canonical and not gnunet -> cannot resolve!\n", name);
@@ -4292,7 +4298,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Starting shorten for %s!\n", name);
   
-  if (is_canonical ((char*)name))
+  if (is_canonical ((char*)name) == GNUNET_YES)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "%s is canonical. Returning verbatim\n", name);
@@ -4450,7 +4456,7 @@
 
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
              "Building response!\n");
-  if (is_canonical(rh->name))
+  if (is_canonical (rh->name) == GNUNET_YES)
   {
     /**
      * We successfully resolved the authority in the ns




reply via email to

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