summary refs log tree commit homepage
AgeCommit message (Collapse)AuthorFilesLines
2009-07-19unicorn 0.9.2 v0.9.2Eric Wong2-1/+2
2009-07-19app/exec_cgi: fix 1.9 compatibilityEric Wong1-1/+1
"/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-19fix tests to run correctly under 1.9.2preview1Eric Wong2-32/+34
test/test_helper doesn't seem to be required correctly anymore, since we know our own module/test names don't conflict, just fix RUBYLIB to include $(test_prefix) With test_util.rb, using #reopen with Tempfile objects seems prone to the objects being closed. Not completely sure what is going on but I'll just sidestep around it since I've stopped trusting Tempfile by now...
2009-07-19Remove core Tempfile dependency (1.9.2-preview1 compat)Eric Wong4-28/+31
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-16HttpRequest: no need for a temporary variableEric Wong1-5/+3
Regexps can be run against nil just fine
2009-07-16http_request: don't support apps that close env["rack.input"]Eric Wong1-1/+1
Anything that calls close on a rack.input body is violating Rack::Lint; so don't waste cycles supporting them. Being liberal in things we accept tolerates bad behavior and Unicorn doesn't have a large userbase that would scream bloody murder if we stopped supporting broken behavior.
2009-07-16move all #gets logic to tee_input out of chunked_readerEric Wong4-89/+84
This simplifies chunked_reader substantially with a slight increase in tee_input complexity. This is beneficial because chunked_reader is more complex to begin with and more likely to experience correctness issues.
2009-07-15Rename unicorn/http11 => unicorn_httpEric Wong17-129/+129
We couldn't do proper namespacing for the C module so there was a potential conflict with Init_http11() in Mongrel. This was needed because Mongrel's HTTP parser could be used in some applications and we may be unfortunate enough need to support them.
2009-07-14README: update about development/stable versionsEric Wong1-3/+9
While we're at it remove the Windows-centric comment for folks who can't get a C compiler and put in something useful for the Red Hat/Debian crowd where splitting packages is all the rage.
2009-07-14README: add Gmane newsgroup infoEric Wong1-1/+2
2009-07-09unicorn 0.9.1 (merge 0.8.2) v0.9.1Eric Wong3-1/+4
* maint: unicorn 0.8.2 always set FD_CLOEXEC on sockets post-accept() Minor cleanups to core Re-add support for non-portable socket options Retry listen() on EADDRINUSE 5 times ever 500ms Unbind listeners as before stopping workers Conflicts: CHANGELOG lib/unicorn.rb lib/unicorn/configurator.rb lib/unicorn/const.rb
2009-07-09unicorn 0.8.2 v0.8.2Eric Wong2-1/+2
2009-07-09always set FD_CLOEXEC on sockets post-accept()Eric Wong1-0/+1
FD_CLOEXEC is not guaranteed to be inherited by the accept()-ed descriptors even if the listener socket has this set. This can be a problem with applications that fork+exec long running background processes. Thanks to Paul Sponagl for helping me find this.
2009-07-08Minor cleanups to coreEric Wong1-5/+5
(cherry picked from commit ec70433f84664af0dff1336845ddd51f50a714a3)
2009-07-08Re-add support for non-portable socket optionsEric Wong2-2/+72
Now that we support tunnelling arbitrary protocols over HTTP as well as "100 Continue" responses, TCP_NODELAY actually becomes useful to us. TCP_NODELAY is actually reasonably portable nowadays; even. While we're adding non-portable options, TCP_CORK/TCP_NOPUSH can be enabled, too. Unlike some other servers, these can't be disabled explicitly/intelligently to force a flush, however. However, these may still improve performance with "normal" HTTP applications (Mongrel has always had TCP_CORK enabled in Linux). While we're adding OS-specific features, we might as well support TCP_DEFER_ACCEPT in Linux and FreeBSD the "httpready" accept filter to prevent abuse. These options can all be enabled on a per-listener basis. (cherry picked from commit 563d03f649ef31d2aec3505cbbed1e015493b8fc)
2009-07-08Retry listen() on EADDRINUSE 5 times ever 500msEric Wong1-3/+10
This number of retries and delay taken directly from nginx (cherry picked from commit d247b5d95a3ad2de65cc909db21fdfbc6194b4c9)
2009-07-08Unbind listeners as before stopping workersEric Wong1-2/+1
This allows another process to take our listeners sooner rather than later. (cherry picked from commit 8c2040127770e40e344a927ddc187bf801073e33)
2009-07-04Minor cleanups to coreEric Wong1-5/+5
2009-07-04Favor Struct members to instance variablesEric Wong9-219/+197
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-03Avoid temporary array creationEric Wong1-2/+1
Array#+= creates a new array before assigning, Array#concat just appends one array to another without an intermediate one.
2009-07-01unicorn 0.9.0 v0.9.0Eric Wong2-1/+2
2009-07-01Remove cat-chunk-proxy, curl CVS supports non-blocking stdinEric Wong4-69/+9
Now that upstream curl supports this functionality, there's no reason to duplicate it here as an example.
2009-07-01Force streaming input onto apps by defaultEric Wong9-59/+18
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-01tee_input: avoid ignoring initial body blobEric Wong1-1/+4
This was causing the first part of the body to be missing when an HTTP client failed to delay between sending the header and body in the request.
2009-07-01Move "Expect: 100-continue" handling to the appEric Wong3-4/+13
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-07-01Re-add support for non-portable socket optionsEric Wong2-2/+72
Now that we support tunnelling arbitrary protocols over HTTP as well as "100 Continue" responses, TCP_NODELAY actually becomes useful to us. TCP_NODELAY is actually reasonably portable nowadays; even. While we're adding non-portable options, TCP_CORK/TCP_NOPUSH can be enabled, too. Unlike some other servers, these can't be disabled explicitly/intelligently to force a flush, however. However, these may still improve performance with "normal" HTTP applications (Mongrel has always had TCP_CORK enabled in Linux). While we're adding OS-specific features, we might as well support TCP_DEFER_ACCEPT in Linux and FreeBSD the "httpready" accept filter to prevent abuse. These options can all be enabled on a per-listener basis.
2009-06-30Retry listen() on EADDRINUSE 5 times ever 500msEric Wong1-3/+10
This number of retries and delay taken directly from nginx
2009-06-30Unbind listeners as before stopping workersEric Wong1-2/+1
This allows another process to take our listeners sooner rather than later.
2009-06-30TrailerParser integration into ChunkedReaderEric Wong7-17/+63
Support for the "Trailer:" header and associated Trailer lines should be reasonably well supported now
2009-06-30trailer_parser: set keys with "HTTP_" prefixEric Wong2-5/+5
2009-06-30TeeInput: use only one IO for tempfileEric Wong1-25/+21
We can actually just use one IO and file descriptor here and simplify the code while we're at it.
2009-06-30chunked_reader: Add test for chunk parse failureEric Wong2-1/+18
I'd honestly be more comfortable doing this in C (and possibly adapting the code from the libcurl internals since that code has been very well-tested).
2009-06-30Add trailer_parser for parsing trailersEric Wong3-0/+105
Eventually this (and ChunkedReader) may be done in C/Ragel along with the existing HttpParser.
2009-06-29http_request: tighter Transfer-Encoding: "chunked" checkEric Wong1-1/+1
Don't allow misbehaving clients to mispell "chunked"
2009-06-29Only send "100 Continue" when no body has been sentEric Wong1-3/+3
Under slow/inconsistent network conditions or overly aggressive clients, there is a possibility we could've already started reading the body. In those cases, don't bother responding to the expectation to continue since the client has already started sending a message body.
2009-06-29ACK clients on "Expect: 100-continue" headerEric Wong3-2/+5
By responding with a "HTTP/1.1 100 Continue" response to encourage a client to send the rest of the body. This is part of the HTTP/1.1 standard but not often implemented by servers: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3 This will speed up curl uploads since curl sleeps up to 1 second if no response is received: http://curl.haxx.se/docs/faq.html#My_HTTP_POST_or_PUT_requests_are
2009-06-29http_request: force BUFFER to be Encoding::BINARYEric Wong1-0/+1
Not sure why this hasn't been an issue yet, but better safe than sorry with data integrity...
2009-06-29chunked_reader: simpler interfaceEric Wong3-42/+38
This won't be heavily used enough to make preallocation worth the effort. While we're at it, don't enforce policy by forcing the readpartial buffer to be Encoding::BINARY (even though it /should/ be :), it's up to the user of the interface to decide.
2009-06-29configurator: provide stream_input (true|false) optionEric Wong3-7/+31
The default is false because some applications were not written to handle partial reads (even though IO#read allows it, not just IO#readpartial).
2009-06-29inetd: fix broken constant referencesEric Wong1-2/+2
This has been totally broken since commit b0013b043a15d77d810d5965157766c1af364db2 "Avoid duplicating the "Z" constant"
2009-06-29"Fix" tests that break with stream_input=falseEric Wong4-4/+18
2009-06-29tee_input: avoid rereading fresh dataEric Wong1-1/+10
Oops!
2009-06-29test_rails: workaround long-standing 1.9 bugEric Wong1-12/+18
Now that I've beefed out my Makefile to detect errors, I've noticed this test has been failing under 1.9 for a while now. Currently no released version of Rack(1.0) or Rails(2.3.2.1) supports this.
2009-06-29GNUmakefile: allow TRACER= to be specified for testsEric Wong1-1/+4
This can allow you to run make with: TRACER='strace -f -o $(t).strace -s 100000' to debug a test failure (it should be usable with truss, ltrace, and other similar tools).
2009-06-29test_upload: fix ECONNRESET with 1.9Eric Wong1-1/+5
This has been broken since 6945342a1f0a4caaa918f2b0b1efef88824439e0 "Transfer-Encoding: chunked streaming input support" but somehow never caught by me or anyone else.
2009-06-29GNUmakefile: more stringent error checking in testsEric Wong1-3/+4
2009-06-29test_upload: add tests for chunked encodingEric Wong1-1/+86
Additionally, provide verifications for sizes after-the-fact to avoid slamming all of our input into the server.
2009-06-29Make TeeInput easier to useEric Wong3-22/+7
The complexity of making the object persistent isn't worth the potential performance gain here.
2009-06-29tee_input: avoid defining a @rd.size methodEric Wong1-3/+0
We don't ever expose the @rd object to the public so Rack-applications won't ever call size() on it.
2009-06-29README: another note about older SinatraEric Wong1-6/+11
Older Sinatra would blindly try to run Mongrel or Thin at_exit. This causes strange behavior to happen when Unicorn workers are exited.