gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r22544 - gnunet/src/gns
Date: Sun, 8 Jul 2012 19:32:45 +0200

Author: schanzen
Date: 2012-07-08 19:32:45 +0200 (Sun, 08 Jul 2012)
New Revision: 22544

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 17:26:09 UTC 
(rev 22543)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2012-07-08 17:32:45 UTC 
(rev 22544)
@@ -19,8 +19,6 @@
 */
 
 /**
- *
- *
  * @file gns/gnunet-service-gns_resolver.c
  * @brief GNUnet GNS resolver logic
  * @author Martin Schanzenbach
@@ -143,28 +141,34 @@
  */
 static unsigned long long rid = 0;
 
+/*
+ * Check if name is in srv format (_x._y.xxx)
+ *
+ * @param name
+ * @return GNUNET_YES if true
+ */
 static int
 is_srv (char* name)
 {
   char* ndup;
-  int ret = 1;
+  int ret = GNUNET_YES;
 
   if (*name != '_')
-    return 0;
+    return GNUNET_NO;
   if (NULL == strstr (name, "._"))
-    return 0;
+    return GNUNET_NO;
 
   ndup = GNUNET_strdup (name);
   strtok (ndup, ".");
 
   if (NULL == strtok (NULL, "."))
-    ret = 0;
+    ret = GNUNET_NO;
 
   if (NULL == strtok (NULL, "."))
-    ret = 0;
+    ret = GNUNET_NO;
 
   if (NULL != strtok (NULL, "."))
-    ret = 0;
+    ret = GNUNET_NO;
 
   GNUNET_free (ndup);
 
@@ -2814,7 +2818,7 @@
                                           &rh->private_local_zone))
       check_dht = GNUNET_NO;
     
-    if ((strcmp (rh->name, "+") != 0) && (is_srv (rh->name) != 0))
+    if ((strcmp (rh->name, "+") != 0) && (is_srv (rh->name) == GNUNET_YES))
         check_dht = GNUNET_NO;
 
 




reply via email to

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