Truncated request bodies

Eric Wong normalperson at
Sun Oct 25 17:31:31 EDT 2009

Eric Wong <normalperson at> wrote:
> Eric Wong <normalperson at> wrote:
> > 
> > Does the following patch fix things for you?

Hi Vadim, I actually just got a better patch offlist that
looks more reasonable than mine:

diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb
index 188e2ea..7e77cdf 100644
--- a/lib/unicorn/tee_input.rb
+++ b/lib/unicorn/tee_input.rb
@@ -131,6 +131,7 @@ module Unicorn
           if parser.filter_body(dst, socket.readpartial(length, buf)).nil?
+  , IO::SEEK_END) # workaround FreeBSD/OSX + MRI 1.8.x bug
             return dst
         rescue EOFError

Also pushed out to git://

Upon further inspection of the Ruby 1.8.7 source, I'm surprised it
worked anywhere, glibc + Linux included :x

I've managed to open a ticket on the issue for ruby-core:

Eric Wong

More information about the mongrel-unicorn mailing list