From d8637958ddefee1c336d8d9fef92d8b923d93677 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 10 Jun 2012 02:51:42 +0900 Subject: [PATCH] Added missing \r\n after chunk --- examples/shrpx_downstream.cc | 7 +++++++ examples/shrpx_https_upstream.cc | 3 +++ 2 files changed, 10 insertions(+) diff --git a/examples/shrpx_downstream.cc b/examples/shrpx_downstream.cc index be4d6d94..64aaf24a 100644 --- a/examples/shrpx_downstream.cc +++ b/examples/shrpx_downstream.cc @@ -347,6 +347,13 @@ int Downstream::push_upload_data_chunk(const uint8_t *data, size_t datalen) return -1; } res += rv; + if(chunked_request_) { + rv = evbuffer_add(output, "\r\n", 2); + if(rv == -1) { + return -1; + } + res += 2; + } return res; } diff --git a/examples/shrpx_https_upstream.cc b/examples/shrpx_https_upstream.cc index cf77408a..d63d5c43 100644 --- a/examples/shrpx_https_upstream.cc +++ b/examples/shrpx_https_upstream.cc @@ -575,6 +575,9 @@ int HttpsUpstream::on_downstream_body(Downstream *downstream, evbuffer_add(output, chunk_size_hex, rv); } evbuffer_add(output, data, len); + if(downstream->get_chunked_response()) { + evbuffer_add(output, "\r\n", 2); + } return 0; }