From 8edcc3f9e1be9113685e61b9a83994a02d37c768 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Nov 2010 10:21:43 +0800 Subject: tee_input: switch to simpler API for parsing trailers Not that anybody uses trailers extensively, but it's good to know it's there. --- ext/unicorn_http/unicorn_http.rl | 1 + lib/unicorn/tee_input.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 147750a..6cc2958 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -714,6 +714,7 @@ static VALUE HttpParser_filter_body(VALUE self, VALUE buf, VALUE data) if (hp->len.content > 0) { long nr = MIN(dlen, hp->len.content); + hp->buf = data; memcpy(RSTRING_PTR(buf), dptr, nr); hp->len.content -= nr; if (hp->len.content == 0) { diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index a3e01d2..351d79f 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -187,7 +187,7 @@ private end def finalize_input - while @parser.trailers(@env, @buf).nil? + until @parser.parse r = @socket.kgio_read(@@io_chunk_size) or eof! @buf << r end -- cgit v1.2.3-24-ge0c7