From: Nick Mathewson Date: Sat, 16 Feb 2008 16:56:34 +0000 (+0000) Subject: r14205@tombo: nickm | 2008-02-16 11:55:57 -0500 X-Git-Tag: release-2.0.1-alpha~427 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=677a95864be43749c82705f9f8f3f56f0b8a1f4b;p=libevent r14205@tombo: nickm | 2008-02-16 11:55:57 -0500 Fix bug 1894184: add a CRLF after each chunk when sending chunked HTTP data. Original patch from propanbutan. svn:r637 --- diff --git a/ChangeLog b/ChangeLog index 02788c63..f02f991f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,9 +36,10 @@ Changes in current version: o associate more context for hooks to query such as the connection object o remove pending timeouts on event_base_free() o also check EAGAIN for Solaris' event ports; from W.C.A. Wijngaards - o devpoll and evport need reinit; tested by W.C.A Wijngaards + o devpoll and evport need reinit; tested by W.C.A Wijngaards o event_base_get_method; from Springande Ulv - + o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184. + Changes in 1.4.0: o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. o demote most http warnings to debug messages diff --git a/http.c b/http.c index 712a8999..1c791c07 100644 --- a/http.c +++ b/http.c @@ -1728,6 +1728,9 @@ evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf) (unsigned)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); }