about summary refs log tree commit homepage
path: root/lib/unicorn/stream_input.rb
DateCommit message (Collapse)
2015-08-22stream_input: favor String#clear over String#replace
We no longer need Ruby 1.8 compatibility, so use String#clear to reduce argument passing and code size.
2013-11-07stream_input: avoid IO#close on client disconnect
This can avoid IOError from being seen by the application, and also reduces points where IO#close may be called. This is a good thing if we eventually port this code into a low-level server like cmogstored where per-client memory space is defined by FD number of a client. Reported-by: Andrew Hobson <ahobson@gmail.com>
2012-04-27stream_input: call shutdown(2) if a client EOFs on us
In case the Rack app forks before a client upload is complete, shutdown(2) the socket to ensure the client isn't attempting to read from us (even if it explicitly stopped writes).
2011-04-18documentation cleanup/reduction
Don't clutter up our RDoc/website with things that users of Unicorn don't need to see. This should make user-relevant documentation easier to find, especially since Unicorn is NOT intended to be an API.
2011-02-10remove unnecessary &block usage
They needlessly allocate Proc objects
2010-12-02stream_input: avoid trailer parsing on unchunked requests
It screws up keepalive for Rainbows! requests with a body.
2010-11-20stream_input: use String#sub! instead of gsub!
There's no difference because of the \A anchor, but sub! is doesn't loop so it's simpler.
2010-11-20stream_input: small cleanups and fixes
No need to accept any number of args, that could hide bugs in applications that could give three or more arguments. We also raise ArgumentError when given a negative length argument to read.
2010-11-18stream_input: read with zero length returns ''
Any calls to read with an explicit zero length now returns an empty string. While not explicitly specified by Rack::Lint, this is for compatibility with StringIO and IO methods which are common in other web servers.
2010-11-12*_input: make life easier for subclasses/modules
Avoid having specific knowledge of internals in TeeInput and instead move that to StreamInput when dealing with byte counts. This makes things easier for Rainbows! which will need to extends these classes.
2010-11-11add stream_input class and build tee_input on it
We will eventually expose a Unicorn::StreamInput object as "rack.input" for Rack 2.x applications. StreamInput allows applications to avoid buffering input to disk, removing the (potentially expensive) rewindability requirement of Rack 1.x. TeeInput is also rewritten to build off StreamInput for simplicity. The only regression is that TeeInput#rewind forces us to consume an unconsumed stream before returning, a negligible price to pay for decreased complexity.