summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-16 16:57:02 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-16 16:57:02 +0000
commitdf142a73b723a474f7d0302c7088886fd4d751a7 (patch)
tree9113729e560a6b0dc729f94d911d6dc1eaff8d25
parentf4853d96d2ceb1a3ea57e910d38939118154ec3c (diff)
downloadlibevent-patches-1.3.tar.gz
r14207@tombo: nickm | 2008-02-16 11:56:16 -0500patches-1.3
Fix bug 1894184: add a CRLF after each chunk when sending chunked HTTP data. Original patch from propanbutan. [Backporting to 1.3 branch] svn:r639
-rw-r--r--ChangeLog2
-rw-r--r--http.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e3935c51..13c3cc42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,7 +11,7 @@ Changes since 1.3e:
o bufferevent_write now uses a const source argument; report from Charles Kerr
o Correctly handle DNS replies with no answers set (Fixes bug 1846282)
o Attempt to fix MSVC build.
-
+ o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
Changes since 1.3d:
o demote most http warnings to debug messages
diff --git a/http.c b/http.c
index 7f2e71b3..2a5ed812 100644
--- a/http.c
+++ b/http.c
@@ -1658,6 +1658,9 @@ evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf)
EVBUFFER_LENGTH(databuf));
}
evbuffer_add_buffer(req->evcon->output_buffer, databuf);
+ if (req->chunked) {
+ evbuffer_add(req->evcon->output_buffer, "\r\n", 2);
+ }
evhttp_write_buffer(req->evcon, NULL, NULL);
}