about summary refs log tree commit homepage
path: root/lib/unicorn/configurator.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-01 13:59:40 -0700
committerEric Wong <normalperson@yhbt.net>2009-07-01 14:12:07 -0700
commit06bf73975864b8e16ef1ee977f8424a0e5517fd6 (patch)
treeedb02fb04b9edf26dc7a8b9add0c5e5c6e43d8aa /lib/unicorn/configurator.rb
parentec5d374768ced6aba3fed8a9481d2ac3c07cdb98 (diff)
downloadunicorn-06bf73975864b8e16ef1ee977f8424a0e5517fd6.tar.gz
This change gives applications full control to deny clients
from uploading unwanted message bodies.  This also paves the
way for doing things like upload progress notification within
applications in a Rack::Lint-compatible manner.

Since we don't support HTTP keepalive, so we have more freedom
here by being able to close TCP connections and deny clients the
ability to write to us (and thus wasting our bandwidth).

While I could've left this feature off by default indefinitely
for maximum backwards compatibility (for arguably broken
applications), Unicorn is not and has never been about
supporting the lowest common denominator.
Diffstat (limited to 'lib/unicorn/configurator.rb')
-rw-r--r--lib/unicorn/configurator.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 1f18515..bd0a198 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -44,7 +44,6 @@ module Unicorn
       :preload_app => false,
       :stderr_path => nil,
       :stdout_path => nil,
-      :stream_input => false,
     }
 
     attr_reader :config_file #:nodoc:
@@ -65,10 +64,6 @@ module Unicorn
 
     def commit!(server, options = {}) #:nodoc:
       skip = options[:skip] || []
-      stream_input = @set.delete(:stream_input)
-      unless stream_input.nil?
-        Unicorn::HttpRequest::DEFAULTS[Const::STREAM_INPUT] = stream_input
-      end
       @set.each do |key, value|
         value == :unset and next
         skip.include?(key) and next
@@ -276,28 +271,6 @@ module Unicorn
       end
     end
 
-    # Allow applications to stream input as it is being read from the
-    # network directly to the application.  Enabling this can allow
-    # real-time processing of request bodies as it is being sent by
-    # the client, useful for things like upload progress notification
-    # and tunneling arbitrary stream protocols via bidirectional chunked
-    # transfer encoding.
-    # This may not work with all applications because some broken
-    # applications assume env['rack.input'].read(size) always returns
-    # the requested amount of data.  This causes env['rack.input']#read
-    # to provide IO#readpartial semantics instead.  Some applications
-    # may also fully receive an input and never attempt to process it,
-    # causing clients confusion when they receive a response after
-    # only a partial request has been sent.
-    def stream_input(bool)
-      case bool
-      when TrueClass, FalseClass
-        @set[:stream_input] = bool
-      else
-        raise ArgumentError, "stream_input=#{bool.inspect} not a boolean"
-      end
-    end
-
     # Allow redirecting $stderr to a given path.  Unlike doing this from
     # the shell, this allows the unicorn process to know the path its
     # writing to and rotate the file if it is used for logging.  The