]> granicus.if.org Git - libevent/commitdiff
r14205@tombo: nickm | 2008-02-16 11:55:57 -0500
authorNick Mathewson <nickm@torproject.org>
Sat, 16 Feb 2008 16:56:34 +0000 (16:56 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 16 Feb 2008 16:56:34 +0000 (16:56 +0000)
 Fix bug 1894184: add a CRLF after each chunk when sending chunked HTTP data.  Original patch from propanbutan.

svn:r637

ChangeLog
http.c

index 02788c630419a362e3c75e4cd312a0eb6253a4bb..f02f991f9c544a6658d058b2e2338d80fc155f73 100644 (file)
--- 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 712a8999727c4c316445ede9b71c66c0f5262d8f..1c791c077b2808dd0f325329f74702a0b3e40b0a 100644 (file)
--- 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);
 }