summaryrefslogtreecommitdiff
path: root/daemon/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/misc.c')
-rw-r--r--daemon/misc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/daemon/misc.c b/daemon/misc.c
index 15344ce..cda6dc2 100644
--- a/daemon/misc.c
+++ b/daemon/misc.c
@@ -195,7 +195,7 @@ int ha_confbool(const char* name, const char* conf, int* value)
}
ha_messagex(LOG_ERR, "invalid configuration value '%s': must be 'on' or 'off'.", name);
- return HA_ERROR;
+ return HA_FAILED;
}
int ha_confint(const char* name, const char* conf, int min, int max, int* value)
@@ -211,7 +211,7 @@ int ha_confint(const char* name, const char* conf, int min, int max, int* value)
if(*p || errno == ERANGE || (*value < min) || (*value > max))
{
ha_messagex(LOG_ERR, "invalid configuration value '%s': must be a number between %d and %d", name, min, max);
- return HA_ERROR;
+ return HA_FAILED;
}
return HA_OK;
@@ -289,11 +289,13 @@ int ha_uriparse(ha_buffer_t* buf, const char* suri, ha_uri_t* uri)
ASSERT(buf && suri && uri);
+ /* TODO: We need to http decode the uri */
+
/* Copy the memory */
str = ha_bufcpy(buf, suri);
if(!str)
- return HA_ERROR;
+ return HA_CRITERROR;
/* Initialize the structure */
memset(uri, 0, sizeof(*uri));
@@ -445,7 +447,7 @@ deal_with_host:
port = strtol(s, &endstr, 10);
uri->port = port;
if(*endstr != '\0')
- return HA_FALSE;
+ return HA_FAILED;
}
goto deal_with_path;
@@ -548,7 +550,7 @@ int ha_genrandom(unsigned char* data, size_t len)
if(dd == -1)
{
ha_message(LOG_ERR, "couldn't open /dev/urandom");
- return HA_ERROR;
+ return HA_FAILED;
}
for(;;)
@@ -582,5 +584,5 @@ int ha_genrandom(unsigned char* data, size_t len)
}
close(dd);
- return r == -1 ? HA_ERROR : HA_OK;
+ return r == -1 ? HA_FAILED : HA_OK;
}