about summary refs log tree commit homepage
path: root/lib/unicorn/app
DateCommit message (Collapse)
2010-10-05Unicorn::Util.tmpio => Unicorn::TmpIO.new
This is slightly shorter and hopefully easier to find.
2010-06-14app/exec_cgi: rack.input may not respond to #size
Rack 1.2 no longer requires "rack.input" objects respond to size.
2009-12-06http: PATH_INFO/REQUEST_PATH includes semi-colons
This is allowed according to RFC 2396, section 3.3 and matches the behavior of URI.parse, as well.
2009-11-15replace "rescue => e" with "rescue Object => e"
"Object" is needless noise and some folks are annoyed by seeing it.
2009-11-14old_rails: autoload Static
It makes life easier for people writing config.ru files for use with Rails.
2009-11-14old_rails/static: avoid freezing strings
No need to freeze them unless we're assigning new hash values (PATH_INFO is already hashed when we assign it).
2009-09-30cleanup: use question mark op for 1-byte comparisons
It's compatible with both Ruby 1.8 and 1.9 without needing a Range object.
2009-09-27Remove "Z" constant for binary strings
We've started using magic comments to ensure any strings we create are binary instead. Additionally, ensure we create any StringIO objects with an explicit string (which default to binary) to ensure the StringIO object is binary. This is because StringIO.new (with no arguments) will always use the process-wide default encoding since it does not know about magic comments (and couldn't, really...)
2009-09-16Avoid freezing objects that don't benefit from it
This gives applications more rope to play with in case they have any reasons for changing some values of the default constants. Freezing strings for Hash assignments still speeds up MRI, so we'll keep on doing that for now (and as long as MRI supports frozen strings, I expect them to always be faster for Hashes though I'd be very happy to be proven wrong...)
2009-09-08"encoding: binary" comments for all sources (1.9)
This ensures any string literals that pop up in *our* code will just be a bag of bytes. This shouldn't affect/fix/break existing apps in most cases, but most constants will always have the "correct" encoding (none!) to be consistent with HTTP/socket expectations. Since this comment affects things only on a per-source basis, it won't affect existing apps with the exception of strings we pass to the Rack application. This will eventually allow us to get rid of that Unicorn::Z constant, too.
2009-08-16app/inetd: explicitly close pipe descriptors on CatBody#close
Since Rack permits body objects to have #close called on them, we can safely close our pipe readers immediately instead of waiting on the GC to close them (like we do for TeeInput tempfiles).
2009-08-15Remove explicit requires for Rack things
Rack is autoload-based and so are we.
2009-07-19app/exec_cgi: fix 1.9 compatibility
"/dev/null" must be opened in binary mode for Rack-compliance. Additionally, avoid '' to create an empty string and use Unicorn::Z instead. Conflicts: lib/unicorn/app/exec_cgi.rb
2009-07-19Remove core Tempfile dependency (1.9.2-preview1 compat)
With the 1.9.2preview1 release (and presumably 1.9.1 p243), the Ruby core team has decided that bending over backwards to support crippled operating/file systems was necessary and that files must be closed before unlinking. Regardless, this is more efficient than using Tempfile because: 1) no delegation is necessary, this is a real File object 2) no mkdir is necessary for locking, we can trust O_EXCL to work properly without unnecessary FS activity 3) no finalizer is needed to unlink the file, we unlink it as soon as possible after creation.
2009-07-04Favor Struct members to instance variables
There's a small memory reduction to be had when forking oodles of processes and the Perl hacker in me still gets confused into thinking those are arrays...
2009-07-01Force streaming input onto apps by default
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.
2009-07-01Move "Expect: 100-continue" handling to the app
This gives the app ability to deny clients with 417 instead of blindly making the decision for the underlying application. Of course, apps must be made aware of this.
2009-06-29inetd: fix broken constant references
This has been totally broken since commit b0013b043a15d77d810d5965157766c1af364db2 "Avoid duplicating the "Z" constant"
2009-06-25exec_cgi: small cleanups
* avoid '' strings for GC-friendliness * Ensure the '' we do need is binary for 1.9 * Disable passing the raw rack.input object to the child process This is never possible with our new TeeInput wrapper.
2009-06-09Avoid duplicating the "Z" constant
Trying not to repeat ourselves. Unfortunately, Ruby 1.9 forces us to actually care about encodings of arbitrary byte sequences.
2009-06-06Put copyright text in new files, include GPL2 text
Just clarifying the license terms of the new code. Other files should really have this notice in there as well.
2009-06-06Unicorn::App::Inetd: reinventing Unix, poorly :)
This includes an example of tunneling the git protocol inside a TE:chunked HTTP request. The example is unfortunately contrived in that it relies on the custom examples/cat-chunk-proxy.rb script in the client. My initial wish was to have a generic tool like curl(1) operate like this: cat > ~/bin/cat-chunk-proxy.sh <<EOF #!/bin/sh exec curl -sfNT- http://$1:$2/ EOF chmod +x ~/bin/cat-chunk-proxy.sh GIT_PROXY_COMMAND=cat-chunk-proxy.sh git clone git://0:8080/foo Unfortunately, curl will attempt a blocking read on stdin before reading the TCP socket; causing the git-clone consumer to starve. This does not appear to be a problem with the new server code for handling chunked requests.
2009-05-13privatize constants only used by old_rails/static
Unicorn proper no longer needs these constants, so don't bother with them.
2009-05-11exec_cgi: don't assume the body#each consumer is a socket
If we're using middleware that pushes the body into an array, bad things will happen if we're clobbering the string for each iteration of body#each.
2009-05-10app/exec_cgi: use explicit buffers for read/sysread
This reduces garbage generation to improve performance. Rack 1.0 allows InputWrapper to read with an explicit buffer.
2009-05-03app/old_rails: correctly log errors in output
"out" was an invalid variable in that context...
2009-05-02app/exec_cgi: GC prevention
Don't allow newly created IO objects to get GC'ed and subsequently close(2)-ed. We're not reopening the {$std,STD}{in,out,err} variables since those can't be trusted to have fileno 1, 2 and 3 respectively.
2009-04-12old_rails: try harder to ensure valid responses
Hopefully the world will just move to Rack faster so we have less things to worry about.
2009-03-30app/old_rails/static: define missing constant
REQUEST_METHOD got removed from Unicorn::Const and this module is the only place that currently uses it.
2009-03-23unicorn_rails: support non-Rack versions of Rails
This resurrects old code from Mongrel to wrap the Rails Dispatcher for older versions of Rails. It seems that Rails >= 2.2.0 support Rack, but only >=2.3 requires it. I'd like to support Rails 1.2.x for a while, too.
2009-03-20Add Unicorn::App::ExecCgi
This is a Rack handler that passes Rack::Lint running cgit and so it has been lightly tested. No other CGI executables have been run with it.