[asterisk-commits] qwell: trunk r309209 - in /trunk: ./ main/http.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 1 16:26:41 CST 2011
Author: qwell
Date: Tue Mar 1 16:26:37 2011
New Revision: 309209
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309209
Log:
Merged revisions 309204 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r309204 | qwell | 2011-03-01 16:25:44 -0600 (Tue, 01 Mar 2011) | 7 lines
Fix consistency of CRLFs on HTTP headers that get sent out.
(closes issue #18186)
Reported by: nivaldomjunior
Patches:
18186-httpheadernewline.diff uploaded by qwell (license 4)
........
Modified:
trunk/ (props changed)
trunk/main/http.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: trunk/main/http.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/http.c?view=diff&rev=309209&r1=309208&r2=309209
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Tue Mar 1 16:26:37 2011
@@ -278,7 +278,7 @@
ast_str_set(&http_header, 0, "Content-type: %s\r\n"
"ETag: %s\r\n"
- "Last-Modified: %s",
+ "Last-Modified: %s\r\n",
mtype,
etag,
timebuf);
@@ -369,7 +369,7 @@
};
-/* send http/1.1 responce */
+/* send http/1.1 response */
/* free content variable and close socket*/
void ast_http_send(struct ast_tcptls_session_instance *ser,
enum ast_http_method method, int status_code, const char *status_title,
@@ -387,7 +387,7 @@
ast_strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", ast_localtime(&now, &tm, "GMT"));
- /* calc conetnt length */
+ /* calc content length */
if (out) {
content_length += strlen(ast_str_buffer(out));
}
@@ -404,7 +404,8 @@
"Connection: close\r\n"
"%s"
"Content-Length: %d\r\n"
- "%s\r\n\r\n",
+ "%s"
+ "\r\n",
status_code, status_title ? status_title : "OK",
ast_get_version(),
timebuf,
@@ -459,7 +460,7 @@
ast_str_set(&http_headers, 0,
"WWW-authenticate: Digest algorithm=MD5, realm=\"%s\", nonce=\"%08lx\", qop=\"auth\", opaque=\"%08lx\"%s\r\n"
- "Content-type: text/html",
+ "Content-type: text/html\r\n",
realm ? realm : "Asterisk",
nonce,
opaque,
@@ -481,7 +482,7 @@
return;
}
-/* send http error responce and close socket*/
+/* send http error response and close socket*/
void ast_http_error(struct ast_tcptls_session_instance *ser, int status_code, const char *status_title, const char *text)
{
struct ast_str *http_headers = ast_str_create(40);
@@ -493,7 +494,7 @@
return;
}
- ast_str_set(&http_headers, 0, "Content-type: text/html");
+ ast_str_set(&http_headers, 0, "Content-type: text/html\r\n");
ast_str_set(&out, 0,
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
More information about the asterisk-commits
mailing list