* 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;
if (*tok == '_')
continue;
GNUNET_free (ndup);
- return 0;
+ return GNUNET_NO;
}
GNUNET_free (ndup);
- return 1;
+ return GNUNET_YES;
}
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",
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",
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",
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",
{
uint32_t len;
- if (is_canonical (name))
+ if (is_canonical (name) == GNUNET_YES)
{
strcpy(dest, name);
strcpy(name, "");
/**
* 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",
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",
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",
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);
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);
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