Date | Commit message (Collapse) |
|
For consistency with rev_write_response (and the existing
"write_response").
|
|
Cramp needs to override our normal header sending for
(old) WebSockets connections.
|
|
Cramp monkey patches Rainbows internals for WebSockets
support and we forgot about it. Add a new integration
test to ensure this continues to work in the future
(and force us to update the test for newer Cramp).
|
|
|
|
|
|
Unicorn 1.1.0 lets us change this default, and we need it higher
to avoid wasting workers against stupidly (or maliciously) slow
clients.
|
|
|
|
Other concurrency models will eventually be able to use it, too.
|
|
rb_str_slice_bang() allocates a new string internally and calls
rb_str_aref_m() AND rb_str_aset_m(), too. String#[] just
calls rb_str_aref_m() directly, so it's a much quicker code
path. Also, "[]" methods dispatch faster under 1.9, too.
|
|
|
|
Fortunately this only affects the hardly-used FiberSpawn and
FiberPool concurrency models, and also unreleased revisions of
Rev. 1.9 encoding is tricky to handle right when doing I/O in
Ruby...
|
|
non-blocking write() may cause kernel buffers to be allocated
behind the scenes, so retry the write() even if it's short
because it may succeed the next time around.
|
|
We shouldn't ever spew errors to the stderr/logger
on client disconnects (ECONNRESET/EPIPE/etc...).
|
|
There's no need to ever change the underlying offset of a file
descriptor when using sendfile(), so don't. This allows us to
avoid contention in the kernel/filesystem and eventually reuse
the same filesystem file descriptor for serving multiple
requests.
|
|
We need to load sendfile-using parts after the
"sendfile" library is loaded.
|
|
This hopefully allows the "sendfile" gem to be required
anywhere in the Rainbows!/Unicorn config file, and not
have to be required via RUBYOPT or the '-r' command-line
switch.
We also modularize HttpResponse and avoids singleton methods
in the response path. This (hopefully) makes it easier for
individual concurrency models to share code and override
individual methods.
|
|
Avoid confusing people with an overloaded method name
|
|
While we're at it, fix a comment, too.
|
|
We may use a blocking accept() loop if there is
only a single listener. In that case threads may
not be able to exit if a SIGQUIT is received, so
force them to run when joining.
|
|
This should improve performance for static file responses.
|
|
slowly cleaning up the generated RDoc
|
|
|
|
|
|
This still needs work and lots of cleanup, but the basics are
there. The sendfile 1.0.0 RubyGem is now safe to use under MRI
1.8, and is superior to current (1.9.2-preview3) versions of
IO.copy_stream for static files in that it supports more
platforms and doesn't truncate large files on 32-bit platforms.
|
|
This fleshes out Rainbows::Fiber::IO with a few
more methods for people using it.
|
|
|
|
|
|
|
|
No point in using a class here, there's no object
|
|
|
|
No point in documenting our internals and overwhelming
users.
|
|
Rack::Contrib::Sendfile moved into Rack in December 2009.
|
|
Make it easier to link to the Rainbows! configuration
documentation without anchors. This also reduces the
amount of code we spew into Unicorn::Configurator.
|
|
|
|
|
|
We can't use it effectively in Rubinius yet, and it's
broken due to the issue described in:
http://github.com/evanphx/rubinius/issues/379
|
|
There's no need to #dup the middleware object, just use
a custom Rainbows::DevFdResponse::Body object.
|
|
|
|
We only read from the IO pipe and never write to it
|
|
They're ugly and potentially non-portable to other servers.
They also make Unicorn + Rubinius unhappy, which makes us
unhappy as well.
|
|
|
|
Everything should be working under Ruby 1.9.2(-preview3) now.
|
|
I was originally experimenting with setsockopt to increase the
kernel buffer sizes in a loop, but the benefits were negligible
at best.
|
|
For small responses that can fit inside a kernel socket
buffer, copying that data into an IO::Buffer object is
a waste of precious memory bandwidth.
|
|
This gives a tiny performance improvement to the FiberSpawn and
FiberPool concurrency models.
|
|
Not that many people will actually call Rainbows.sleep
outside of tests...
|
|
HeaderHash objects can only be used as headers without
violating Rack::Lint in Rack 1.1.0 or later.
|
|
Array#[] lookups are slightly faster under both rbx and 1.9,
and easier to read.
|
|
Oops, looks like 1.9.1 exports the RUBY_ENGINE constant.
|
|
Rubinius still has a few issues that prevent 100% support,
but it basically works if log rotation or USR2 upgrades aren't
required. Tickets for all known issues for Rubinius have
been filed on the project's issue tracker.
* rbx does not support -i/-p yet, so rely on MRI for that
* "io/nonblock" is missing
* avoiding any optional Gems for now (EM, Rev, etc..)
|