summaryrefslogtreecommitdiff
path: root/daemon/misc.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-04-26 20:39:55 +0000
committerStef Walter <stef@memberwebs.com>2004-04-26 20:39:55 +0000
commit8368de7830f336533f9fe6369641070239bf739c (patch)
tree5ad9641a6254c1c3a9e33750fdfb37ac7fbb7583 /daemon/misc.c
parent627c573af25b602ac64c36b01c8163c592cbb494 (diff)
More debugging fixes.
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;
}