summaryrefslogtreecommitdiff
path: root/main/http.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2008-08-01 21:56:07 +0000
committerTerry Wilson <twilson@digium.com>2008-08-01 21:56:07 +0000
commit671627028c3dde78f2704485ae1b2f3d321e3436 (patch)
tree6e73594bc852c223bb8956270a1d24645bcb89b1 /main/http.c
parentca38a1a082b71406a93c50826aabf02b297edfee (diff)
Fix mime parsing by re-adding support for passing headers to callback functions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/http.c b/main/http.c
index e6256b3df..bb6ae6121 100644
--- a/main/http.c
+++ b/main/http.c
@@ -657,6 +657,7 @@ static void *httpd_helper_thread(void *data)
int status = 200, contentlength = 0;
struct ast_str *out = NULL;
unsigned int static_content = 0;
+ struct ast_variable *tail = headers;
if (!fgets(buf, sizeof(buf), ser->f)) {
goto done;
@@ -686,6 +687,24 @@ static void *httpd_helper_thread(void *data)
}
if (!strncasecmp(cookie, "Cookie: ", 8)) {
vars = parse_cookies(cookie);
+ } else {
+ char *name, *val;
+
+ val = cookie;
+ name = strsep(&val, ":");
+ if (ast_strlen_zero(name) || ast_strlen_zero(val)) {
+ continue;
+ }
+ ast_trim_blanks(name);
+ val = ast_skip_blanks(val);
+
+ if (!headers) {
+ headers = ast_variable_new(name, val, __FILE__);
+ tail = headers;
+ } else {
+ tail->next = ast_variable_new(name, val, __FILE__);
+ tail = tail->next;
+ }
}
}