about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-08-09http: remove noise functions
It's easy enough to just check a single equality without having extra functions obscuring what's actually going on.
2009-08-09http: cleanup setting for common values => globals
We'll need to be defining g_http_transfer_encoding and g_content_length in the near future.
2009-08-09http: move global initialization code
Just extra noise we don't care about. This also allows us to undef the DEF_GLOBAL macro to avoid polluting the main namespace.
2009-08-09http: split out server params handling
It's mostly uninteresting code.
2009-08-09http: minor cleanup of http_field handling
Create a Ruby string object before jumping into the function to reduce the number of parameters passed and to take advantage of our STR_NEW macro to reduce noise.
2009-08-09http: small cleanup in "https" detection
2009-08-09http: "hp" denotes http_parser structs for consistency
It doesn't conflict with any any common variables, tokens or documentation pieces in the code.
2009-08-09http: remove some redundant functions
Eliminate unnecessary jumping around in the source code to find actions that lead to other actions and making it harder to notice side effects when dealing with data we're sharing anyways.
2009-08-09http: split uncommon_field into a separate function
There's also no point in validating field hits if our field is a common field; so only do the validation for field length if we need to allocate memory for a new field.
2009-08-09http: find_common_field_value => find_common_field
The "_value" suffix was used to denote the return type, which is redundandant as it is already known at compile time (being that this is C and functions have explicit return types). Furthurmore, the "_value" is confusing since we're actually returning a "key" when "value" is used in the context of "key-value" pairs.
2009-08-09Refactoring unicorn_http C/Ragel code
More tightly integrate the C/Ruby portions with C/Ragel to avoid the confusing the flow. Split out some files into hopefully logical areas so it's easier to focus on more interesting/volatile code.
2009-08-09extconf: SIZEOF_OFF_T should be a ruby.h macro
Only fallback to check_sizeof() if it is not. check_sizeof() is broken in Ruby 1.9.2preview1 (but fixed in trunk).
2009-08-09unicorn_http: add helpful macros
We'll be needing the UH_OFF_T_MAX define for the chunked body handling and rb_str_set_len may be needed as well.
2009-08-09unicorn_http: change "global_" prefix to "g_"
It's too annoying to have to deal with long prefixes that all look alike. "g_" is fairly standard in C programs so I'm keeping it (even though eliminating the prefix entirely is preferable, but there'd be name conflicts I don't feel like resolving).
2009-08-09unicorn_http: update copyright
So that blame falls on Eric if stuff breaks.
2009-08-09unicorn_http: remove typedef from http_parser
typedefs can be misleading for aggregate types, a struct is a struct.
2009-08-09Remove Ragel-generated file from version control
But keep it in the Manifest
2009-08-09unicorn_http: small cleanups and size reduction
Use Data_Make_Struct instead of Data_Wrap_Struct to avoid extra steps/code in object allocation. The GC will also free() implicitly if no free callback is passed to Data_Make_Struct, and we don't need an extra method here... Since we're more comfortable with object management nowadays, just make the data_get() fail with an assertion failure if it somehow (very unlikely) ends up getting a NULL parser object. Unicorn itself has no way of recovering other than throwing errors to clients anyways and we have bigger problems if there's a GC bug causing this. Then, finally, reduce the size of our http_parser struct even more (we'll add an int back later) since we know it's safe to do so...
2009-08-06README: latest stable version is 0.8.4
2009-07-20Update Rails tests to run on Rails 2.3.3.1
2009-07-19README: update version numbers for website
2009-07-19unicorn 0.9.2 v0.9.2
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-19fix tests to run correctly under 1.9.2preview1
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)
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 variable
Regexps can be run against nil just fine
2009-07-16http_request: don't support apps that close env["rack.input"]
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_reader
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_http
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 versions
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 info
2009-07-09unicorn 0.9.1 (merge 0.8.2) v0.9.1
* 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.2
2009-07-09always set FD_CLOEXEC on sockets post-accept()
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 core
(cherry picked from commit ec70433f84664af0dff1336845ddd51f50a714a3)
2009-07-08Re-add support for non-portable socket options
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 500ms
This number of retries and delay taken directly from nginx (cherry picked from commit d247b5d95a3ad2de65cc909db21fdfbc6194b4c9)
2009-07-08Unbind listeners as before stopping workers
This allows another process to take our listeners sooner rather than later. (cherry picked from commit 8c2040127770e40e344a927ddc187bf801073e33)
2009-07-04Minor cleanups to core
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-03Avoid temporary array creation
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.0
2009-07-01Remove cat-chunk-proxy, curl CVS supports non-blocking stdin
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 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-01tee_input: avoid ignoring initial body blob
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 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-07-01Re-add support for non-portable socket options
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 500ms
This number of retries and delay taken directly from nginx
2009-06-30Unbind listeners as before stopping workers
This allows another process to take our listeners sooner rather than later.
2009-06-30TrailerParser integration into ChunkedReader
Support for the "Trailer:" header and associated Trailer lines should be reasonably well supported now