summaryrefslogtreecommitdiff
path: root/daemon/basic.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-08-09 18:35:56 +0000
committerStef Walter <stef@memberwebs.com>2004-08-09 18:35:56 +0000
commit670eba73c474230e31d688e9568fcd540b4e3b39 (patch)
tree624502f0713a9c6f3b0520416134b405f150f356 /daemon/basic.c
parentb0e50bbeb12e6247dd52dfd9e44c62f558c8a3a0 (diff)
- added request parameter to ha_message...
- combined ha_request and ha_response
Diffstat (limited to 'daemon/basic.c')
-rw-r--r--daemon/basic.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/daemon/basic.c b/daemon/basic.c
index fc0a096..6b41a36 100644
--- a/daemon/basic.c
+++ b/daemon/basic.c
@@ -6,39 +6,39 @@
int basic_parse(const char* header, ha_buffer_t* buf, basic_header_t* rec)
{
- char* t;
- ASSERT(header && buf && rec);
+ char* t;
+ ASSERT(header && buf && rec);
- memset(rec, 0, sizeof(*rec));
+ memset(rec, 0, sizeof(*rec));
- /*
- * Authorization header is in this format:
- *
- * "Basic " B64(user ":" password)
- */
+ /*
+ * Authorization header is in this format:
+ *
+ * "Basic " B64(user ":" password)
+ */
- header = trim_start(header);
- header = (const char*)ha_bufdec64(buf, header, NULL);
+ header = trim_start(header);
+ header = (const char*)ha_bufdec64(buf, header, NULL);
- if(!header)
- return ha_buferr(buf) ? HA_CRITERROR : HA_FALSE;
+ if(!header)
+ return ha_buferr(buf) ? HA_CRITERROR : HA_FALSE;
- /* We have a cache key at this point so hash it */
- md5_string(rec->key, header);
+ /* We have a cache key at this point so hash it */
+ md5_string(rec->key, header);
- /* Parse the user. We need it in any case */
- t = strchr(header, ':');
- if(t != NULL)
- {
- /* Break the string in half */
- *t = 0;
+ /* Parse the user. We need it in any case */
+ t = strchr(header, ':');
+ if(t != NULL)
+ {
+ /* Break the string in half */
+ *t = 0;
- rec->user = header;
- rec->password = t + 1;
- }
+ rec->user = header;
+ rec->password = t + 1;
+ }
- return HA_OK;
+ return HA_OK;
}