aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 21:56:07 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 21:56:07 +0000
commitce466967683875f1033ffb0e3a5bcbd18131ad2f (patch)
tree6e73594bc852c223bb8956270a1d24645bcb89b1 /res
parent2204bee5d55fb5a7465c19650292aabbbd2b13b5 (diff)
Fix mime parsing by re-adding support for passing headers to callback functions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135235 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_http_post.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_http_post.c b/res/res_http_post.c
index d065365fd..f1ae7a7da 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -203,6 +203,8 @@ static struct ast_str *http_post_callback(struct ast_tcptls_session_instance *se
}
for (var = headers; var; var = var->next) {
+ fprintf(f, "%s: %s\r\n", var->name, var->value);
+
if (!strcasecmp(var->name, "Content-Length")) {
if ((sscanf(var->value, "%u", &content_len)) != 1) {
ast_log(LOG_ERROR, "Invalid Content-Length in POST request!\n");
@@ -211,11 +213,11 @@ static struct ast_str *http_post_callback(struct ast_tcptls_session_instance *se
return NULL;
}
ast_debug(1, "Got a Content-Length of %d\n", content_len);
- } else if (!strcasecmp(var->name, "Content-Type")) {
- fprintf(f, "Content-Type: %s\r\n\r\n", var->value);
}
}
+ fprintf(f, "\r\n");
+
for (res = sizeof(buf); content_len; content_len -= res) {
if (content_len < res) {
res = content_len;