plack/Plack — pull request #487 by xsawyerx (2014-12-28 16:41:40+00:00)
Title: Speed improvements for big uploads

This originated as PerlDancer/Dancer GH #1092, work by Rick Myers.

I have ported this to Dancer2 and I think it makes sense to have it
in Plack::Request too.

Basically instead of adding to the body every time we read a chunk,
we just add them to a variable and then, once done, we feed the
body with the entire content.

This isn't done for the streamed buffer because that actually calls
"print" on the buffer, so I'm assuming it might write somewhere the
chunked content, so that might break (expected) behavior.

Also, perhaps it's better to set the entire body instead of "add"
method, but when I tried it, a bunch of tests failed and I didn't
look into why.