about summary refs log tree commit homepage
path: root/lib/rainbows/rev/deferred_response.rb
DateCommit message (Collapse)
2010-07-27rev/client: workaround close ordering issue when proxying
When proxying pipes/sockets, it's possible for the Rev::IO#write to fail and close our connection. In that case we do not want our client to continue with the on_write_complete callback.
2010-07-26rev*: properly handle pipelined responses w/sendfile
With sendfile enabled, we must avoid writing headers (or normal, non-file responses) while a file is deferred for sending. This means we must disable processing of new requests while a file is deferred for sending and use the on_write_complete callback less aggressively.
2010-07-19rev: split out deferred chunk logic from unchunked
Similar to what we do in EM, this avoid unnecessary conditional logic inside more frequently used code paths.
2010-07-19rev/deferred_response: cleanups
Remove unnecessary include and also remove unnecessary nesting.
2010-07-19prefer Integer#to_s(16) to sprintf("%x\r\n")
It's slightly faster as theres no string to parse and also no garbage format string to be discarded.
2010-07-19rev + em: enable keepalive for pipe/socket responses
This makes it easier to write proxies for slow clients that benefit from keep-alive. We also need to be careful about non-HTTP/1.1 connections that can't do keepalive, now.
2010-07-10doc: avoid documenting internals on RDoc website
Since we suck at building websites, we just rely on RDoc as a website builder. And since Rainbows! is an application server (and not a programming library), our internal API should be of little interest to end users. Anybody interested in Rainbows! (or any other project) internals should be reading the source.
2010-07-04refactor response body handling for sendfile(2)
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.
2010-06-30deferred_response: remove needless include
2010-06-18avoid needless HeaderHash#to_hash calls
HeaderHash objects can only be used as headers without violating Rack::Lint in Rack 1.1.0 or later.
2010-06-06centralize body => IO conversion logic
Since EventMachine and Rev shared the same logic for optimizing and avoiding extra file opens for IO/File-ish response bodies, so centralize that. For Ruby 1.9 users, we've also enabled this logic so ThreadPool, ThreadSpawn, WriterThreadPool, and WriterThreadSpawn can take advantage of Rainbows::DevFdResponse-generated bodies while proxying sockets.
2010-04-19rev/deferred_response: cleanup and simplification
We can use the new HttpResponse.header_string method now instead of writing an empty body.
2009-12-04rev: do not initialize a Rev::Loop in master process
It may make it harder to switch between concurrency models with SIGHUP this way...
2009-11-07rev: DeferredResponse: always attach to main loop
It's too complicated to deal with multiple Rev loops so only use the main one for now under 1.9.
2009-11-07rev: DeferredResponse is independent of parser state
In the upcoming RevThread* models, the parser may be parsing other requests already by the time DeferredResponse is called.
2009-11-07rev: split out further into separate files for reuse
This will make things easier to manage with more Rev-based concurrency models.